Reputation: 628
i'm currently trying to save some data in external memory via bluetooth LE. in order to send data i will first convert the string into HEX(ASCII) format
outbuffer += [UInt8](password.utf8)
String -> (HEX)ASCII
but when i retrieve the data back from external memory to get back the original data and i'm doing this
incomingData.getBytes(&array, length: 5)
let originalPassword = UnsafePointer<UInt8>(array).memory
(HEX)ASCII -> String
but i couldn't get back the original data. Can someone suggest me why? i'm new to this data conversion. Thank you
Upvotes: 0
Views: 52