Skip to content

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

@bastiaanv

Description

@bastiaanv

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];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions