32

I am in the process of writing a Bluetooth scanner that locates and identifies mobile devices in the local vicinity. Is this something that I can accomplish using C#, or do I need to drop down into the C/C++ APIs? My application is targeting Windows XP and Vista. Pointers are appreciated.

Thanks!

cjkarr
  • 381
  • 1
  • 3
  • 6

3 Answers3

25

One problem with Bluetooth on the PC is that there are several BT stacks in use and you can never quite know which one is available on a given machine. The most common ones are Widcomm (now Broadcom) and Microsoft (appeared in XP, maybe one of the service packs). However, some BT hardware vendors package BlueSoleil and some use Toshiba. Most dongles will work with the MS stack so the .NET libs I've seen tend to use that.

Each of the stacks has a totally different way of doing the discovery part where you browse for nearby devices and inquire their services.

If I had to pick one approach today I'd probably do the discovery in C++ and add an interface for .NET.

The 32feet.net stuff worked pretty well when I tried it but didn't support the Widcomm stack.

Andrew Queisser
  • 1,163
  • 10
  • 20
  • 2
    Also, I've tried 32Feet on Windows 10 and get "32feet.NET does not support the Bluetooth stack on this device." I've reported the issue, but it looks like the project hasn't been updated in a couple of years... – LawMan Sep 02 '15 at 12:50
  • @LawMan I had a similar problem with Windows 10. The cause was that Bluetooth was turned off. – Juozas Kontvainis Oct 21 '15 at 13:14
  • @Juozas Kontvainis That wast the first thing that I checked. Even though my code would pair the device if it wasn't paired (or at least it used to...lol), I made sure that Windows had successfully paired with the device, then executed my code. Also, 32Feet has yet to respond to my issue. Here's the issue link if anyone is interested. https://32feet.codeplex.com/workitem/43236 – LawMan Oct 21 '15 at 18:20
  • 1
    @LawMan I've responded to your question in codeplex. For me I fixed that issue by uninstalling current bluetooth drivers and then installing generic microsoft bluetooth drivers. I attached some installers to the answer but you can also get them here: http://bluetoothinstaller.com/ – Hagelt18 Dec 21 '15 at 22:26
16

There is also Peter Foot's 32feet.net

http://inthehand.com/content/32feet.aspx

I've played around with this back when it was v1.5 and it worked well.

Kyle
  • 547
  • 1
  • 3
  • 7
  • I've been using the 32feet.net library on a windows mobile app and it works really well – tjjjohnson May 25 '10 at 22:52
  • 1
    Ive been trying to use this but having troubles finding good documentation and working examples. 32feet seems to be very popular but people must not like to share working examples. – Mike Mar 31 '18 at 23:38
8

Mike Petrichenko has a nice BT framework. It works with BlueSoleil, Widcomm, Toshiba and Microsoft.

It is now called the Wireless Communications Library and works with Bluetooth 802.11 and Infrared. Mike named the company Soft Service Company and sells non-commercial and commercial licenses with and without source code in prices ranging between $100 and $2050.

Community
  • 1
  • 1
Guge
  • 4,569
  • 4
  • 35
  • 47
  • 1
    I was using 32feet for a project and was getting a lot of random errors connecting to an SPP device. I tried the demo of WCL and it seemed to work much better. – JoelHess Sep 18 '13 at 19:04