Using Bluetooth in Xojo 2016r4.1

To be able to show my heart rate during Twitch gaming streams I purchased a Plugable Bluetooth USB Adapter that is Bluetooth 4.0 Low Energy compatible.

Looking back I could only find a few mentions of RB or Xojo with BT and the idea was to open communication as if it was a serial device. Is this still considered the best or even only option or is there a more ‘official’ way of handling the BT communication and protocols?

It probably still is. I haven’t seen any specific talk about BT communications

Well that confirms my ‘fear’, Dirk, and it proves why yesterday I had such a hard time trying to set up a connection to this device.

As I can not get my Bluetooth adapter nor heartbeat sensor to advertise themselves through an old school COM port I have not yet found a way to talk and listen to them. The search continues…

Some devices that connect through BT simply behave as standard serial communication devices. If that were your case it would be very simple to start talking to your device. I would have expected this to be the case with such device. Does it come with its own application? Do you have information on how to talk to it?

If your device doesn’t do that you will need lower level programming to talk to it. It should come with some API (a dll maybe?).

Julen

[quote=308792:@Richard Altenburg]To be able to show my heart rate during Twitch gaming streams I purchased a Plugable Bluetooth USB Adapter that is Bluetooth 4.0 Low Energy compatible.

Looking back I could only find a few mentions of RB or Xojo with BT and the idea was to open communication as if it was a serial device. Is this still considered the best or even only option or is there a more ‘official’ way of handling the BT communication and protocols?[/quote]
It would be helpful to know which platform you are on. I’ve done some work with BLE on iOS in the past and that may be of some help pointing in the right direction if your target is OS X.

Good point, Greg, I am currently working on Windows 10 as this PC is also where I broadcast my gaming streams from, and where I would like to use the executable on. But ultimately I use Xojo for its multi-platform capabilities so the more cross-platform I can write the better.

I can not get my Polar H7 to advertise itself as a COM-port on Windows, I tried using the Bluetooth settings panel of Windows 10 to bind the device to a COM-port and it does not see it as one of the possible devices that allow it.

I also searched for a 3rd party utlity that could bind a BT device to a COM-port but had no success yet.

Once my system starts discovering my BT device as a serial port device I would definitely be able to communicate with it using the GATT protocol for health devices, but as long as I have no open connection to it I am left in the dark.

The Polar H7 conforms to BT standards for heart rate monitors and as such works with many apps and hardware devices you would find for example in gyms. It does not come with a driver as Windows 10 recognizes it by default.

If found this: https://developer.polar.com/wiki/H6_and_H7_Heart_rate_sensors

It shows an example of reading data from the H7 on iOS and also mentions the use of a Bluetooth enumerator on Windows. I can not call the BT enumerator to get an ID of a BT device through Xojo, but the frameworks are there, I bet on Mac OS X as well.

I had a quick look at those MS info pages… I get lost there, sorry. Maybe someone can help with that.

Julen

The Silicon Labs BlueGiga BLED112 dongle has COM port support:

https://www.silabs.com/products/wireless/bluetooth/bluetooth-low-energy-modules/bled112-bluetooth-smart-dongle

I have read, though, that WIndows only supports one Bluetooth adapter at a time, so if you’ve got a wireless mouse, keyboard, etc. that could be an issue.