Multiple Metawears and method callbacks
In the project I'm currently working on I need multiple metawears connected to one iOS device, I'm using the latest Xcode 6.2 and iOS 8.2. Multiple metawears connect without problems but when I subscribe to get data from multiple boards (any inputs: pushbutton, accelerometer, temperature sensor) I don't know how to detect from which board the data is sent.
[device[i].mechanicalSwitch.switchUpdateEvent startNotificationsWithHandler:^(MBLNumericData *obj, NSError *error) {
NSLog(@Switch Changed: %@", obj);
}];
How can I know from which board that message is sent?
Using [NSThread callStackSymbols] I can retrieve an address of a MBLRegister but that is not enough to get to the device instance or device identifier.
This discussion has been closed.
Comments
for (MBLMetaWear *cur in devices) {
[cur.mechanicalSwitch.switchUpdateEvent startNotificationsWithHandler:^(MBLNumericData *obj, NSError *error) {
NSLog(@Switch Changed: %@, On Device: %@", obj, cur);
}];
}