I've got a strange problem using CoreBluetooth on iPhone 5C & iPhone 5S. By scenario, I'm going to receive 83 bytes of data, chunked by 20 bytes (5 chunks in common). And data are differs on iPhone 5S/5C (please see the dump below): chunk #4 substitutes chunk #3 under these devices. But on iPad3 (with the 6.1 & 7.0.2 iOS) all is OK
// iPhone 5C, iOS 7.0.2
nRF UART[237:60b] Received data on a characteristic. 0x01=001,0x02=5B2226
nRF UART[237:60b] Received data on a characteristic. 400192,0x05=1.0.0,0x
nRF UART[237:60b] Received data on a characteristic. ,0x09=2,0x0a=0,0x0b=
nRF UART[237:60b] Received data on a characteristic. ,0x09=2,0x0a=0,0x0b=
nRF UART[237:60b] Received data on a characteristic. 100ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ
// iPad 3, iOS 6.1.3 && iPad 3, iOS 7.0.2
nRF UART[221:60b] Received data on a characteristic. 0x01=001,0x02=5B2226
nRF UART[221:60b] Received data on a characteristic. 400192,0x05=1.0.0,0x
nRF UART[221:60b] Received data on a characteristic. 07=2013.010,0x08=001
nRF UART[221:60b] Received data on a characteristic. ,0x09=2,0x0a=0,0x0b=
nRF UART[221:60b] Received data on a characteristic. 100ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ
// iPhone 4S, iOS 6.1.3
nRF UART[241:60b] Received data on a characteristic. 0x01=001,0x02=5B2226
nRF UART[241:60b] Received data on a characteristic. 400192,0x05=1.0.0,0x
nRF UART[241:60b] Received data on a characteristic. 07=2013.010,0x08=001
nRF UART[241:60b] Received data on a characteristic. ,0x09=2,0x0a=0,0x0b=
nRF UART[241:60b] Received data on a characteristic. 100ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ
My question is: how to get a normal data from 5S/5C devices? Perhaps, there are some tricks with CBCharacteristic or CBCentralManager?
Thanks.
EDIT
As @allprog suggested, here is the fragments of the code how I'm using CoreBluetooth.
This is the pretty basic approach:
// CBCentralManager init
self.cm = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
// Getting data chunks from CBCharacteristic in CBPeripheral's Delegate
- (void) peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
{
if (error)
{
NSLog(@"Error receiving notification for characteristic %@: %@", characteristic, error);
return;
}
NSLog(@"Received data on a characteristic. %s", [[characteristic value] bytes]);
// ... the rest of code
}