- (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error{
FPANE_Log([NSString stringWithFormat:@"spiketrace ANE G5BLEManager.m in didDiscoverCharacteristicsForService, discovered characteristics"]);
if (error) {
FPANE_Log([NSString stringWithFormat:@"spiketrace ANE G5BLEManager.m error Discovered characteristics for %@ with error: %@", service.UUID, [error localizedDescription]]);
return;
}
for (CBCharacteristic *characteristic in service.characteristics){
if ([characteristic.UUID isEqual:[CBUUID UUIDWithString:G5_MM_WRITE_CHARACTER_UUID]]) {
FPANE_Log([NSString stringWithFormat:@"spiketrace ANE G5BLEManager.m in didDiscoverCharacteristicsForService, found writeCharacteristic"]);
self.writeCharacteristic = characteristic;
}
if ([characteristic.UUID isEqual:[CBUUID UUIDWithString:G5_MM_NOTIFY_CHARACTER_UUID]]) {
FPANE_Log([NSString stringWithFormat:@"spiketrace ANE G5BLEManager.m in didDiscoverCharacteristicsForService, found notifyCharacteristic"]);
self.notifyCharacteristic = characteristic;
[peripheral setNotifyValue:YES forCharacteristic:characteristic];
}
}
}