From 27d456b5fa88e97c06089faff143d20b2cfb2456 Mon Sep 17 00:00:00 2001 From: "Jason B. Cox" Date: Thu, 27 Mar 2025 22:09:48 -0700 Subject: [PATCH] Compress NodeInfoLite bools into a bitfield --- meshtastic/deviceonly.options | 1 + meshtastic/deviceonly.proto | 23 ++++++++--------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/meshtastic/deviceonly.options b/meshtastic/deviceonly.options index d6aae0c4..d3c3546a 100644 --- a/meshtastic/deviceonly.options +++ b/meshtastic/deviceonly.options @@ -9,6 +9,7 @@ *DeviceState.node_remote_hardware_pins max_count:12 *NodeInfoLite.channel int_size:8 +*NodeInfoLite.bitfield int_size:8 *NodeInfoLite.hops_away int_size:8 *NodeInfoLite.next_hop int_size:8 diff --git a/meshtastic/deviceonly.proto b/meshtastic/deviceonly.proto index ea6ef256..698620e9 100644 --- a/meshtastic/deviceonly.proto +++ b/meshtastic/deviceonly.proto @@ -134,31 +134,24 @@ message NodeInfoLite { uint32 channel = 7; /* - * True if we witnessed the node over MQTT instead of LoRA transport + * Bitfield to contain 8 1-bit boolean values. + * 0 - via_mqtt: True if we witnessed the node over MQTT instead of LoRA transport + * 1 - is_favorite: True if node is in our favorites list + * Persists between NodeDB internal clean ups + * 2 - is_ignored: True if node is in our ignored list + * Persists between NodeDB internal clean ups */ - bool via_mqtt = 8; + uint32 bitfield = 8; /* * Number of hops away from us this node is (0 if direct neighbor) */ optional uint32 hops_away = 9; - /* - * True if node is in our favorites list - * Persists between NodeDB internal clean ups - */ - bool is_favorite = 10; - - /* - * True if node is in our ignored list - * Persists between NodeDB internal clean ups - */ - bool is_ignored = 11; - /* * Last byte of the node number of the node that should be used as the next hop to reach this node. */ - uint32 next_hop = 12; + uint32 next_hop = 10; } /*