RadioSessionProjection

class RadioSessionProjection(nodeManager: NodeManager, nodeRepository: NodeRepository, serviceStateWriter: ServiceStateWriter, meshLogRepository: Lazy<MeshLogRepository>, dataHandler: Lazy<MeshDataHandler>, configFlowManager: Lazy<MeshConfigFlowManagerImpl>, eventHandler: Lazy<RadioSessionEventHandler>, displayMirrorManager: Lazy<DisplayMirrorManager>, radioInterfaceService: RadioInterfaceService, scope: ServiceScope)(source)

Writes one app radio session's typed SDK session events into Room, the repositories and the app's packet consumers. The SDK owns protocol state, NodeDB, config and channels; this keeps what the app adds on top: durable history, link metrics the SDK does not track, notifications and the MeshLog audit rows.

Constructors

Link copied to clipboard
constructor(nodeManager: NodeManager, nodeRepository: NodeRepository, serviceStateWriter: ServiceStateWriter, meshLogRepository: Lazy<MeshLogRepository>, dataHandler: Lazy<MeshDataHandler>, configFlowManager: Lazy<MeshConfigFlowManagerImpl>, eventHandler: Lazy<RadioSessionEventHandler>, displayMirrorManager: Lazy<DisplayMirrorManager>, radioInterfaceService: RadioInterfaceService, scope: ServiceScope)

Functions

Link copied to clipboard
suspend fun installReady(event: RadioSessionEvent.Ready, session: RadioSessionContext): Boolean

Installs the handshake snapshot; the caller publishes app readiness only when this returns true. Returns false when the session closed first or the snapshot carries no my_info.

Link copied to clipboard
fun onDeviceLog(record: LogRecord, session: RadioSessionContext)
Link copied to clipboard
fun onDisplayImage(image: DisplayImage, session: RadioSessionContext)
Link copied to clipboard
fun onDisplayPalette(palette: DisplayPalette, session: RadioSessionContext)
Link copied to clipboard
fun onOutboundPacket(packet: MeshPacket, session: RadioSessionContext)

Logs a packet the SDK queued for the radio as an outgoing row under the local node, with the ID and fields the SDK wrote: the debug panel, the local position log and the request logs with their reply matching read these rows.

Link copied to clipboard
suspend fun project(event: RadioSessionEvent, session: RadioSessionContext)

Projects one post-Ready event of the SDK session that session carries. A handler failure drops that event only: one malformed payload from any node on the mesh must not end the session.

Link copied to clipboard
fun refreshLocalNodeLastHeard(session: RadioSessionContext, localNodeNum: Int? = nodeManager.myNodeNum.value)

Proves the link is alive on a quiet mesh, where only the SDK heartbeat's queue status crosses it. Throttled so frequent events do not rewrite the local node row on every frame.