MockRadioTransport

class MockRadioTransport(callback: RadioTransportCallback, scope: CoroutineScope, val address: String) : RadioTransport(source)

A simulated radio, selected as "Demo Mode" in the Connections screen.

It answers the app's real two-stage want_config handshake and then feeds a small synthetic mesh — a populated node list with positions, signal readings and battery levels, one channel conversation, one direct-message thread, and telemetry that keeps accruing while the app is open. That makes the app fully explorable without any LoRa hardware, which is what an app-store reviewer and a first-time user both need.

Three properties of the real protocol have to be honoured or the app never leaves "Loading node list":

  1. The handshake is two-stage (HandshakeConstants.CONFIG_NONCE then HandshakeConstants.NODE_INFO_NONCE). Each stage must answer with only its own frames and its own config_complete_id. Re-sending my_info on stage 2 resets the app's handshake state machine and the stage-2 completion is then rejected.

  2. node_info frames are only accepted inside the handshake window, so every simulated node has to ship in stage 2.

  3. Radio metrics (SNR/RSSI/hops) are only taken from packets that look like direct LoRa receptions — transport_mechanism = TRANSPORT_LORA and hop_start == hop_limit. Frames left at the proto defaults are treated as internal traffic and contribute no signal information at all.

Constructors

Link copied to clipboard
constructor(callback: RadioTransportCallback, scope: CoroutineScope, address: String)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open suspend override fun close()
Link copied to clipboard
open override fun handleSendToRadio(p: ByteArray): Boolean
Link copied to clipboard
open fun keepAlive()
Link copied to clipboard
open override fun start()