Bluetooth Low Energy check if device is connectable
-
Hi,
is there a way to check if device is connectable?
Once the device is discovered and I get the signal deviceDiscovered(const QBluetoothDeviceInfo&)) to call my slot, I get the QBluetoothDeviceInfo&.On Qt5.12 I can read the manufacture data from QBluetoothDeviceInfo&, but how do I know if the peripheral was advertising as connectable or non-connectable?
Is there a way to know this using QBluetoothDeviceInfo? -
@michaelL said in Bluetooth Low Energy check if device is connectable:
a way to know this using QBluetoothDevi
@michaelL you can check serviceUuids to see have enough service as your device provide or not. if service list is enough. then it is connectable.
-
@Pham-Hoang said in Bluetooth Low Energy check if device is connectable:
serviceUuids
@Pham-Hoang it advertise always the same services. But only the type flag is different. I have checked now and the application output gave me this hint:
D BluetoothDevice: mAddress: 77:A5:12:38:FA:6F D BluetoothDevice: getBluetoothClass: classInt = 7936 D BluetoothDevice: getType: type = 2 D BluetoothDevice: getName: name = myPeripheralName
So type = 2 it means connectable and type = 3 is non connectable. But how can I read this function "getType"? I don't see it on QBluetoothDeviceInfo class.