NodeRepository

Repository interface for managing node-related data.

This component provides access to the mesh's node database, local device information, and mesh-wide statistics. It supports reactive queries for node lists, counts, and filtered/sorted views.

This interface is shared across platforms via Kotlin Multiplatform (KMP).

Properties

Link copied to clipboard
abstract val localStats: ERROR CLASS: Symbol not found for StateFlow<ERROR CLASS: Symbol not found for LocalStats>

Reactive flow of the latest local stats telemetry received from the radio.

Link copied to clipboard
abstract val myId: ERROR CLASS: Symbol not found for StateFlow<kotlin/String?>

The unique userId (hex string, e.g., "!1234abcd") of our local node.

Link copied to clipboard
abstract val myNodeInfo: ERROR CLASS: Symbol not found for StateFlow<ERROR CLASS: Symbol not found for MyNodeInfo?>

Reactive flow of hardware info about our local radio device.

Link copied to clipboard
abstract val nodeDBbyNum: ERROR CLASS: Symbol not found for StateFlow<kotlin/collections/Map<kotlin/Int, ERROR CLASS: Symbol not found for Node>>

A reactive map of all known nodes in the mesh, keyed by their 32-bit node number.

Link copied to clipboard
abstract val onlineNodeCount: ERROR CLASS: Symbol not found for Flow<kotlin/Int>

Flow emitting the count of nodes currently considered "online" (heard from recently).

Link copied to clipboard
abstract val ourNodeInfo: ERROR CLASS: Symbol not found for StateFlow<ERROR CLASS: Symbol not found for Node?>

Reactive flow of information about the locally connected node as seen by the mesh.

Link copied to clipboard
abstract val totalNodeCount: ERROR CLASS: Symbol not found for Flow<kotlin/Int>

Flow emitting the total number of nodes in the database.

Functions

Link copied to clipboard
abstract suspend fun clearMyNodeInfo()

Clears the local node's connection info from the cache.

Link copied to clipboard
abstract suspend fun clearNodeDB(preserveFavorites: Boolean = false)

Deletes all nodes from the database.

Link copied to clipboard
abstract suspend fun deleteNode(num: Int)

Deletes a specific node by its node number.

Link copied to clipboard
abstract suspend fun deleteNodes(nodeNums: List<Int>)

Deletes multiple nodes by their node numbers.

Link copied to clipboard
abstract fun effectiveLogNodeId(nodeNum: Int): ERROR CLASS: Symbol not found for Flow<kotlin/Int>

Returns the node number used for log queries.

Link copied to clipboard
abstract fun getNode(userId: String): ERROR CLASS: Symbol not found for Node

Returns the Node associated with a given userId.

Link copied to clipboard
abstract fun getNodes(sort: ERROR CLASS: Symbol not found for NodeSortOption = NodeSortOption.LAST_HEARD, filter: String = "", includeUnknown: Boolean = true, onlyOnline: Boolean = false, onlyDirect: Boolean = false): ERROR CLASS: Symbol not found for Flow<kotlin/collections/List<ERROR CLASS: Symbol not found for Node>>

Returns a reactive flow of nodes filtered and sorted according to the parameters.

Link copied to clipboard
abstract suspend fun getNodesOlderThan(lastHeard: Int): List<ERROR CLASS: Symbol not found for Node>

Returns all nodes that haven't been heard from since the given timestamp.

Link copied to clipboard
abstract suspend fun getUnknownNodes(): List<ERROR CLASS: Symbol not found for Node>

Returns all nodes with unknown hardware models.

Link copied to clipboard
abstract fun getUser(nodeNum: Int): ERROR CLASS: Symbol not found for User

Returns the User info for a given nodeNum.

abstract fun getUser(userId: String): ERROR CLASS: Symbol not found for User

Returns the User info for a given userId.

Link copied to clipboard
abstract suspend fun insertMetadata(nodeNum: Int, metadata: ERROR CLASS: Symbol not found for DeviceMetadata)

Persists hardware metadata for a node.

Link copied to clipboard
abstract suspend fun installConfig(mi: ERROR CLASS: Symbol not found for MyNodeInfo, nodes: List<ERROR CLASS: Symbol not found for Node>)

Installs initial configuration data (local info and remote nodes) into the database.

Link copied to clipboard
abstract suspend fun setNodeNotes(num: Int, notes: String)

Updates the personal notes for a node.

Link copied to clipboard
abstract fun updateLocalStats(stats: ERROR CLASS: Symbol not found for LocalStats)

Updates the cached local stats telemetry.

Link copied to clipboard
abstract suspend fun upsert(node: ERROR CLASS: Symbol not found for Node)

Upserts a Node into the persistent database.