I am making BLE app. The BLE device is sending unsigned 10 byte of array. Each byte in array represents different sensor. In my app, I need to see data of these senors so there will be 10 labels so each byte data can be monitored.
I am able to make connection to BLE device and got service UUID and Characteristic UUID
Now please let know how to receive array data.
The first thing you must do is to save the byte values list into a global variable, to leave a trail for debugging.
Then you must check the length of list of the byte values list against the number 10.
Is it too short?
If so, complain with a Notifier.
Otherwise, copy the 10 list items to your label.text fields one by one.
I am still trying to find out how to implement what you said in blocks. This is my first app using blocks so am lost on implementing this logic using blocks...
i tried to copy items in label one by one but it is showing wrong values.. below block shows for only three labels.. All three labels showing values but are not matching first three bytes send by BLE device.. I checked on BLE terminal app. BLE device is sending correct data.
Try adding an extra label, where you can show the entire list for debugging.
Also, post the sketch here so we can see how you send those 10 bytes.
Finally, there is an alternative approach that has been used, where instead of ussuing readbytes, you register once for unsigned bytes and that causes the other side to keep sending them without the need to read bytes.