Peripheral: Monitoring update

The other devices can connect to obniz using BLE and read or write the value of characteristics. You can notice read/write by setting a function called when such an event occurs.

Reading notification

By specifying a function in peripheral.onreadfromremote, you can know that the value of the characteristics has been read. This function is called every time the value is read.

// Javascript Example

characteristic.onreadfromremote = function(address){}

Writing notification

You can detect writing by specifying a function in characteristic.onwritefromremote. "address" stores the address of the central and "newvalue" has the value written by it.

// Javascript Example

characteristic.onwritefromremote = function(address, newvalue){
}