altera2015 / usbserial

Flutter Android USB Serial plugin
BSD 3-Clause "New" or "Revised" License
121 stars 83 forks source link

Null-terminated strings #26

Closed GrantSavill closed 4 years ago

GrantSavill commented 4 years ago

Hi there,

What is the proper way to use this with null-terminated strings?

Transaction.stringTerminated( _port.inputStream, Uint8List.fromList([0]));

Appears to work, but of course it also splits some of the data if it happens to be 0x00.

altera2015 commented 4 years ago

If a 0x00 is inside a null terminated string, that by definition means it is the end of the string. I believe this is as designed.