My app connects to a Bluetooth LE device. Typically, you scan your device using mBluetoothAdapter.startLeScan(mLeScanCallback); . The callback provides information about available devices.
If you want to connect to a dedicated device, you are doing something like
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);
and then
mBluetoothGatt = device.connectGatt(this, false, mGattCallback);
It seems to me that the only thing you need to connect to a BLE device is to know the BLE address, and then connect to it using the two above steps. Therefore, if I already know the BLE address (for example, it is written on the label of the BLE device), I do not need to perform a BLE check.
But what I came across is that if I have a BLE device that I have never found through a BLE scan before, it is not possible to connect directly to it using your BLE address. I have to find it through scanning at least once with my Android phone. Subsequently, I no longer need verification, and I can connect to the BLE device simply by using its BLE address.
Is this supposed to be the case or am I watching something?
Thanks a lot Stefan
source share