Quote
The problem is that I don't know how many lines of G code can be sent to the board ...
After accepting a line of G-code, firmwares send back an "ok". This is sort of a flow control. Marlin ans Sprinter limit G-code lines to 63 characters.
Teacup offers XON/XOFF flow control in addition to the "ok"-type. The advantage of XON/XOFF is, it's handled at the driver layer, no need for the application to take care. The drawback is, pausing a print is almost imossible, because drivers have rarther large buffers (typically 16k or several hundred lines of G-code).
For an even more advanced concept, see [
reprap.org] AFAIK, no implementation, so far.