I have got an v.BTTN device (small wearable BLE button)
http://www.vsnmobil.com/products/v-bttn-wearable-bluetooth-le-4-0-device
First of all, this problem does not happens on debug, only on Release App and when the device window is locked, so I cannot get anything from the releaseLogger!
First I start the app, detect the BLE button, connects to it OK, so I register to the notification service and characteristic
Until here everything is fine, if I press the button, the notification arrives OK. But if I press the screen lock button, and then press the BLE button, the button gets disconnected (double beep) and the application crashes.
I have this code upon notification arrival:
If I comment "data=Characteristics.Get("FFFFFFF4-00F7-4000-B000-000000000000")" then the application runs fine. Have no clue here where to start.
Has anyone has some experience or experienced something like this?
Thanks FBP
http://www.vsnmobil.com/products/v-bttn-wearable-bluetooth-le-4-0-device
First of all, this problem does not happens on debug, only on Release App and when the device window is locked, so I cannot get anything from the releaseLogger!
First I start the app, detect the BLE button, connects to it OK, so I register to the notification service and characteristic
B4X:
Dim data() As Byte
Dim bc As ByteConverter
'Verificaction code write to device
data=bc.HexToBytes("80BEF5ACFF")
BLE.WriteData("FFFFFFF0-00F7-4000-B000-000000000000", "FFFFFFF5-00F7-4000-B000-000000000000", data)
'set Stelath Mode (NO LED, JUST BEEP)
data=bc.HexToBytes("02")
BLE.WriteData("FFFFFFF0-00F7-4000-B000-000000000000", "FFFFFFF1-00F7-4000-B000-000000000000", data)
'Detection Configuration for button press, detect only press and release, no long click detect
data=bc.HexToBytes("01")
BLE.WriteData("FFFFFFF0-00F7-4000-B000-000000000000", "FFFFFFF2-00F7-4000-B000-000000000000", data)
'Set the BLE to notify me when service and characteristc of button press is detected
BLE.SetNotify("FFFFFFF0-00F7-4000-B000-000000000000", "FFFFFFF4-00F7-4000-B000-000000000000", True)
'Just reading the battery level
BLE.ReadData("180F") ', "Battery Level")
Until here everything is fine, if I press the button, the notification arrives OK. But if I press the screen lock button, and then press the BLE button, the button gets disconnected (double beep) and the application crashes.
I have this code upon notification arrival:
B4X:
If Characteristics.ContainsKey("FFFFFFF4-00F7-4000-B000-000000000000") Then
Try
Dim data() As Byte
Try
data=Characteristics.Get("FFFFFFF4-00F7-4000-B000-000000000000")
Catch
Log(LastException.Description)
End Try
If I comment "data=Characteristics.Get("FFFFFFF4-00F7-4000-B000-000000000000")" then the application runs fine. Have no clue here where to start.
Has anyone has some experience or experienced something like this?
Thanks FBP