How to detect nearby Bluetooth devices?


#1

Hello:

Is there any example code showing how to detect all nearby Bluetooth devices to a Duo?

For example I want to be able to read the address of all mobile phones in the vicinity …

Do the Bluetooth devices have to have turned their discovery ON?

Thanks.


#2

Hi @jimmie,

Please read the BLE Scanner and Simple BLE Peripheral examples here. They demonstrates how to utilize the Duo to discovery nearby BLE devices.

But keep in mind that the Bluetooth devices those can be discovered by the Duo must be a BLE enabled device and it is advertising during the Duo is scanning.

Best regards,
Guohui


#3

Thank you @guohui.

So there is no way to find out about devices whose Bluetooth is on but not “discover able”?


#4

Essentially it should be a BLE enabled device, so that it can be discovered by the Duo, since the Duo now only support discovery BLE devices.

Thanks


#5

Thank you @guohui.

I just need to find MAC addresses (i.e. not interested in pairing).

Can BLE devices turn their discovery “off” (Bluetooth still on)? In that case, can they still be seen (MAC addresses) by your hardware ?

Do most iPhones and Android phones use BLE?


#6

If you have turned the BLE discovery off, it can not be discovered by other BLE devices any more. Some smart phones support BLE functionality, while others not.


#7

I’m able to scan the BLE devices using windows 10 ble stack api. But GattDeviceServicesResult class is not found in the sdk and document is mention prereleased ( https://docs.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.bluetoothledevice) . So is there is any idea to invoke GattDeviceServicesResult class and windows 10 ble api is commercial or free.

Regards,
John