1
votes

I am new to Bluetooth programming. I am using the Microsoft methods for Bluetooth in Windows. I have a heart rate sensor and have figured out how to create service and characteristics buffers to iterate through what services and characteristics that are available under those services.

But how can I get the actual name of the device (like what shows up in regular Windows applications when you pair a device)? For example, I want to get something like "Big Company Heart rate sensor version 6."

I am using C++, Windows 8.1 and Visual Studio 2013. I have tried different solutions on SO, but they show me how to find service specific information.

Thanks!

2

2 Answers

0
votes

You'd use BluetoothGetDeviceInfo , where the device name is in the .szName member of the BLUETOOTH_DEVICE_INFO

0
votes

first of all, you will need to get to the bluetooth adapter by calling BluetoothAdapter.getDefaultAdapter()

Next you will call the startDiscovery() from bluetooth adapter. At this point the discovery process will begin so that you can register a BroadcastReceiver with ACTION_FOUND, ACTION_DISCOVERY_STARTED, ACTION_DISCOVERY_STARTED. For each device found, the intent will carry extra field EXTRA_DEVICE containing the BluetoothDevice object, unless you want to end the script once the HeartMonitor is discovered. Be sure to unregister the receiver on Activity’s onDestroy method.

Hope this helps :) Good luck.