pull/11/head
Kevin Hester 2021-01-29 10:11:10 +08:00
rodzic 4c62d8e536
commit 2e15426fe3
7 zmienionych plików z 1081 dodań i 739 usunięć

3
.vscode/settings.json vendored 100644
Wyświetl plik

@ -0,0 +1,3 @@
{
"cmake.configureOnOpen": false
}

Wyświetl plik

@ -6,18 +6,24 @@ option optimize_for = LITE_RUNTIME;
import "mesh.proto";
/**
This message wraps a MeshPacket with extra metadata about the sender and how it arrived.
*/
/*
* This message wraps a MeshPacket with extra metadata about the sender and how it arrived.
*/
message ServiceEnvelope {
/** The (probably encrypted) packet */
/*
* The (probably encrypted) packet
*/
MeshPacket packet = 1;
/** The global channel ID it was sent on */
/*
* The global channel ID it was sent on
*/
string channel_id = 2;
/** The sending gateway. Can we use this to authenticate/prevent fake
nodeid impersonation for senders? - i.e. use gateway/mesh id (which is authenticated) + local node id as
the globally trusted nodenum */
/*
* The sending gateway. Can we use this to authenticate/prevent fake
* nodeid impersonation for senders? - i.e. use gateway/mesh id (which is authenticated) + local node id as
* the globally trusted nodenum
*/
string gateway_id = 3;
}

Wyświetl plik

@ -6,45 +6,62 @@ option optimize_for = LITE_RUNTIME;
import "mesh.proto";
// This message is never sent over the wire, but it is used for serializing DB
// state to flash in the device code
// FIXME, since we write this each time we enter deep sleep (and have infinite
// flash) it would be better to use some sort of append only data structure for
// the receive queue and use the preferences store for the other stuff
/*
* This message is never sent over the wire, but it is used for serializing DB
* state to flash in the device code
* FIXME, since we write this each time we enter deep sleep (and have infinite
* flash) it would be better to use some sort of append only data structure for
* the receive queue and use the preferences store for the other stuff
*/
message DeviceState {
RadioConfig radio = 1;
/// Read only settings/info about this node
/*
* Read only settings/info about this node
*/
MyNodeInfo my_node = 2;
/// My owner info
/*
* My owner info
*/
User owner = 3;
repeated NodeInfo node_db = 4;
/// Received packets saved for delivery to the phone
/*
* Received packets saved for delivery to the phone
*/
repeated MeshPacket receive_queue = 5;
/** A version integer used to invalidate old save files when we make
incompatible changes This integer is set at build time and is private to
NodeDB.cpp in the device code. */
/*
* A version integer used to invalidate old save files when we make
* incompatible changes This integer is set at build time and is private to
* NodeDB.cpp in the device code.
*/
uint32 version = 8;
// We keep the last received text message (only) stored in the device flash,
// so we can show it on the screen. Might be null
/*
* We keep the last received text message (only) stored in the device flash,
* so we can show it on the screen.
* Might be null
*/
MeshPacket rx_text_message = 7;
// Used only during development. Indicates developer is testing and changes
// should never be saved to flash.
/*
* Used only during development. Indicates developer is testing and changes
* should never be saved to flash.
*/
bool no_save = 9;
// Some GPSes seem to have bogus settings from the factory, so we always do
// one factory reset
/*
* Some GPSes seem to have bogus settings from the factory, so we always do one factory reset.
*/
bool did_gps_reset = 11;
/** Secondary channels are only used for encryption/decryption/authentication purposes. Their radio settings (freq etc)
are ignored, only psk is used.
Note: this is not kept inside of RadioConfig because that would make ToRadio/FromRadio worse case > 512 bytes (to big for BLE)
*/
/*
* Secondary channels are only used for encryption/decryption/authentication purposes. Their radio settings (freq etc)
* are ignored, only psk is used.
* Note: this is not kept inside of RadioConfig because that would make ToRadio/FromRadio worse case > 512 bytes (to big for BLE)
*/
repeated ChannelSettings secondary_channels = 12;
}

1475
mesh.proto

Plik diff jest za duży Load Diff

Wyświetl plik

@ -1,29 +1,37 @@
syntax = "proto3";
/** This file documents protobufs that are being considered but are not yet in use
*/
/*
* This file documents protobufs that are being considered but are not yet in use
*/
/**
Placeholder for data we will eventually set during initial programming. This
will allow us to stop having a load for each region.
*/
/*
* Placeholder for data we will eventually set during initial programming. This
* will allow us to stop having a load for each region.
*/
message ManufacturingData {
/// center frequency for the radio hardware that was stuffed
uint32 fradioFreq = 1;
/// TBEAM, HELTEC, etc...
/*
* center frequency for the radio hardware that was stuffed
*/
uint32 fradioFreq = 1;
/*
* TBEAM, HELTEC, etc...
*/
string hw_model = 2;
// Hardware version number
/*
* Hardware version number
*/
string hw_version = 3;
/**
This code is written during manfacturing time and allows users to confirm that
the initial manufacturing tests succeeded.
0 means no test performed.
1 means all tests passed
negative numbers indicate particular error codes
*/
/*
* This code is written during manfacturing time and allows users to confirm that
* the initial manufacturing tests succeeded.
*
* 0 means no test performed.
* 1 means all tests passed
* negative numbers indicate particular error codes
*/
sint32 selftest_result = 4;
}

Wyświetl plik

@ -4,88 +4,105 @@ option java_package = "com.geeksville.mesh";
option java_outer_classname = "Portnums";
option optimize_for = LITE_RUNTIME;
/**
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.
*/
/*
* 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.
*/
enum PortNum {
/** Deprecated: do not use in new code (formerly called OPAQUE)
A message sent from a device outside of the mesh, in a form the mesh
does not understand
NOTE: This must be 0, because it is documented in IMeshService.aidl to be so
*/
/*
* Deprecated: do not use in new code (formerly called OPAQUE)
* A message sent from a device outside of the mesh, in a form the mesh does not understand
* NOTE: This must be 0, because it is documented in IMeshService.aidl to be so
*/
UNKNOWN_APP = 0;
/** a simple UTF-8 text message, which even the little micros in the mesh
can understand and show on their screen eventually in some circumstances
even signal might send messages in this form (see below)
Formerly called CLEAR_TEXT */
/*
* A simple UTF-8 text message, which even the little micros in the mesh
* can understand and show on their screen eventually in some circumstances
* even signal might send messages in this form (see below)
* Formerly called CLEAR_TEXT
*/
TEXT_MESSAGE_APP = 1;
/** a message receive acknowledgement, sent in cleartext - allows radio to
show user that a message has been read by the recipient, optional
Note: this concept has been removed for now. Once READACK is implemented, use the
new packet type/port number stuff?
@exclude
CLEAR_READACK = 2;
*/
/** Reserved for built-in GPIO/example app.
See remote_hardware.proto/HardwareMessage for details on the message sent/received to this port number
*/
/*
* A message receive acknowledgement, sent in cleartext - allows radio to
* show user that a message has been read by the recipient, optional
*
* Note: this concept has been removed for now. Once READACK is implemented, use the
* new packet type/port number stuff?
*
* @exclude
*
* CLEAR_READACK = 2;
*
* Reserved for built-in GPIO/example app.
* See remote_hardware.proto/HardwareMessage for details on the message sent/received to this port number
*/
REMOTE_HARDWARE_APP = 2;
/** The built-in position messaging app.
See Position for details on the message sent to this port number.
*/
/*
* The built-in position messaging app.
* See Position for details on the message sent to this port number.
*/
POSITION_APP = 3;
/** The built-in user info app.
See User for details on the message sent to this port number.
*/
/*
* The built-in user info app.
* See User for details on the message sent to this port number.
*/
NODEINFO_APP = 4;
/** Provides a 'ping' service that replies to any packet it receives. Also this serves as a
small example plugin.
*/
/*
* Provides a 'ping' service that replies to any packet it receives. Also this serves as a small example plugin.
*/
REPLY_APP = 32;
/** Used for the python IP tunnel feature */
/*
* Used for the python IP tunnel feature
*/
IP_TUNNEL_APP = 33;
/** Provides a hardware serial interface to send and receive from the Meshtastic network.
Connect to the RX/TX pins of a device with 38400 8N1. Packets received from the Meshtastic
network is forwarded to the RX pin while sending a packet to TX will go out to the Mesh
network. Maximum packet size of 240 bytes.
Plugin is disabled by default can be turned on by setting SERIALPLUGIN_ENABLED = 1 in
SerialPlugh.cpp.
Maintained by Jm Casler (MC Hamster) : jm@casler.org
*/
/*
* Provides a hardware serial interface to send and receive from the Meshtastic network.
* Connect to the RX/TX pins of a device with 38400 8N1. Packets received from the Meshtastic
* network is forwarded to the RX pin while sending a packet to TX will go out to the Mesh
* network. Maximum packet size of 240 bytes.
*
* Maintained by Jm Casler (MC Hamster) : jm@casler.org
*/
SERIAL_APP = 64;
/** Private applications should use portnums >= 256. To simplify initial development and testing you can use "PRIVATE_APP"
in your code without needing to rebuild protobuf files (via bin/regin_protos.sh) */
/*
* STORE_REQUEST_APP (Work in Progress)
*
* Maintained by Jm Casler (MC Hamster) : jm@casler.org
*/
STORE_REQUEST_APP = 65;
/*
* Private applications should use portnums >= 256.
* To simplify initial development and testing you can use "PRIVATE_APP"
* in your code without needing to rebuild protobuf files (via bin/regin_protos.sh)
*/
PRIVATE_APP = 256;
/*
* ATAK Forwarder Plugin https://github.com/paulmandal/atak-forwarder
*/
ATAK_FORWARDER = 257;
}

Wyświetl plik

@ -4,49 +4,65 @@ option java_package = "com.geeksville.mesh";
option java_outer_classname = "RemoteHardware";
option optimize_for = LITE_RUNTIME;
/** A example app to show off the plugin 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 (a special channel
once multichannel support is included?)
*/
/* A example app to show off the plugin 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 (a special channel once multichannel support is included?)
*/
message HardwareMessage {
enum Type {
/** Unset/unused */
/*
* Unset/unused
*/
UNSET = 0;
/** Set gpio gpios based on gpio_mask/gpio_value */
/*
* Set gpio gpios based on gpio_mask/gpio_value
*/
WRITE_GPIOS = 1;
/** We are now interested in watching the gpio_mask gpios. If the selected gpios change, please broadcast
GPIOS_CHANGED.
Will implicitly change the gpios requested to be INPUT gpios.
*/
/*
* We are now interested in watching the gpio_mask gpios.
* If the selected gpios change, please broadcast GPIOS_CHANGED.
*
* Will implicitly change the gpios requested to be INPUT gpios.
*/
WATCH_GPIOS = 2;
/** The gpios listed in gpio_mask have changed, the new values are listed in gpio_value */
/*
* The gpios listed in gpio_mask have changed, the new values are listed in gpio_value
*/
GPIOS_CHANGED = 3;
/** Read the gpios specified in gpio_mask, send back a READ_GPIOS_REPLY reply with gpio_value populated */
/*
* Read the gpios specified in gpio_mask, send back a READ_GPIOS_REPLY reply with gpio_value populated
*/
READ_GPIOS = 4;
/** A reply to READ_GPIOS. gpio_mask and gpio_value will be populated */
/*
* A reply to READ_GPIOS. gpio_mask and gpio_value will be populated
*/
READ_GPIOS_REPLY = 5;
}
/** What type of HardwareMessage is this? */
/*
* What type of HardwareMessage is this?
*/
Type typ = 1;
/** What gpios are we changing. Not used for all MessageTypes, see MessageType for details */
/*
* What gpios are we changing. Not used for all MessageTypes, see MessageType for details
*/
uint64 gpio_mask = 2;
/** For gpios that were listed in gpio_mask as valid, what are the signal levels for those gpios.
Not used for all MessageTypes, see MessageType for details */
/*
* For gpios that were listed in gpio_mask as valid, what are the signal levels for those gpios.
* Not used for all MessageTypes, see MessageType for details
*/
uint64 gpio_value = 3;
}
}