diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index e629a87..1fcd78d 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -119,6 +119,11 @@ message AdminMessage { * TODO: REPLACE */ AMBIENTLIGHTING_CONFIG = 10; + + /* + * TODO: REPLACE + */ + DETECTIONSENSOR_CONFIG = 11; } /* diff --git a/meshtastic/config.proto b/meshtastic/config.proto index e72c39c..5da460f 100644 --- a/meshtastic/config.proto +++ b/meshtastic/config.proto @@ -268,7 +268,7 @@ message Config { uint32 broadcast_smart_minimum_distance = 10; /* - * The minumum number of seconds (since the last send) before we can send a position to the mesh if position_broadcast_smart_enabled + * The minimum number of seconds (since the last send) before we can send a position to the mesh if position_broadcast_smart_enabled */ uint32 broadcast_smart_minimum_interval_secs = 11; } diff --git a/meshtastic/localonly.proto b/meshtastic/localonly.proto index 4b51795..5f46f9a 100644 --- a/meshtastic/localonly.proto +++ b/meshtastic/localonly.proto @@ -111,10 +111,20 @@ message LocalModuleConfig { */ ModuleConfig.NeighborInfoConfig neighbor_info = 11; + /* + * The part of the config that is specific to the Ambient Lighting module + */ + ModuleConfig.AmbientLightingConfig ambient_lighting = 12; + + /* + * The part of the config that is specific to the Detection Sensor module + */ + ModuleConfig.DetectionSensorConfig detection_sensor = 13; + /* * 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; -} +} \ No newline at end of file diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 2e93e3d..4d0ec0f 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -1094,7 +1094,7 @@ enum CriticalErrorCode { TRANSMIT_FAILED = 8; /* - * We detected that the main CPU voltage dropped below the minumum acceptable value + * We detected that the main CPU voltage dropped below the minimum acceptable value */ BROWNOUT = 9; diff --git a/meshtastic/module_config.options b/meshtastic/module_config.options index ed45932..fdc46d5 100644 --- a/meshtastic/module_config.options +++ b/meshtastic/module_config.options @@ -22,4 +22,7 @@ *AmbientLightingConfig.current int_size:8 *AmbientLightingConfig.red int_size:8 *AmbientLightingConfig.green int_size:8 -*AmbientLightingConfig.blue int_size:8 \ No newline at end of file +*AmbientLightingConfig.blue int_size:8 + +*DetectionSensorConfig.monitor_pin int_size:8 +*DetectionSensorConfig.name max_size:20 \ No newline at end of file diff --git a/meshtastic/module_config.proto b/meshtastic/module_config.proto index 75fb96f..649a343 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -108,6 +108,57 @@ message ModuleConfig { uint32 update_interval = 2; } + /* + * Detection Sensor Module Config + */ + message DetectionSensorConfig { + /* + * Whether the Module is enabled + */ + bool enabled = 1; + + /* + * Interval in seconds of how often we can send a message to the mesh when a state change is detected + */ + uint32 minimum_broadcast_secs = 2; + + /* + * Interval in seconds of how often we should send a message to the mesh with the current state regardless of changes + * When set to 0, only state changes will be broadcasted + * Works as a sort of status heartbeat for peace of mind + */ + uint32 state_broadcast_secs = 3; + /* + * Send ASCII bell with alert message + * Useful for triggering ext. notification on bell + */ + bool send_bell = 4; + + /* + * Friendly name used to format message sent to mesh + * Example: A name "Motion" would result in a message "Motion detected" + * Maximum length of 20 characters + */ + string name = 5; + + /* + * GPIO pin to monitor for state changes + */ + uint32 monitor_pin = 6; + + /* + * Whether or not the GPIO pin state detection is triggered on HIGH (1) + * Otherwise LOW (0) + */ + bool detection_triggered_high = 7; + + /* + * Whether or not use INPUT_PULLUP mode for GPIO pin + * Only applicable if the board uses pull-up resistors on the pin + */ + bool use_pullup = 8; + } + /* * Audio Config for codec2 voice */ @@ -614,9 +665,12 @@ message ModuleConfig { * TODO: REPLACE */ AmbientLightingConfig ambient_lighting = 11; + + /* + * TODO: REPLACE + */ + DetectionSensorConfig detection_sensor = 12; } - - } /*