I am using the following code to write the 0xDE value for a Bluetooth Caracteristic (Reset Device) using the IOS Core Bluetooth :
... NSData *bytes = [@\"0xDE\"
Swift 3.0: In case anyone is wondering the format for Swift is slightly different as writeValue can get the count from the array.
let value: UInt8 = 0xDE let data = Data(bytes: [value]) peripheral.writeValue(data, for: characteristic, type: .withResponse)