Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
502 views
in Technique[技术] by (71.8m points)

bluetooth lowenergy - bleno BLE character publication via onSubscribe doesnt work with UInt16 / values above 255

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]));
      });
    }
})  

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share

1.2m questions

2.1m answers

5 comments

56.5k users

...