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