Bluetooth and AVR MCU



Please tell me how to correctly receive commands from devices (for example, based on the AVR AtMega8 microcontroller). I need to take a few text lines in a row and then process it. I’m wondering how the application on my smartphone will understand where the end of the first line is? I learned to take strings and do it like this:

In this case, the timer interval is 500 ms, but what if I need to take 10 lines in a row? How to implement it correctly?

Thank you in advance!