kopia lustrzana https://github.com/meshtastic/protobufs
DetectionSensor: make triggering more flexible
rodzic
c4636e0232
commit
3ff3dab75d
|
@ -137,20 +137,39 @@ message ModuleConfig {
|
||||||
* Detection Sensor Module Config
|
* Detection Sensor Module Config
|
||||||
*/
|
*/
|
||||||
message DetectionSensorConfig {
|
message DetectionSensorConfig {
|
||||||
|
|
||||||
|
enum TriggerType {
|
||||||
|
// Event is triggered if pin is low
|
||||||
|
LOGIC_LOW = 0;
|
||||||
|
// Event is triggered if pin is high
|
||||||
|
LOGIC_HIGH = 1;
|
||||||
|
// Event is triggered when pin goes high to low
|
||||||
|
FALLING_EDGE = 2;
|
||||||
|
// Event is triggered when pin goes low to high
|
||||||
|
RISING_EDGE = 3;
|
||||||
|
// Event is triggered on every pin state change, low is considered to be
|
||||||
|
// "active"
|
||||||
|
EITHER_EDGE_ACTIVE_LOW = 4;
|
||||||
|
// Event is triggered on every pin state change, high is considered to be
|
||||||
|
// "active"
|
||||||
|
EITHER_EDGE_ACTIVE_HIGH = 5;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* Whether the Module is enabled
|
* Whether the Module is enabled
|
||||||
*/
|
*/
|
||||||
bool enabled = 1;
|
bool enabled = 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Interval in seconds of how often we can send a message to the mesh when a state change is detected
|
* Interval in seconds of how often we can send a message to the mesh when a
|
||||||
|
* trigger event is detected
|
||||||
*/
|
*/
|
||||||
uint32 minimum_broadcast_secs = 2;
|
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
|
* Interval in seconds of how often we should send a message to the mesh
|
||||||
* When set to 0, only state changes will be broadcasted
|
* with the current state regardless of trigger events When set to 0, only
|
||||||
* Works as a sort of status heartbeat for peace of mind
|
* trigger events will be broadcasted Works as a sort of status heartbeat
|
||||||
|
* for peace of mind
|
||||||
*/
|
*/
|
||||||
uint32 state_broadcast_secs = 3;
|
uint32 state_broadcast_secs = 3;
|
||||||
|
|
||||||
|
@ -173,23 +192,15 @@ message ModuleConfig {
|
||||||
uint32 monitor_pin = 6;
|
uint32 monitor_pin = 6;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Whether or not the GPIO pin state detection is triggered on HIGH (1)
|
* The type of trigger event to be used
|
||||||
* Otherwise LOW (0)
|
|
||||||
*/
|
*/
|
||||||
bool detection_triggered_high = 7;
|
TriggerType detection_trigger_type = 7;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Whether or not use INPUT_PULLUP mode for GPIO pin
|
* Whether or not use INPUT_PULLUP mode for GPIO pin
|
||||||
* Only applicable if the board uses pull-up resistors on the pin
|
* Only applicable if the board uses pull-up resistors on the pin
|
||||||
*/
|
*/
|
||||||
bool use_pullup = 8;
|
bool use_pullup = 8;
|
||||||
|
|
||||||
/*
|
|
||||||
* Whether or not all the state transition should be broadcasted.
|
|
||||||
* Causes an additional message to be sent to mesh when detection state goes
|
|
||||||
* back to false.
|
|
||||||
*/
|
|
||||||
bool broadcast_all_state_transitions = 9;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Ładowanie…
Reference in New Issue