I’ve uploaded a new release of the Bluetooth library which adds the key feature of hosting services over bluetooth. This now allows two-way communications between devices and to demonstrate how this works I’ve included a sample Bluetooth Chat application. This registers a custom bluetooth profile and listens for incoming connections, and creates outgoing connections using this service identifier to other devices. In this way it only communicates with other devices exposing this service and wont interfere with any other applications using Bluetooth.
Thanks go out to Wei-Meng Lee for giving permission to base the sample on his previous IrDA chat application available with this MSDN article. The Bluetooth version works in a very similar way, with the exception of doing a device discovery when it first loads. An enhancement yet to be added is the ability to periodically discover in a background thread. From the app screen select the target device which must also be running the software and Bluetooth must be Discoverable. Then type your message and click send and it will appear onscreen on the other device. In the below example I had a brief conversation with Santa who was half-way up a chimney at the time – such is the versatility of Bluetooth 🙂

The ZIP file below includes the Bluetooth library project and compiled output, and the BTChat sample project. As I get time to do more work on the library I’ll post some other examples, and include versions for other platforms e.g. Smartphone and XP.
Known issues:-
- Hosting services doesn’t yet work on XP (some of the structures are slightly different so this requires a little more work)
- BluetoothClient.RemoteDeviceName doesn’t work so you can’t retrieve the device name from an open connection (Device names work correctly during discovery on both Windows CE and XP)
- BluetoothSerialPort (For emulating a COM port) is not fully tested and probably doesn’t work – SerialPortProfile connections work great using sockets (BluetoothClient).
Requirements:-
- SDF v1.2
- Windows CE Device or Windows XP computer using the Microsoft Bluetooth stack (Sorry but Widcomm is not supported).
Download:-
If you have any comments or questions please drop me an email. For now all that remains is for me to wish you a Very Merry Christmas!
2 replies on “Rudolph the Bluetoothed Reindeer”
" Microsoft Bluetooth stack (Sorry but Widcomm is not supported)."
Is Widcomm same as Broadcom? If not, can use same object/class for Broadcom bluetooth stack? HP iPaq 6300 using Broadcom.
Broadcom recently bought Widcomm so they are now one and the same. The only supported stack at this time is Microsoft – this post shows how to identify the Microsoft stack:-
http://blog.opennetcf.org/pfoot/PermaLink.aspx?guid=7311b52f-185c-4657-8d6d-beb8e8e32989