Open doegox opened 7 years ago
This approach is bound to fail in case someone willing to send the EOT
itself. I would suggest separating human-readable and machine-readable output, for example, by providing separate commands where there are such issues (VERSION
is a good example). This is not as bad in case of DUMP_MFU
as the output has some expected format, which can be easily parsed by both humans and machines.
I would just replace the string "EOT" by 0x04 from the ASCII table ("End Of Transmission"), since all output from the chameleon is ASCII. A human readable terminal application would probably not display the EOT character.
I added a pull request with a first draft of multiline response handling (see #105). I would suggest to use the pull request to discuss and solve the problem, but I also will leave this issue open until this thing is solved.
Issue #16 (VERSION returning several lines) was solved by simply writing all the info in a single line. But
dump_mfu
returns also several lines and probably more commands will do in the future. So what about adding a new response type for multiline result? E.g.that would e.g. terminate on a last line containing only
EOT
(end of transmission)Example: