NodeRepositoryImpl

class NodeRepositoryImpl(processLifecycle: ERROR CLASS: Symbol not found for Lifecycle, nodeInfoReadDataSource: NodeInfoReadDataSource, nodeInfoWriteDataSource: NodeInfoWriteDataSource, dispatchers: ERROR CLASS: Symbol not found for CoroutineDispatchers, localStatsDataSource: ERROR CLASS: Symbol not found for LocalStatsDataSource) : <ERROR CLASS> ERROR CLASS: Symbol not found for NodeRepository(source)

Repository for managing node-related data, including hardware info, node database, and identity.

Constructors

Link copied to clipboard
constructor(processLifecycle: ERROR CLASS: Symbol not found for Lifecycle, nodeInfoReadDataSource: NodeInfoReadDataSource, nodeInfoWriteDataSource: NodeInfoWriteDataSource, dispatchers: ERROR CLASS: Symbol not found for CoroutineDispatchers, localStatsDataSource: ERROR CLASS: Symbol not found for LocalStatsDataSource)

Properties

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

The latest local stats telemetry received from the locally connected node.

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

The unique userId (hex string) of our local node.

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

Hardware info about our local device (can be null if not connected).

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

A reactive map from nodeNum to Node objects, representing the entire mesh.

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

Flow emitting the count of nodes currently considered "online".

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

Information about the locally connected node, as seen from the mesh.

Link copied to clipboard
open override 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
open suspend override fun clearMyNodeInfo(): ERROR CLASS: Unresolved name: withContext

Clears the local node's connection info.

Link copied to clipboard
open suspend override fun clearNodeDB(preserveFavorites: Boolean): ERROR CLASS: Unresolved name: withContext

Deletes all nodes from the database, optionally preserving favorites.

Link copied to clipboard
open suspend override fun deleteNode(num: Int): ERROR CLASS: Unresolved name: withContext

Deletes a node and its metadata by num.

Link copied to clipboard
open suspend override fun deleteNodes(nodeNums: List<Int>): ERROR CLASS: Unresolved name: withContext

Deletes multiple nodes and their metadata.

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

Returns the node number used for log queries. Maps nodeNum to MeshLog.NODE_NUM_LOCAL (0) if it is the locally connected node.

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

Returns the Node associated with a given userId. Falls back to a generic node if not found.

Link copied to clipboard
fun getNodeEntityDBbyNumFlow(): ERROR CLASS: Unresolved name: map
Link copied to clipboard
open override fun getNodes(sort: ERROR CLASS: Symbol not found for NodeSortOption, filter: String, includeUnknown: Boolean, onlyOnline: Boolean, onlyDirect: Boolean): ERROR CLASS: Symbol not found for Flow<kotlin/collections/List<ERROR CLASS: Symbol not found for Node>>

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

Link copied to clipboard
open suspend override fun getNodesOlderThan(lastHeard: Int): List<ERROR CLASS: Symbol not found for Node>
Link copied to clipboard
open suspend override fun getUnknownNodes(): List<ERROR CLASS: Symbol not found for Node>
Link copied to clipboard
open override fun getUser(nodeNum: Int): ERROR CLASS: Symbol not found for User

Returns the User info for a given nodeNum.

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

Returns the User info for a given userId. Falls back to a generic user if not found.

Link copied to clipboard
open suspend override fun insertMetadata(nodeNum: Int, metadata: ERROR CLASS: Symbol not found for DeviceMetadata): ERROR CLASS: Unresolved name: withContext

Persists hardware metadata for a node.

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

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

Link copied to clipboard
open suspend override fun setNodeNotes(num: Int, notes: String): ERROR CLASS: Unresolved name: withContext
Link copied to clipboard
open override fun updateLocalStats(stats: ERROR CLASS: Symbol not found for LocalStats)

Update the cached local stats telemetry.

Link copied to clipboard
open suspend override fun upsert(node: ERROR CLASS: Symbol not found for Node): ERROR CLASS: Unresolved name: withContext

Upserts a Node to the database.