I try to implement RaspberryPI (BLE device) with a notification Characteristic
When I connect the 1st device (Android) to BLE device and subscribe it on notifications characteristic all work ok.
But then I do the same for the 2nd device (iOS)
Maybe OS doesn't matter.
Expected result: 2 devices stay subscribed and get notifications
Actual result: 1st device loses notifications
I feel problem in onSubscribe function and updateValueCallback callback
In console I haven't any errors
PS. I have tried push updateValueCallback in an array in onSubscribe function and do update forEach callback, but it works with the same problem + in this case I get problem with unsubscribe device, because In BLE device I haven't information which device is connected.
My implementation:
`const NOTIFICATIONS_SERVICE_UUID = '5292'
const NOTIFICATIONS_CHAR_UUID = 'e6c5'
I try to implement RaspberryPI (BLE device) with a notification Characteristic
When I connect the 1st device (Android) to BLE device and subscribe it on notifications characteristic all work ok. But then I do the same for the 2nd device (iOS) Maybe OS doesn't matter.
Expected result: 2 devices stay subscribed and get notifications Actual result: 1st device loses notifications
I feel problem in onSubscribe function and updateValueCallback callback In console I haven't any errors
PS. I have tried push updateValueCallback in an array in onSubscribe function and do update forEach callback, but it works with the same problem + in this case I get problem with unsubscribe device, because In BLE device I haven't information which device is connected.
My implementation: `const NOTIFICATIONS_SERVICE_UUID = '5292' const NOTIFICATIONS_CHAR_UUID = 'e6c5'
class NotificationsCharacteristic extends bleno.Characteristic { constructor() { super({ uuid: NOTIFICATIONS_CHAR_UUID, properties: ['read', 'notify'], value: null });
}
let notifications = new NotificationsCharacteristic(); notifications.startNotifications();
bleno.on('advertisingStart', function (error) { if (error) { console.log('advertisingStart Error: ' + error); } else { console.log('advertisingStart: STARTED');
}); `
I work with Ionic and connect to BLE device by ionic-ble plugin by next code
this.ble.connect(deviceId).subscribe((connectData) => { console.log('connectData: ', connectData); this.ble.startNotification(deviceId, NotificationServiceId, NotificationCharacteristicId) .subscribe((arrayBuffer) => { // show notification });
Thanks!