Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By peridot
#35750 Would be preferable to have optional timeout value in ms for input command to stop it getting stuck in endless loop in the case of no serial data. Also ability to clear serial input buffer would be nice.

Cheers Mike
User avatar
By Mmiscool
#35930 Added 2 new commands to handle the situations you outlined.
The new build has been uploaded and is available.

SERIALFLUSH:
Will clear the serial input buffer. Discards all characters stored in the buffer.
serialflush



SERIALTIMEOUT:
Will cause the input command to return what ever is in the serial buffer even if there is no CR LF. Specifying a value of 0 will disable the serial time out. Any non-zero value will be the number of milliseconds it will wait before timing out on an input command.
serialtimeout {value or var}