Optional onreadfromremoteThis is a callback function used when characteristic is read by an external device.
characteristic.onreadfromremote = function(address){
console.log("remote address :",address);
}
Optional onwritefromremoteThis is a callback function used when characteristic is read by an external device.
characteristic.onwritefromremote = function(address, newvalue){
console.log("remote address :",address);
console.log("remote data :",newvalue);
}
Service instance
It is uuid as string.
console.log(attr.uuid); // => '4C84'
Get descriptor array
Add new descriptor
Add property
Get descriptor
This sends notify to the connected central.
var characteristic = new obniz.ble.characteristic({
uuid: 'FFF1',
data: [0x0e, 0x00],
properties : ["read","write","notify"], // add notify properties
});
var service = new obniz.ble.service({
uuid: 'FFF0',
characteristics: [characteristic],
});
obniz.ble.peripheral.addService(service);
// after central connected
characteristic.notify();
Remove property
Generated using TypeDoc
Create Characteristics