Compress NodeInfoLite bools into a bitfield

pull/668/head
Jason B. Cox 2025-03-27 22:09:48 -07:00
rodzic b4044f8f9f
commit 27d456b5fa
2 zmienionych plików z 9 dodań i 15 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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;
}
/*