TcpTransport
class TcpTransport(dispatchers: CoroutineDispatchers, scope: CoroutineScope, listener: TcpTransport.Listener, logTag: String = "TcpTransport")(source)
Shared TCP transport for Meshtastic radios.
Manages the TCP socket lifecycle (connect, read loop, reconnect with backoff) and uses StreamFrameCodec for the START1/START2 stream framing protocol. sendHeartbeat sends a heartbeat with a monotonically-increasing nonce so the firmware's per-connection duplicate-write filter does not silently drop it.
Uses Ktor raw sockets (ktor-network) so the implementation is KMP-common — shared by Android, Desktop, and (once wired) iOS via the shared SharedRadioInterfaceService.
Constructors
Link copied to clipboard
constructor(dispatchers: CoroutineDispatchers, scope: CoroutineScope, listener: TcpTransport.Listener, logTag: String = "TcpTransport")
Types
Functions
Link copied to clipboard
Send a heartbeat packet with a monotonically-increasing nonce to keep the connection alive. Starts at HeartbeatSender.FIRST_NONCE, past the firmware's NodeInfo-ping trigger.
Link copied to clipboard
Send a raw framed Meshtastic packet.