Skip to content

[09] Port the TCP105 board wire protocol #12

Description

@jvwaldrich0

Task 09 of 16 — these are sequential, do them in order.

Previous: #11 · Next: #13

Port target: cloudpark-toolkit (Go) → this repo (Rust). Reference paths below are relative to that repo.

Goal

Port the TCP105 totem-board wire protocol (framing + opcodes + IO word). Task 12 builds the server on top.

Scope

  • STX = 0x7F framing, encode/decode with length + checksum exactly as the Go package.
  • Opcodes: ResetBoard 0x01, VersionInfo 0x02, UpdateConfig 0x03, CPUUniqueCode 0x09, RFIDReader 0x11, SerialTransfer 0x19, GetIOStatus 0x42, UploadIOStatus 0x43, RelayControl 0x46, VoiceBroadcast 0x51.
  • Serial ids: Serial1 = 0x01, Serial2 = 0x02 (printer path).
  • 32-bit IO-status word with the exact bit positions: Input1 = 22, Input2 = 21, Input3 = 19 (loop detector), Input4 = 18 (pick-card button), Input5 = 17 (help button).
  • Helpers to parse relay-control and config payloads.

Reference

cloudpark-toolkit/internal/tcp105proto/protocol.go (192 lines) + protocol_test.go

Done when

  • Encode/decode round-trip tests for every opcode.
  • IO-word bit set/clear tests assert the exact bit indices above.
  • A frame with a bad STX or checksum errors instead of panicking.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions