Initial Detection sensor module feature (#2722)

* WIP

* Updates

* Doh!

* Move it out of the macro guard so portduino can build

* Changes from feedback
This commit is contained in:
Ben Meadors
2023-08-14 19:00:51 -05:00
committed by GitHub
parent 18899fd168
commit 144dfe9805
14 changed files with 230 additions and 12 deletions

View File

@@ -373,6 +373,11 @@ void AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c)
moduleConfig.has_neighbor_info = true;
moduleConfig.neighbor_info = c.payload_variant.neighbor_info;
break;
case meshtastic_ModuleConfig_detection_sensor_tag:
LOG_INFO("Setting module config: Detection Sensor\n");
moduleConfig.has_detection_sensor = true;
moduleConfig.detection_sensor = c.payload_variant.detection_sensor;
break;
}
saveChanges(SEGMENT_MODULECONFIG);
@@ -513,6 +518,11 @@ void AdminModule::handleGetModuleConfig(const meshtastic_MeshPacket &req, const
res.get_module_config_response.which_payload_variant = meshtastic_ModuleConfig_neighbor_info_tag;
res.get_module_config_response.payload_variant.neighbor_info = moduleConfig.neighbor_info;
break;
case meshtastic_AdminMessage_ModuleConfigType_DETECTIONSENSOR_CONFIG:
LOG_INFO("Getting module config: Detection Sensor\n");
res.get_module_config_response.which_payload_variant = meshtastic_ModuleConfig_detection_sensor_tag;
res.get_module_config_response.payload_variant.detection_sensor = moduleConfig.detection_sensor;
break;
}
// NOTE: The phone app needs to know the ls_secsvalue so it can properly expect sleep behavior.