Created
July 27, 2018 08:40
-
-
Save SunXiaoShan/340ccb7f5d8a6ca75ac62790c274c804 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)sendMessage:(NSString *)context { | |
if ([self.peripherals count] < 1 || context == nil) { | |
return; | |
} | |
NSData *xmlData = [context dataUsingEncoding:NSUTF8StringEncoding]; | |
CBPeripheral *peripheral = [self.peripherals firstObject]; | |
[peripheral writeValue:xmlData forCharacteristic:self.cbCharacteristic type:CBCharacteristicWriteWithResponse]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment