Thursday, June 14, 2007

BLUETOOTH WITH WINDOWS

This article describes how to get Bluetooth to run on a Microsoft Windows PC.
Part I: Install Service Pack 2 on your system
Service Pack 2 has additional support for Bluetooth. Check this Microsoft support site for more information about bluetooth and Service Pack 2. (support site).
However, not all Bluetooth devices are supported by service pack 2, so the next task is to ensure that your Bluetooth device is supported or buy one that is. A list of supported Bluetooth devices can be found at Microsoft (supported devices).
Part II: Get your code to work with Bluetooth
The easiest way and the one way that allows you the most control over Bluetooth is to program on top of the Windows Socket 2.0. (A special description of Bluetooth for Microsoft can be found here, it will not help you get started, but it is useful as a reference guide later when you got your first program up and running)
At the moment I will not post a complete tutorial, but instead point to three places on the internet that can get you started on your first Bluetooth Program.
BlueCoveBlueCove is an open source project developed at Intel and allows you to use Bluetooth from Java. It does not implement the entire JSR-82, but some of the functions. They use the Windows Socket API and JNI to translate between C++ and Java. The good thing is that both the Java and the C++ part is open source so you can download the code and look at it.http://sourceforge.net/projects/bluecove/
Lenholgate forumIs a private web page that has an entry about Bluetooth. On the page is published some C++ code for getting you started with Bluetooth, it is really valuable so check it out.http://www.lenholgate.com/archives/000102.html
Windows XP SP2 Platform SDK If you download the SDK for Windows XP SP2 some sample code is attached. One example shows you how to program Bluetooth on top of WinSocket 2.0.SDK for Windows XP SP2
BlueServerI have used the above mentioned resources to implement a multithreaded server in C++. The server listens for incoming requests from mobile phones and spans a new thread and publishes the received data as XML on a local port. At the moment the code is not available online, but if you are interested you can read more about the BlueServer.
Part III: Getting help
There is at the moment no great place to seek help if you get stuck. I can only recommend looking at the links provided above or trying posting your question on experts' exchange.
I do not have the resources to answer technical questions, but do you have any comments or do you know about some relevant pages that describes Bluetooth and WindowsXP please feel free to drop me a line on thomasr@daimi.au.dk
Part IV: Other links and resources
Python and Bluetooth
Draft book dealing with programming for Bluetooth
Slides about programming for Bluetooth from MIT Pervasive Computing Course

No comments: