Skip to content

[12] TCP105 totem board emulator and screen #15

Description

@jvwaldrich0

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

Previous: #14 · Next: #16

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

Goal

The TCP105 totem-board emulator (server) and its TUI screen.

Scope

Server (src/tcp105.rs), on :8008 by default (--listen to bind a specific loopback so a real cloudpark-hw can share the machine):

  • The HW dials a fresh connection per command — answer exactly one command per accepted connection.
  • Handle: reset, version info, CPU unique code, config update, relay control (track relay state), voice broadcast (task 11), get IO status, RFID.
  • SerialTransfer reassembly: buffer the stream (cap at 4 MiB against a bogus length prefix) and hand Serial2 payloads to the ticket renderer (task 10).
  • Digital input toggles: the TUI flips inputs 1–5, the server pushes UploadIOStatus to the HW upload address — auto-learned from the incoming connection unless --hw-addr is set.

Screen:

  • Menu: Get info / Inputs & relays.
  • Get info: listen address, HW upload address, tickets saved, last command.
  • Inputs & relays: cursor over inputs 1–5 (loop detector, pick-card, help), space toggles; relay state shown live.

Reference

cloudpark-toolkit/internal/tcp105/server.go (406) + server_test.go (253), internal/tui/tcp105.go

Done when

  • Test: a fake HW client gets a correct reply for each opcode.
  • Toggling an input in the TUI produces an UploadIOStatus frame with the right bit set.
  • A ticket pushed over Serial2 lands in the ticket dir as a PDF.

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