It is unlikely to work the way you want. There is a MTU limit so data is split into 'random' packets. So you may not get complete line in one write/notification anyway due to that.
Guaranteed MTU is 21 bytes, anything above that depends on negotiation between two connected devices.
Can't you just add what you get to some string/buffer and then just parse and remove complete line(s) from beginning of that line by line?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
It is unlikely to work the way you want. There is a MTU limit so data is split into 'random' packets. So you may not get complete line in one write/notification anyway due to that.
Guaranteed MTU is 21 bytes, anything above that depends on negotiation between two connected devices.
Can't you just add what you get to some string/buffer and then just parse and remove complete line(s) from beginning of that line by line?