I'm using bleno as BLE publisher on a RbPI.
The example below shows how I publish a 'number' value to the subscribed listeners.
works well if 'number' is an Int8. When it becomes >255 / Int16 it doesn't work anymore. Anyone familiar in submitting larger numbers as char values in Bleno, or should I break it up in multiple smaller numbers in the buffer array? Apologies if this is a newbee question. Not so familiar with all of this.
new bleno.Characteristic({
value : null,
uuid : '34c2',
properties : ['notify'],
onSubscribe : function(maxValueSize, updateValueCallback) {
eventEmitter.on('totalSeconds', (number) => {
updateValueCallback(new Buffer([number]));
});
}
})
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…