HI,all!
I want to know if BLE can send data to APP in form of String instead of Byte?(the examples all send in form of byte ) If it does can, can you mainly introduce the procedure?
Looking forward to your reply, thank you very much!
HI,all!
I want to know if BLE can send data to APP in form of String instead of Byte?(the examples all send in form of byte ) If it does can, can you mainly introduce the procedure?
Looking forward to your reply, thank you very much!
When you transfer data over BLE, there isn't really any concept of a string or any other format; it's just raw bytes. It's up to the devices in either end to interpret the data as wanted, and this is where service specifications come into play. For instance, the Heart Rate Service says that any data from a characteristic with UUID 0x2A37 is to be understood according to this format, while the Battery Service says that any data from a characteristic with UUID 0x2A19 is to be understood like this.
Your question is hence not really meaningful; any data transmitted over the air is just bytes, and it's up to you to read according to your own service specification, for instance as a string of some kind. If you create a custom service, as explained in nAN-36, it's hence perfectly possible for you to say that any data from a characteristic with UUID 4b50d9ee-1757-479a-86e9-8c2b348344da is to be understood as a string. Note that you must use a 128-bit UUID for all custom attributes, as described in the application note.
Why no upvotes?
Why no upvotes?