Folks,
I am rather new to droidscript and want to use it to monitor a BLE device.
Few questions on the BLE plugin:
1) I want to use the sample to read the content of a characteristic of my device. I just changed the service ID and characteristic ID and tried to read my characteristic with the example code.
I have two different chars to read: A byte array and a short number. For the short number I used the following code within the example:
function OnConnect()
{
app.ShowPopup( "Connected!" );
var svcId = "0000f00d-1212-efde-1523-785fef13d123"; // My Service-ID
var charId = "0000dead-1212-efde-1523-785fef13d123"; // My Characteristic ID
ble.WatchValue( svcId, charId, "short", OnValue );
}
function OnValue( svcId, charId, val )
{
txt.Log( charId + " -> " + val );
}
I get successfully connected to my device but never see the content of the characteristic on screen.
I have used Nordic nRFconnect app on my tablet to re-check. With this app I can read the characteristic without any problems...what is going wrong?
2) What do I have to do if I want to write a value into a characteristic that is marked writable?
3) Where can I find a description of all functions of the BLE plugin?
Thanks for your help.
Regards
Ulf