Skip to content

aimdb-tcp-connector — TCP transport (tokio + embassy-net) #121

@lxsaah

Description

@lxsaah

Follow-up to #39 / doc 041. Its own PR, built on the merged Phase 6 foundation (generic SessionClientConnector/SessionServerConnector, no_std AimxCodec, the aimdb-uds-connector template).

First real new transport (UDS was only relocated) — proves the "transport = thin crate" model holds.

Scope

  • New crate aimdb-tcp-connector, modeled on aimdb-uds-connector + the dual-module pattern of aimdb-mqtt-connector (tokio-runtime / embassy-runtime features).
  • Transport triple: TcpConnection (newline- or length-prefix framing), TcpDialer, TcpListener.
  • Sugar: TcpClient (= SessionClientConnector<TcpDialer, AimxCodec>), TcpServer (= SessionServerConnector<...> + AimxDispatch).
  • tokio half (tokio::net::TcpStream/TcpListener) — std.
  • Embassy half (embassy-net) — client + cross-compile only; the Embassy server half waits on no_std AimX server (dispatch) port — cross-cutting AnyRecord + RecordMetadataTracker de-std #120 (needs no_std AimxDispatch).
  • URL form tcp://host:port (parse via existing ConnectorUrl or a small parser).

Verification

  • AimDb <-> AimDb over TCP loopback round-trip test (mirror aimdb-websocket-connector's ws_roundtrip/e2e).
  • make test-embedded: cargo check -p aimdb-tcp-connector --target thumbv7em-none-eabihf --features embassy-runtime.
  • Wire into Makefile build/test/clippy/test-embedded.

Notes

  • embassy-net is already a workspace dependency.
  • Framing lives in TcpConnection; AimxCodec is reused unchanged.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions