覆盆子Bleno断开灯光应用程序连接的连接安全性特征
我正在使用Bleno安装在Raspberry Pi上进行一些测试,而且我经历了具有安全特征的大问题。
我可以在Android和iPhone上使用LightBlue复制这种情况。
如果我定义了具有安全的Characteristic的服务,那么当我尝试阅读这种charachteristic时,Bleno会解散断开回调,并冻结直到我重新启动。
我已经升级到Bluez 5.64,没有任何改变。
var StaticReadOnlyCharacteristic = function() {
StaticReadOnlyCharacteristic.super_.call(this, {
uuid: 'fffffffffffffffffffffffffffffff1',
properties: ['read'],
secure:['read'],
value: Buffer.from('value'),
descriptors: [
new BlenoDescriptor({
uuid: '2901',
value: 'user description'
})
]
});
};
util.inherits(StaticReadOnlyCharacteristic, BlenoCharacteristic);
function SampleService() {
SampleService.super_.call(this, {
uuid: 'fffffffffffffffffffffffffffffff0',
characteristics: [
new StaticReadOnlyCharacteristic()
]
});
}
util.inherits(SampleService, BlenoPrimaryService);
bleno.on('stateChange', function(state) {
console.log('on -> stateChange: ' + state + ', address = ' + bleno.address);
if (state === 'poweredOn') {
bleno.startAdvertising('test', ['fffffffffffffffffffffffffffffff0']);
} else {
bleno.stopAdvertising();
}
});
I'm doing some tests with bleno installed on a Raspberry Pi, and i'm experiencing big issues with secure characteristics.
I can replicate this scenario with LightBlue on android and iPhone.
If i define a service with a secure charachteristic, when i try to read this charachteristic, bleno fires the disconnect callback, and it freezes until i restart it.
I've already upgraded to bluez 5.64, nothing changed.
var StaticReadOnlyCharacteristic = function() {
StaticReadOnlyCharacteristic.super_.call(this, {
uuid: 'fffffffffffffffffffffffffffffff1',
properties: ['read'],
secure:['read'],
value: Buffer.from('value'),
descriptors: [
new BlenoDescriptor({
uuid: '2901',
value: 'user description'
})
]
});
};
util.inherits(StaticReadOnlyCharacteristic, BlenoCharacteristic);
function SampleService() {
SampleService.super_.call(this, {
uuid: 'fffffffffffffffffffffffffffffff0',
characteristics: [
new StaticReadOnlyCharacteristic()
]
});
}
util.inherits(SampleService, BlenoPrimaryService);
bleno.on('stateChange', function(state) {
console.log('on -> stateChange: ' + state + ', address = ' + bleno.address);
if (state === 'poweredOn') {
bleno.startAdvertising('test', ['fffffffffffffffffffffffffffffff0']);
} else {
bleno.stopAdvertising();
}
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论