From 0b0ef971b7af9c127f00154a61289656672a6017 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 7 Dec 2025 06:11:29 -0600 Subject: [PATCH] Node detail WIP --- meshtastic/deviceonly.options | 13 +++++++- meshtastic/deviceonly.proto | 59 ++++++++++++++++++++++++++++++++++- 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/meshtastic/deviceonly.options b/meshtastic/deviceonly.options index d6aae0c..16039d3 100644 --- a/meshtastic/deviceonly.options +++ b/meshtastic/deviceonly.options @@ -15,4 +15,15 @@ *UserLite.long_name max_size:40 *UserLite.short_name max_size:5 *UserLite.public_key max_size:32 # public key -*UserLite.macaddr max_size:6 fixed_length:true \ No newline at end of file +*UserLite.macaddr max_size:6 fixed_length:true +*NodeDetail.macaddr max_size:6 fixed_length:true +*NodeDetail.long_name max_size:40 +*NodeDetail.short_name max_size:5 +*NodeDetail.public_key max_size:32 +*NodeDetail.channel int_size:8 +*NodeDetail.hops_away int_size:8 +*NodeDetail.next_hop int_size:8 +*NodeDetail.battery_level int_size:8 +*NodeDetail.channel_utilization_permille int_size:16 +*NodeDetail.air_util_tx_permille int_size:16 +*NodeDetail.voltage_millivolts int_size:16 \ No newline at end of file diff --git a/meshtastic/deviceonly.proto b/meshtastic/deviceonly.proto index e8c7703..f395be7 100644 --- a/meshtastic/deviceonly.proto +++ b/meshtastic/deviceonly.proto @@ -171,6 +171,63 @@ message NodeInfoLite { uint32 bitfield = 13; } +/* + * Flattened node representation used for the compact NodeDB rewrite. + * Uses integer scaling where possible and a single flags bitfield for booleans. + */ +message NodeDetail { + /* The node number */ + uint32 num = 1; + + /* 48-bit hardware identifier copied from the radio */ + bytes macaddr = 2; + + /* Cached long display name */ + string long_name = 3; + + /* Cached short display name */ + string short_name = 4; + + /* Hardware model reported by the node */ + HardwareModel hw_model = 5; + + /* Role assigned to the node */ + Config.DeviceConfig.Role role = 6; + + /* Public key broadcast by the node */ + bytes public_key = 7; + + /* Position data flattened from PositionLite */ + sfixed32 latitude_i = 8; + sfixed32 longitude_i = 9; + int32 altitude = 10; + fixed32 position_time = 11; + Position.LocSource position_source = 12; + + /* Radio performance metrics */ + float snr = 13; + + /* Last packet timestamp */ + fixed32 last_heard = 14; + + /* Mesh routing metadata */ + uint32 channel = 15; + uint32 hops_away = 16; + uint32 next_hop = 17; + + /* Device metrics cached using integer scaling */ + uint32 battery_level = 18; + uint32 uptime_seconds = 19; + uint32 channel_utilization_permille = 20; + uint32 air_util_tx_permille = 21; + uint32 voltage_millivolts = 22; + + /* Bitset storing boolean flags and presence markers. + * See NodeDetailFlag shifts for decoded meaning. + */ + uint32 flags = 23; +} + /* * This message is never sent over the wire, but it is used for serializing DB * state to flash in the device code @@ -245,7 +302,7 @@ message NodeDatabase { /* * New lite version of NodeDB to decrease memory footprint */ - repeated NodeInfoLite nodes = 2 [(nanopb).callback_datatype = "std::vector"]; + repeated NodeDetail nodes = 2 [(nanopb).callback_datatype = "std::vector"]; } /*