Merge pull request #344 from meshtastic/remote-hardware

Remote hardware pin advertisement
pull/345/head
Ben Meadors 2023-05-15 15:34:19 -05:00 zatwierdzone przez GitHub
commit bdd58660c4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
6 zmienionych plików z 81 dodań i 1 usunięć

Wyświetl plik

@ -12,3 +12,5 @@
*OEMStore.oem_text max_size:40
*OEMStore.oem_icon_bits max_size:2048
*OEMStore.oem_aes_key max_size:32
*DeviceState.node_remote_hardware_pins max_count:12

Wyświetl plik

@ -11,6 +11,7 @@ option swift_prefix = "";
import "meshtastic/channel.proto";
import "meshtastic/localonly.proto";
import "meshtastic/mesh.proto";
import "meshtastic/module_config.proto";
/*
* This message is never sent over the wire, but it is used for serializing DB
@ -72,6 +73,11 @@ message DeviceState {
* Might be null
*/
MeshPacket rx_waypoint = 12;
/*
* The mesh's nodes with their available gpio pins for RemoteHardware module
*/
repeated NodeRemoteHardwarePin node_remote_hardware_pins = 13;
}
/*
@ -158,4 +164,20 @@ message OEMStore {
* A Preset LocalModuleConfig to apply during factory reset
*/
LocalModuleConfig oem_local_module_config = 8;
}
/*
* RemoteHardwarePins associated with a node
*/
message NodeRemoteHardwarePin {
/*
* The node_num exposing the available gpio pin
*/
uint32 node_num = 1;
/*
* The the available gpio pin for usage with RemoteHardware module
*/
RemoteHardwarePin pin = 2;
}

Wyświetl plik

@ -53,4 +53,4 @@
*NeighborInfo.neighbors max_count:10
*DeviceMetadata.firmware_version max_size:18
*DeviceMetadata.firmware_version max_size:18

Wyświetl plik

@ -1468,4 +1468,9 @@ message Neighbor {
* Device hardware model
*/
HardwareModel hw_model = 9;
/*
* Has Remote Hardware enabled
*/
bool hasRemoteHardware = 10;
}

Wyświetl plik

@ -14,3 +14,7 @@
*ExternalNotificationConfig.output_vibra int_size:8
*ExternalNotificationConfig.output_buzzer int_size:8
*ExternalNotificationConfig.nag_timeout int_size:16
*RemoteHardwareConfig:available_pins max_count:4
*RemoteHardwarePin.name max_size:15
*RemoteHardwarePin.gpio_pin int_size:8

Wyświetl plik

@ -78,6 +78,16 @@ message ModuleConfig {
* Whether the Module is enabled
*/
bool enabled = 1;
/*
* Whether the Module allows consumers to read / write to pins not defined in available_pins
*/
bool allow_undefined_pin_access = 2;
/*
* Exposes the available pins to the mesh for reading and writing
*/
repeated RemoteHardwarePin available_pins = 3;
}
/*
@ -558,3 +568,40 @@ message ModuleConfig {
}
}
/*
* A GPIO pin definition for remote hardware module
*/
message RemoteHardwarePin {
/*
* GPIO Pin number (must match Arduino)
*/
uint32 gpio_pin = 1;
/*
* Name for the GPIO pin (i.e. Front gate, mailbox, etc)
*/
string name = 2;
/*
* Type of GPIO access available to consumers on the mesh
*/
RemoteHardwarePinType type = 3;
}
enum RemoteHardwarePinType {
/*
* Unset/unused
*/
UNKNOWN = 0;
/*
* GPIO pin can be read (if it is high / low)
*/
DIGITAL_READ = 1;
/*
* GPIO pin can be written to (high / low)
*/
DIGITAL_WRITE = 2;
}