recordOwnNode

abstract suspend fun recordOwnNode(nodeNum: NodeId, firmwareVersion: String)(source)

Record the local node's NodeNum and firmware version.

Factory-reset detection: This is called immediately after handshake with the value from MyNodeInfo.my_node_num. The implementation must:

  1. On first call for an identity: store the tuple (nodeNum, firmwareVersion).

  2. On subsequent calls: if nodeNum differs from the stored value:

    • Atomically call clear and then persist the new tuple before returning.

    • This signals to the engine that storage was cleared; the engine rebuilds MeshState from the fresh handshake payload (no stale NodeDB rows).

  3. If nodeNum matches: no action; return normally.

Parameters

nodeNum

the device's reported NodeNum

firmwareVersion

the device's reported firmware version string

Throws