Skip to content

Control pty does not allow all commands #1

@ryeng

Description

@ryeng

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:

  1. 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.
  2. Use an escape character to indicate invalid bytes in pty input. Output remains as is.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions