Windows API - scan for BLE devices before using BluetoothGATTGetServices

Viewed 27

I am trying to get BLE ported to Windows.

I found how to use BluetoothGATTGetServices to get the device services, but I am not sure is there a way to scan for BLE devices and obtain the hDevice handle? I found ways to obtain the handle using paired devices, but in my case the device is not paird.

1 Answers

Depends on the protocols you are trying to implement, but standart service for advertising and scanning is GAP, which is interconnected with GATT. Make sure your device has both of the services and than implement the method for scanning for bluetooth devices. As I understand you are trying to make some sort of application for the computer which would scan for the devices. I don't know much about BLE development for windows but i guess you can implement some simple python script like

import bluetooth
devices = bluetooth.discover_devices(lookup_names = true)
for addr, name in devices:
   print("adress :", addr)
   print("name :", name)
Related