Can you read the data from a NSData array somehow? Haven’t figured out how yet. Would be nice to be able to use string.unpack and string.pack to read and write NSData.
I’ve been able to read the heart rate from my PineTime watch, but not been able to read the NSData value.
@tnlogy The only way I’ve found to write bytes into one was to initialise the NSData from a file. Certainly not ideal but it works. I suspect you could write the data out to a file with the NSData write function and then read it back with Lua’s io.open().
@Steppers ouch, that was cumbersome. I hope s future Codea release might make it easier.
Figured out that you can convert it to base64 and then read it in Codea. Some more code is available in the thread about bluetooth.
d = objCBCharacteristic.value:base64EncodedStringWithOptions_()
st = base64.decode(d)