Skip to content

Instantly share code, notes, and snippets.

@choipd
Last active May 13, 2016 14:45
Show Gist options
  • Save choipd/3bf8e6aedc7ba030771ad1de36741a4f to your computer and use it in GitHub Desktop.
Save choipd/3bf8e6aedc7ba030771ad1de36741a4f to your computer and use it in GitHub Desktop.
Write something to BLE printer.
- (IBAction)printHelloWorld:(id)sender {
NSString * str = @"Hello World\n\r";
NSData* data = [str dataUsingEncoding:NSUTF8StringEncoding];
[self.printerPeripheral writeValue:data forCharacteristic:self.writeCharacteristic type:CBCharacteristicWriteWithoutResponse];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment