Convert text to ASCII and sending it Byte by Byte

Hello all,

I would like to send numerical data from a mobile to my device via Bluetooth (BLE).

For example, I want to send the number 31111. To do it, I convert each single digit to its corresponding ASCII value (3 is 51 and 1 is 49) and send it byte by byte. I did this only for test, because this method is not very optimal, but it proved that my device can read data from the app. Below the picture to better understand what I did.

In the final version of my app, I want to have a text box where the user can enter a random number.

My question is, how can I convert the data from the text box and send it to my device in a more efficient way than using multiple writeBytes blocks one by one?

Thanks!

The values parameter has a name ending in 's', to imply that it can accept a list.
(Double check me by consulting the block's tool tip.)

So you could send a list of bytes.

But why not just send a text string using the block for that?

And shouldn't there be consideration of how to know at the other end that it has seen the end of the text, through some ending character ('\n' or '\0') or by some BLE protocol in the Text transmission block?