Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

EnableNotifications not handling callbacks correctly #291

Open
TheRealDJ opened this issue Sep 11, 2024 · 0 comments
Open

EnableNotifications not handling callbacks correctly #291

TheRealDJ opened this issue Sep 11, 2024 · 0 comments

Comments

@TheRealDJ
Copy link

In the EnableNotifications functions, there is no check to see if the callback passed is already on the list. For example, if you do:

c.EnableNotifications(notification_callback)
c.EnableNotifications(notification_callback)

the notification_callback function will run twice for each notification.

The callback is also not removed from the list when nil is passed as the callback, the code just sets the attribute to [0x00, 0x00]. For example:

c.EnableNotifications(notification_callback)
c.EnableNotifications(nil)
c.EnableNotifications(notification_callback)

the notification_callback function will run twice for each notification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant