views:

1028

answers:

2

On a Windows Mobile 5.0 device I have an MFC C++ kiosk application that should programmatically connect to one of 3 Bluetooth headsets and open a bidirectional audio connection to it.

The headsets are already known to the device, it's only the switching and connecting part that should be done programmatically.

How would I do that?

I'm aware of the thread How to “Connect via Bluetooth” in WM programmatically? but would like to have a way that works in C++.

Any ideas?

A: 

For Windows Mobile there are two main bluetooth stacks available: Widcomm Bluetooth Stack and Microsoft's Bluetooth stack. Both of these offer a native API and you can google for examples on their use.

I suppose that what the 32feet.NET library does is to offer a common interface on top of these. You could try to have a look at the sources to see how this is done.

If you only need to run your application in a single device, then you can find, which Bluetooth stack is using and code for that only. This would be a much easier, yet not portable solution.

kgiannakakis
A: 

I would start looking in MSDN Windows Mobile 5.0 documentation for the Blue Tooth APIS.

The changing of the Audio Device to the Bluetooth device is likely to be the hard bit. Depending on what application you are trying to switch between you may like to look into Waveform Audio for Windows Mobile-based Devices API.

Having never done any of the above, I can't say if it's enough but it should get you started.

Shane Powell