Skip to content

Instantly share code, notes, and snippets.

@nolili
Created November 15, 2014 08:28
Show Gist options
  • Save nolili/8d76128bb70d2263cb5a to your computer and use it in GitHub Desktop.
Save nolili/8d76128bb70d2263cb5a to your computer and use it in GitHub Desktop.
CBCharacteristicからデータ取り出し
- (void) peripheral:(CBPeripheral *)aPeripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
{
// 長さチェック、エラーチェックなどは省略している
NSData *data = characteristic.value;
uint8_t value[2] = {0x00, 0x00};
[data getBytes:value length:2];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment