Skip to content

Conversation

@yfyf
Copy link
Contributor

@yfyf yfyf commented Jul 18, 2025

Sharing this to discuss the design, not with an intention of this getting merged.

The protocol is described at https://github.com/dividat/sensitronics-firmware/pull/3

Play implementation PR - https://github.com/dividat/diviapps/pull/2478

Some important decisions taken:

  • The Sensitronics device is identified using it's USB Product name. To be able to do that, I had to patch the serial enumeration package. It's unclear why it's not done by default, people have inquired it about it too. An alternative to this could be to have a serial command to which the controller responds with device name and version. But this would already require the driver to guess the comms protocol, so not very nice.
  • To provide a way for Play to distinguish between Sensing Tex and Sensitronics devices, a protocol version header DRIVER_PROTOCOL_VERSION is prepended to the WebSocket messages (note that we do not need encapsulation, since the WebSocket protocol ensures proper framing).
  • Since there's no "handshake" protocol, as before the Driver automatically sends the S (start) command on connection to the device.

Handshake protocol ideas I considered, but did not implement (at least for now):

  • Sending Driver messages over the WebSocket (maybe even as JSON and using message type text, rather than binary? makes it easy to distinguish in Play), such as "new device connected" with metadata about the device. This message could be sent to each new client connected to the WebSocket as a "handshake".
  • Similarly to the above, adding a Driver command that would cause the driver to respond with the currently connected device (if any). This would be an alternative where the client initiates the handshake.

Minor things:

  • nixpkgs bumped to bump go version to be able to use slices.Concat 😛
  • Added --protocol-version to replay-flex to be able to replay old recordings

@yfyf yfyf requested a review from knuton July 18, 2025 06:58
@yfyf yfyf added the reviewable Ready for initial or iterative review. label Jul 18, 2025
@socket-security
Copy link

socket-security bot commented Jul 18, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgolang/​github.com/​yfyf/​go-serial@​v1.6.4-withproduct100100100100100

View full report

@knuton knuton removed the reviewable Ready for initial or iterative review. label Jan 16, 2026
@knuton
Copy link
Member

knuton commented Jan 16, 2026

Superseded by #162

@knuton knuton closed this Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants