bump node_db max_count to 80

This commit is contained in:
Jm Casler 2022-03-29 20:06:32 -07:00
parent 9480f591e3
commit c1ec842454
7 changed files with 8 additions and 36 deletions

View File

@ -44,7 +44,6 @@ typedef PB_BYTES_ARRAY_T(32) ChannelSettings_psk_t;
users COULD type in a channel name and be able to talk. users COULD type in a channel name and be able to talk.
Y is a lower case letter from a-z that represents the channel 'speed' settings Y is a lower case letter from a-z that represents the channel 'speed' settings
(for some future definition of speed) (for some future definition of speed)
FIXME: Add description of multi-channel support and how primary vs secondary channels are used. FIXME: Add description of multi-channel support and how primary vs secondary channels are used.
FIXME: explain how apps use channels for security. FIXME: explain how apps use channels for security.
explain how remote settings and remote gpio are managed as an example */ explain how remote settings and remote gpio are managed as an example */

View File

@ -33,7 +33,7 @@ typedef struct _DeviceState {
User owner; User owner;
/* TODO: REPLACE */ /* TODO: REPLACE */
pb_size_t node_db_count; pb_size_t node_db_count;
NodeInfo node_db[32]; NodeInfo node_db[80];
/* Received packets saved for delivery to the phone */ /* Received packets saved for delivery to the phone */
pb_size_t receive_queue_count; pb_size_t receive_queue_count;
MeshPacket receive_queue[1]; MeshPacket receive_queue[1];
@ -59,9 +59,9 @@ extern "C" {
#endif #endif
/* Initializer values for message structs */ /* Initializer values for message structs */
#define DeviceState_init_default {false, MyNodeInfo_init_default, false, User_init_default, 0, {NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default}, 0, {MeshPacket_init_default}, false, MeshPacket_init_default, 0, 0, 0} #define DeviceState_init_default {false, MyNodeInfo_init_default, false, User_init_default, 0, {NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default}, 0, {MeshPacket_init_default}, false, MeshPacket_init_default, 0, 0, 0}
#define ChannelFile_init_default {0, {Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default}} #define ChannelFile_init_default {0, {Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default}}
#define DeviceState_init_zero {false, MyNodeInfo_init_zero, false, User_init_zero, 0, {NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero}, 0, {MeshPacket_init_zero}, false, MeshPacket_init_zero, 0, 0, 0} #define DeviceState_init_zero {false, MyNodeInfo_init_zero, false, User_init_zero, 0, {NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero}, 0, {MeshPacket_init_zero}, false, MeshPacket_init_zero, 0, 0, 0}
#define ChannelFile_init_zero {0, {Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero}} #define ChannelFile_init_zero {0, {Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero}}
/* Field tags (for use in manual encoding/decoding) */ /* Field tags (for use in manual encoding/decoding) */
@ -108,7 +108,7 @@ extern const pb_msgdesc_t ChannelFile_msg;
/* Maximum encoded size of messages (where known) */ /* Maximum encoded size of messages (where known) */
#define ChannelFile_size 832 #define ChannelFile_size 832
#define DeviceState_size 10687 #define DeviceState_size 25183
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */

View File

@ -112,7 +112,6 @@ typedef enum _Constants {
} Constants; } Constants;
/* Error codes for critical errors /* Error codes for critical errors
The device might report these fault codes on the screen. The device might report these fault codes on the screen.
If you encounter a fault code, please post on the meshtastic.discourse.group If you encounter a fault code, please post on the meshtastic.discourse.group
and we'll try to help. */ and we'll try to help. */
@ -278,7 +277,6 @@ typedef struct _Location {
} Location; } Location;
/* Debug output from the device. /* Debug output from the device.
To minimize the size of records inside the device code, if a time/source/level is not set To minimize the size of records inside the device code, if a time/source/level is not set
on the message it is assumed to be a continuation of the previously sent message. on the message it is assumed to be a continuation of the previously sent message.
This allows the device code to use fixed maxlen 64 byte strings for messages, This allows the device code to use fixed maxlen 64 byte strings for messages,
@ -397,7 +395,6 @@ typedef struct _Position {
Default: "'bout three meters-ish" :) */ Default: "'bout three meters-ish" :) */
uint32_t gps_accuracy; uint32_t gps_accuracy;
/* Ground speed in m/s and True North TRACK in 1/100 degrees /* Ground speed in m/s and True North TRACK in 1/100 degrees
Clarification of terms: Clarification of terms:
- "track" is the direction of motion (measured in horizontal plane) - "track" is the direction of motion (measured in horizontal plane)
- "heading" is where the fuselage points (measured in horizontal plane) - "heading" is where the fuselage points (measured in horizontal plane)
@ -439,24 +436,20 @@ typedef struct _ToRadio_PeerInfo {
/* Broadcast when a newly powered mesh node wants to find a node num it can use /* Broadcast when a newly powered mesh node wants to find a node num it can use
Sent from the phone over bluetooth to set the user id for the owner of this node. Sent from the phone over bluetooth to set the user id for the owner of this node.
Also sent from nodes to each other when a new node signs on (so all clients can have this info) Also sent from nodes to each other when a new node signs on (so all clients can have this info)
The algorithm is as follows: The algorithm is as follows:
when a node starts up, it broadcasts their user and the normal flow is for all when a node starts up, it broadcasts their user and the normal flow is for all
other nodes to reply with their User as well (so the new node can build its nodedb) other nodes to reply with their User as well (so the new node can build its nodedb)
If a node ever receives a User (not just the first broadcast) message where If a node ever receives a User (not just the first broadcast) message where
the sender node number equals our node number, that indicates a collision has the sender node number equals our node number, that indicates a collision has
occurred and the following steps should happen: occurred and the following steps should happen:
If the receiving node (that was already in the mesh)'s macaddr is LOWER than the If the receiving node (that was already in the mesh)'s macaddr is LOWER than the
new User who just tried to sign in: it gets to keep its nodenum. new User who just tried to sign in: it gets to keep its nodenum.
We send a broadcast message of OUR User (we use a broadcast so that the other node can We send a broadcast message of OUR User (we use a broadcast so that the other node can
receive our message, considering we have the same id - it also serves to let receive our message, considering we have the same id - it also serves to let
observers correct their nodedb) - this case is rare so it should be okay. observers correct their nodedb) - this case is rare so it should be okay.
If any node receives a User where the macaddr is GTE than their local macaddr, If any node receives a User where the macaddr is GTE than their local macaddr,
they have been vetoed and should pick a new random nodenum (filtering against they have been vetoed and should pick a new random nodenum (filtering against
whatever it knows about the nodedb) and rebroadcast their User. whatever it knows about the nodedb) and rebroadcast their User.
A few nodenums are reserved and will never be requested: A few nodenums are reserved and will never be requested:
0xff - broadcast 0xff - broadcast
0 through 3 - for future use */ 0 through 3 - for future use */
@ -539,16 +532,12 @@ typedef struct _Data {
} Data; } Data;
/* The bluetooth to device link: /* The bluetooth to device link:
Old BTLE protocol docs from TODO, merge in above and make real docs... Old BTLE protocol docs from TODO, merge in above and make real docs...
use protocol buffers, and NanoPB use protocol buffers, and NanoPB
messages from device to phone: messages from device to phone:
POSITION_UPDATE (..., time) POSITION_UPDATE (..., time)
TEXT_RECEIVED(from, text, time) TEXT_RECEIVED(from, text, time)
OPAQUE_RECEIVED(from, payload, time) (for signal messages or other applications) OPAQUE_RECEIVED(from, payload, time) (for signal messages or other applications)
messages from phone to device: messages from phone to device:
SET_MYID(id, human readable long, human readable short) (send down the unique ID SET_MYID(id, human readable long, human readable short) (send down the unique ID
string used for this node, a human readable string shown for that id, and a very string used for this node, a human readable string shown for that id, and a very
@ -557,7 +546,6 @@ typedef struct _Data {
nodes() (returns list of nodes, with full info, last time seen, loc, battery nodes() (returns list of nodes, with full info, last time seen, loc, battery
level etc) SET_CONFIG (switches device to a new set of radio params and level etc) SET_CONFIG (switches device to a new set of radio params and
preshared key, drops all existing nodes, force our node to rejoin this new group) preshared key, drops all existing nodes, force our node to rejoin this new group)
Full information about a node on the mesh */ Full information about a node on the mesh */
typedef struct _NodeInfo { typedef struct _NodeInfo {
/* The node number */ /* The node number */

View File

@ -12,19 +12,14 @@
/* Enum definitions */ /* Enum definitions */
/* For any new 'apps' that run on the device or via sister apps on phones/PCs they should pick and use a /* For any new 'apps' that run on the device or via sister apps on phones/PCs they should pick and use a
unique 'portnum' for their application. unique 'portnum' for their application.
If you are making a new app using meshtastic, please send in a pull request to add your 'portnum' to this If you are making a new app using meshtastic, please send in a pull request to add your 'portnum' to this
master table. master table.
PortNums should be assigned in the following range: PortNums should be assigned in the following range:
0-63 Core Meshtastic use, do not use for third party apps 0-63 Core Meshtastic use, do not use for third party apps
64-127 Registered 3rd party apps, send in a pull request that adds a new entry to portnums.proto to register your application 64-127 Registered 3rd party apps, send in a pull request that adds a new entry to portnums.proto to register your application
256-511 Use one of these portnums for your private applications that you don't want to register publically 256-511 Use one of these portnums for your private applications that you don't want to register publically
All other values are reserved. All other values are reserved.
Note: This was formerly a Type enum named 'typ' with the same id # Note: This was formerly a Type enum named 'typ' with the same id #
We have change to this 'portnum' based scheme for specifying app handlers for particular payloads. We have change to this 'portnum' based scheme for specifying app handlers for particular payloads.
This change is backwards compatible by treating the legacy OPAQUE/CLEAR_TEXT values identically. */ This change is backwards compatible by treating the legacy OPAQUE/CLEAR_TEXT values identically. */
typedef enum _PortNum { typedef enum _PortNum {

View File

@ -11,10 +11,8 @@
/* Enum definitions */ /* Enum definitions */
/* The frequency/regulatory region the user has selected. /* The frequency/regulatory region the user has selected.
Note: In 1.0 builds (which must still be supported by the android app for a Note: In 1.0 builds (which must still be supported by the android app for a
long time) this field will be unpopulated. long time) this field will be unpopulated.
If firmware is ever upgraded from an old 1.0ish build, the old If firmware is ever upgraded from an old 1.0ish build, the old
MyNodeInfo.region string will be used to set UserPreferences.region and the MyNodeInfo.region string will be used to set UserPreferences.region and the
old value will be no longer set. */ old value will be no longer set. */
@ -50,7 +48,6 @@ typedef enum _RegionCode {
/* Defines the device's role on the Mesh network /* Defines the device's role on the Mesh network
unset unset
Behave normally. Behave normally.
Router Router
Functions as a router */ Functions as a router */
typedef enum _Role { typedef enum _Role {
@ -125,7 +122,6 @@ typedef enum _GpsCoordinateFormat {
/* Bit field of boolean configuration options, indicating which optional /* Bit field of boolean configuration options, indicating which optional
fields to include when assembling POSITION messages fields to include when assembling POSITION messages
Longitude and latitude are always included (also time if GPS-synced) Longitude and latitude are always included (also time if GPS-synced)
NOTE: the more fields are included, the larger the message will be - NOTE: the more fields are included, the larger the message will be -
leading to longer airtime and a higher risk of packet loss */ leading to longer airtime and a higher risk of packet loss */
typedef enum _PositionFlags { typedef enum _PositionFlags {
@ -172,10 +168,8 @@ typedef enum _InputEventChar {
} InputEventChar; } InputEventChar;
/* The frequency/regulatory region the user has selected. /* The frequency/regulatory region the user has selected.
Note: In 1.0 builds (which must still be supported by the android app for a Note: In 1.0 builds (which must still be supported by the android app for a
long time) this field will be unpopulated. long time) this field will be unpopulated.
If firmware is ever upgraded from an old 1.0ish build, the old If firmware is ever upgraded from an old 1.0ish build, the old
MyNodeInfo.region string will be used to set UserPreferences.region and the MyNodeInfo.region string will be used to set UserPreferences.region and the
old value will be no longer set. */ old value will be no longer set. */
@ -209,7 +203,6 @@ typedef enum _RadioConfig_UserPreferences_Serial_Baud {
/* Defines the device's role on the Mesh network /* Defines the device's role on the Mesh network
unset unset
Behave normally. Behave normally.
Router Router
Functions as a router */ Functions as a router */
typedef enum _RadioConfig_UserPreferences_Serial_Mode { typedef enum _RadioConfig_UserPreferences_Serial_Mode {

View File

@ -22,12 +22,9 @@ typedef enum _HardwareMessage_Type {
/* Struct definitions */ /* Struct definitions */
/* An example app to show off the module system. This message is used for /* An example app to show off the module system. This message is used for
REMOTE_HARDWARE_APP PortNums. REMOTE_HARDWARE_APP PortNums.
Also provides easy remote access to any GPIO. Also provides easy remote access to any GPIO.
In the future other remote hardware operations can be added based on user interest In the future other remote hardware operations can be added based on user interest
(i.e. serial output, spi/i2c input/output). (i.e. serial output, spi/i2c input/output).
FIXME - currently this feature is turned on by default which is dangerous FIXME - currently this feature is turned on by default which is dangerous
because no security yet (beyond the channel mechanism). because no security yet (beyond the channel mechanism).
It should be off by default and then protected based on some TBD mechanism It should be off by default and then protected based on some TBD mechanism

View File

@ -40,10 +40,10 @@ typedef struct _EnvironmentMetrics {
/* Types of Measurements the telemetry module is equipped to handle */ /* Types of Measurements the telemetry module is equipped to handle */
typedef struct _Telemetry { typedef struct _Telemetry {
/* This is usually not sent over the mesh (to save space), but it is sent /* This is usually not sent over the mesh (to save space), but it is sent
from the phone so that the local device can set its RTC If it is sent over from the phone so that the local device can set its RTC If it is sent over
the mesh (because there are devices on the mesh without GPS), it will only the mesh (because there are devices on the mesh without GPS), it will only
be sent by devices which has a hardware GPS clock (IE Mobile Phone). be sent by devices which has a hardware GPS clock (IE Mobile Phone).
seconds since 1970 */ seconds since 1970 */
uint32_t time; uint32_t time;
/* Key native device metrics such as battery level */ /* Key native device metrics such as battery level */