-(void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
{
dispatch_async(dispatch_get_main_queue(), ^{
NSData *data = characteristic.value;
uint8_t *array = (uint8_t*) data.bytes;
cadenceValue = [CharacteristicReader readUInt8Value:&array];
self.cadence.text = [NSString stringWithFormat:@"%d", cadenceValue];
});
}
How to get cadence from bLE (Bluetooth low energy) device in swift 2. I am unable to find exact code for this. For this didUpdateValueForCharacteristic
delegate method is called.
I have a code of nRF Toolbox but it is in objective c or swift 3 but my project is in swift 2. I tried to call objective c method using bridging header but it was always returned 0 cadence.