-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
The protocol requires every first and last byte of a command to be marked as invalid in the data frames sent to the device, effectively making the control channel a 9 bit channel consisting of a 1 bit valid/invalid flag and 8 data bits. The current implementation tries to be smart when reading from the pty and guess which byte is the last of a command, but fails when the same byte that ends a command occurs as one of the parameters inside the command sequence.
This only affects commands from the computer to the device. The device seems to always respond with valid bytes.
Possible solutions:
- Make the control pty read two bytes for each control channel byte, using the low bit of the high byte to indicate validity. Output to the pty could be either the same two-bytes-per-byte encoding or as it currently is.
- Use an escape character to indicate invalid bytes in pty input. Output remains as is.
- Read hex digits as ASCII from the pty, ending a command with newline. Output to the pty could be either hex digits as ASCII or as is. Note that it might not be possible to know when a reply from the device ends without knowing the protocol, making a similar reply per line output hard. A timeout may be used as there is a timing guarantee on replies.