Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Event leaking. Any active notifications not removed prior to device disconnect leak. #12

Open
steves2j opened this issue Aug 24, 2020 · 0 comments
Assignees

Comments

@steves2j
Copy link

steves2j commented Aug 24, 2020

When subscribing to a notify attribute on a BLE device with startNotifications() the created listener is not removed when a device.disconnect() is called.
This will cause the subsequent connect and subscription to have corrupt data in the valuedchanged event.

e.g.
`
const readNotify = await service.getCharacteristic('aUUid');

await readNotify .startNotifications();

readNotify.on('valuechanged',buffer=>{ buffer has some data});

await device.disconnect();

await device.connect();

await readNotify .startNotifications();

readNotify.on('valuechanged',buffer=>{ buffer has previous data and some new data});

`

@chrvadala chrvadala self-assigned this Oct 28, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants