2020-12-06 10:32:39 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2020-12-07 11:49:43 +00:00
|
|
|
option java_package = "com.geeksville.mesh";
|
|
|
|
option java_outer_classname = "RemoteHardware";
|
|
|
|
option optimize_for = LITE_RUNTIME;
|
2021-05-24 00:31:38 +00:00
|
|
|
option go_package = "github.com/meshtastic/gomeshproto";
|
2020-12-07 11:49:43 +00:00
|
|
|
|
2021-03-07 08:28:48 +00:00
|
|
|
/*
|
|
|
|
* An example app to show off the plugin system. This message is used for
|
2021-02-23 23:15:20 +00:00
|
|
|
* REMOTE_HARDWARE_APP PortNums.
|
2021-01-29 02:11:10 +00:00
|
|
|
*
|
2021-02-23 23:15:20 +00:00
|
|
|
* Also provides easy remote access to any GPIO.
|
2021-01-29 02:11:10 +00:00
|
|
|
*
|
2021-02-23 23:15:20 +00:00
|
|
|
* In the future other remote hardware operations can be added based on user interest
|
|
|
|
* (i.e. serial output, spi/i2c input/output).
|
2021-01-29 02:11:10 +00:00
|
|
|
*
|
2021-02-23 23:15:20 +00:00
|
|
|
* 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?)
|
2021-01-29 02:11:10 +00:00
|
|
|
*/
|
2020-12-06 10:32:39 +00:00
|
|
|
message HardwareMessage {
|
2020-12-07 02:17:24 +00:00
|
|
|
enum Type {
|
2021-01-29 02:11:10 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Unset/unused
|
|
|
|
*/
|
2020-12-06 10:32:39 +00:00
|
|
|
UNSET = 0;
|
|
|
|
|
2021-01-29 02:11:10 +00:00
|
|
|
/*
|
|
|
|
* Set gpio gpios based on gpio_mask/gpio_value
|
|
|
|
*/
|
2020-12-06 10:32:39 +00:00
|
|
|
WRITE_GPIOS = 1;
|
|
|
|
|
2021-01-29 02:11:10 +00:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
2020-12-06 10:32:39 +00:00
|
|
|
WATCH_GPIOS = 2;
|
|
|
|
|
2021-01-29 02:11:10 +00:00
|
|
|
/*
|
|
|
|
* The gpios listed in gpio_mask have changed, the new values are listed in gpio_value
|
|
|
|
*/
|
2020-12-06 10:32:39 +00:00
|
|
|
GPIOS_CHANGED = 3;
|
|
|
|
|
2021-01-29 02:11:10 +00:00
|
|
|
/*
|
|
|
|
* Read the gpios specified in gpio_mask, send back a READ_GPIOS_REPLY reply with gpio_value populated
|
|
|
|
*/
|
2020-12-06 10:32:39 +00:00
|
|
|
READ_GPIOS = 4;
|
|
|
|
|
2021-01-29 02:11:10 +00:00
|
|
|
/*
|
|
|
|
* A reply to READ_GPIOS. gpio_mask and gpio_value will be populated
|
|
|
|
*/
|
2020-12-06 10:32:39 +00:00
|
|
|
READ_GPIOS_REPLY = 5;
|
|
|
|
}
|
|
|
|
|
2021-01-29 02:11:10 +00:00
|
|
|
/*
|
|
|
|
* What type of HardwareMessage is this?
|
|
|
|
*/
|
2020-12-07 02:17:24 +00:00
|
|
|
Type typ = 1;
|
2020-12-06 10:32:39 +00:00
|
|
|
|
2021-01-29 02:11:10 +00:00
|
|
|
/*
|
|
|
|
* What gpios are we changing. Not used for all MessageTypes, see MessageType for details
|
|
|
|
*/
|
2020-12-06 10:32:39 +00:00
|
|
|
uint64 gpio_mask = 2;
|
|
|
|
|
2021-01-29 02:11:10 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
2020-12-06 10:32:39 +00:00
|
|
|
uint64 gpio_value = 3;
|
2021-01-29 02:11:10 +00:00
|
|
|
}
|