Hi,
I am using a HM10 BLE device together with BLE extended and BLE2 librares.
BLE2 is used to scan the devices
BLE ext to connect to them and send AT commands to the beacon
Everything is working very fine but when I use the "password protected" mode of the beacon, I get the "connected event" before I enter the PIN code.
So the input password wndows appears but as I can't trap it, my code fails as no actual connection is indeed achieved.
Do you know if there is a way to trap the "pairing in progress" event to wait for pairing completed before exiting this sub ?
Thank you in advance
I am using a HM10 BLE device together with BLE extended and BLE2 librares.
BLE2 is used to scan the devices
BLE ext to connect to them and send AT commands to the beacon
Everything is working very fine but when I use the "password protected" mode of the beacon, I get the "connected event" before I enter the PIN code.
B4X:
Sub BLE_Connected (Services As Map)
If ConnectState = cstatePreConnect Then
ConnectState = cstateConnect
'Log("BLE Connected")
bleService = Services.GetValueAt(2)
readCharacteristic = bleService.GetCharacteristics.GetValueAt(0)
Manager.ReadCharacteristic(readCharacteristic)
Manager.SetCharacteristicNotification(readCharacteristic, True)
writeCharacteristic = bleService.GetCharacteristics.GetValueAt(0)
ToastMessageShow(Locale("connected to " &TheConnectingBeacon.name), True)
End If
End Sub
So the input password wndows appears but as I can't trap it, my code fails as no actual connection is indeed achieved.
Do you know if there is a way to trap the "pairing in progress" event to wait for pairing completed before exiting this sub ?
Thank you in advance