BLE 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?
-
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?
@michaelL said in BLE check if device is connectable:
how do I know if the peripheral was advertising as connectable or non-connectable?
Actually you don't even know if it was advertising at all. Some operating systems (Windows, ChromeOS, possibly also macOS I'm not sure) report Bluetooth devices that are paired in the system. Even if the device is not in range, offline - the operating system will happily report it is available, and Qt will happily send you
deviceDiscovered()
. -
@sierdzio said in BLE check if device is connectable:
you don't even know if it was advertising at all. Some operating systems (Windows, ChromeOS, possibly also macOS I'm not sure) report Bluetooth devices that are paired in the system. Even if the device is not in range, offline
@sierdzio
On IOS swift BLECore and Android BLE Library you can check if device is connectable or non connectable (Beacons) and read manufacure data. I have it in my Apps and on my peripheral device i can swap as connectable or non connectable.
So on Qt before i connect i musst check if it is connectable. The work around would be to connect and on the callback get the error and re-discover.