kopia lustrzana https://github.com/meshtastic/firmware
commit
e21fdb5d82
|
@ -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.
|
||||
Y is a lower case letter from a-z that represents the channel 'speed' settings
|
||||
(for some future definition of speed)
|
||||
|
||||
FIXME: Add description of multi-channel support and how primary vs secondary channels are used.
|
||||
FIXME: explain how apps use channels for security.
|
||||
explain how remote settings and remote gpio are managed as an example */
|
||||
|
|
|
@ -33,7 +33,7 @@ typedef struct _DeviceState {
|
|||
User owner;
|
||||
/* TODO: REPLACE */
|
||||
pb_size_t node_db_count;
|
||||
NodeInfo node_db[32];
|
||||
NodeInfo node_db[80];
|
||||
/* Received packets saved for delivery to the phone */
|
||||
pb_size_t receive_queue_count;
|
||||
MeshPacket receive_queue[1];
|
||||
|
@ -59,9 +59,9 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/* 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 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}}
|
||||
|
||||
/* 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) */
|
||||
#define ChannelFile_size 832
|
||||
#define DeviceState_size 10687
|
||||
#define DeviceState_size 25183
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
|
|
@ -112,7 +112,6 @@ typedef enum _Constants {
|
|||
} Constants;
|
||||
|
||||
/* Error codes for critical errors
|
||||
|
||||
The device might report these fault codes on the screen.
|
||||
If you encounter a fault code, please post on the meshtastic.discourse.group
|
||||
and we'll try to help. */
|
||||
|
@ -278,7 +277,6 @@ typedef struct _Location {
|
|||
} Location;
|
||||
|
||||
/* Debug output from the device.
|
||||
|
||||
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.
|
||||
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" :) */
|
||||
uint32_t gps_accuracy;
|
||||
/* Ground speed in m/s and True North TRACK in 1/100 degrees
|
||||
|
||||
Clarification of terms:
|
||||
- "track" is the direction of motion (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
|
||||
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)
|
||||
|
||||
The algorithm is as follows:
|
||||
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)
|
||||
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
|
||||
occurred and the following steps should happen:
|
||||
|
||||
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.
|
||||
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
|
||||
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,
|
||||
they have been vetoed and should pick a new random nodenum (filtering against
|
||||
whatever it knows about the nodedb) and rebroadcast their User.
|
||||
|
||||
A few nodenums are reserved and will never be requested:
|
||||
0xff - broadcast
|
||||
0 through 3 - for future use */
|
||||
|
@ -539,16 +532,12 @@ typedef struct _Data {
|
|||
} Data;
|
||||
|
||||
/* The bluetooth to device link:
|
||||
|
||||
Old BTLE protocol docs from TODO, merge in above and make real docs...
|
||||
|
||||
use protocol buffers, and NanoPB
|
||||
|
||||
messages from device to phone:
|
||||
POSITION_UPDATE (..., time)
|
||||
TEXT_RECEIVED(from, text, time)
|
||||
OPAQUE_RECEIVED(from, payload, time) (for signal messages or other applications)
|
||||
|
||||
messages from phone to device:
|
||||
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
|
||||
|
@ -557,7 +546,6 @@ typedef struct _Data {
|
|||
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
|
||||
preshared key, drops all existing nodes, force our node to rejoin this new group)
|
||||
|
||||
Full information about a node on the mesh */
|
||||
typedef struct _NodeInfo {
|
||||
/* The node number */
|
||||
|
|
|
@ -12,19 +12,14 @@
|
|||
/* Enum definitions */
|
||||
/* 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.
|
||||
|
||||
If you are making a new app using meshtastic, please send in a pull request to add your 'portnum' to this
|
||||
master table.
|
||||
PortNums should be assigned in the following range:
|
||||
|
||||
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
|
||||
256-511 Use one of these portnums for your private applications that you don't want to register publically
|
||||
|
||||
All other values are reserved.
|
||||
|
||||
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.
|
||||
This change is backwards compatible by treating the legacy OPAQUE/CLEAR_TEXT values identically. */
|
||||
typedef enum _PortNum {
|
||||
|
|
|
@ -11,10 +11,8 @@
|
|||
|
||||
/* Enum definitions */
|
||||
/* The frequency/regulatory region the user has selected.
|
||||
|
||||
Note: In 1.0 builds (which must still be supported by the android app for a
|
||||
long time) this field will be unpopulated.
|
||||
|
||||
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
|
||||
old value will be no longer set. */
|
||||
|
@ -50,7 +48,6 @@ typedef enum _RegionCode {
|
|||
/* Defines the device's role on the Mesh network
|
||||
unset
|
||||
Behave normally.
|
||||
|
||||
Router
|
||||
Functions as a router */
|
||||
typedef enum _Role {
|
||||
|
@ -125,7 +122,6 @@ typedef enum _GpsCoordinateFormat {
|
|||
/* Bit field of boolean configuration options, indicating which optional
|
||||
fields to include when assembling POSITION messages
|
||||
Longitude and latitude are always included (also time if GPS-synced)
|
||||
|
||||
NOTE: the more fields are included, the larger the message will be -
|
||||
leading to longer airtime and a higher risk of packet loss */
|
||||
typedef enum _PositionFlags {
|
||||
|
@ -172,10 +168,8 @@ typedef enum _InputEventChar {
|
|||
} InputEventChar;
|
||||
|
||||
/* The frequency/regulatory region the user has selected.
|
||||
|
||||
Note: In 1.0 builds (which must still be supported by the android app for a
|
||||
long time) this field will be unpopulated.
|
||||
|
||||
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
|
||||
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
|
||||
unset
|
||||
Behave normally.
|
||||
|
||||
Router
|
||||
Functions as a router */
|
||||
typedef enum _RadioConfig_UserPreferences_Serial_Mode {
|
||||
|
|
|
@ -22,12 +22,9 @@ typedef enum _HardwareMessage_Type {
|
|||
/* Struct definitions */
|
||||
/* An example app to show off the module system. This message is used for
|
||||
REMOTE_HARDWARE_APP PortNums.
|
||||
|
||||
Also provides easy remote access to any GPIO.
|
||||
|
||||
In the future other remote hardware operations can be added based on user interest
|
||||
(i.e. serial output, spi/i2c input/output).
|
||||
|
||||
FIXME - currently this feature is turned on by default which is dangerous
|
||||
because no security yet (beyond the channel mechanism).
|
||||
It should be off by default and then protected based on some TBD mechanism
|
||||
|
|
|
@ -40,10 +40,10 @@ typedef struct _EnvironmentMetrics {
|
|||
|
||||
/* Types of Measurements the telemetry module is equipped to handle */
|
||||
typedef struct _Telemetry {
|
||||
/* 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
|
||||
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).
|
||||
/* 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
|
||||
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).
|
||||
seconds since 1970 */
|
||||
uint32_t time;
|
||||
/* Key native device metrics such as battery level */
|
||||
|
|
Ładowanie…
Reference in New Issue