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

characteristicsCallbacks keys instead of UUID, the hash of object #155

Open
bastiaanv opened this issue Jun 24, 2018 · 0 comments
Open

characteristicsCallbacks keys instead of UUID, the hash of object #155

bastiaanv opened this issue Jun 24, 2018 · 0 comments

Comments

@bastiaanv
Copy link

I am developing for a company that is using ble to communicate with their climate control system. They want to have all the lighting -for example- to have the same UUID's and that is were this plugin is running into problems within iOS.

The NSMutableDictionary characteristicsCallbacks is using the UUID's as key to save the callbacks. When you (like in my case) are using shared UUID's, some callbacks are being overwritten and will cause problems. When you use the hash of the object, you can bypass this problem. (Note, that you will still need to read before notify, if necessary)

This is how I solved the problem for every self.characteristicsCallbacks:
NSNumber* key = [NSNumber numberWithLong:(unsigned long)characteristic.hash]; self.characteristicsCallbacks[key];

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