Jubish
April 20, 2017, 11:38am
1
I am trying to write in to BLE Characteristics.
Below is my example code
var buffer = this.stringToBytes("Test");
BLE.write(deviceID,serviceID,characteristicID,buffer).then(
result=> {
}).catch(error=> {
alert(JSON.stringify(error));
});
I am not successful with this code. Can any one please lead me to any example with BLE.write syntax. ?
Are you using https://ionicframework.com/docs/native/ble/ ?
Does other functionality of it work?
Do you get any errors or does just nothing happen?
Jubish
April 21, 2017, 4:58am
3
Yes I am using the same Frame work.
The read program is working fine . I am able to read the characteristic.
I think there is some syntax issues with the BLE.write value parameter.
I didn’t get any errors in the BLE.write call.
I don’t know anything about this plugin, but took a look at the docs:
https://ionicframework.com/docs/native/ble/#write
value | ArrayBuffer | Data to write to the characteristic, as an ArrayBuffer.
Is your buffer
an ArrayBuffer
?
Jubish
April 21, 2017, 10:57am
5
Thanks for the quick reply sujan.
Yes It’s Array buffer only. Its the same function from the docs page. I have to
Is there any other library for communicating with BLE devices available with Ionic ?