Add phoneapi plumbing. Need to regen protos on my other machine

pull/2667/head
Ben Meadors 2023-07-27 12:51:31 -05:00
rodzic 1a28225cd5
commit 049c587ca2
4 zmienionych plików z 14 dodań i 1 usunięć

@ -1 +1 @@
Subproject commit 7bf13761bbeebd6cfe0604d851cbce818655999d
Subproject commit 0d5b0942fe4a462e3c3c1b214fd4e41c588c9c44

Wyświetl plik

@ -249,6 +249,9 @@ void NodeDB::installDefaultModuleConfig()
strncpy(moduleConfig.mqtt.username, default_mqtt_username, sizeof(moduleConfig.mqtt.username));
strncpy(moduleConfig.mqtt.password, default_mqtt_password, sizeof(moduleConfig.mqtt.password));
moduleConfig.has_neighbor_info = true;
moduleConfig.neighbor_info.enabled = false;
initModuleConfigIntervals();
}
@ -272,6 +275,7 @@ void NodeDB::initModuleConfigIntervals()
moduleConfig.telemetry.device_update_interval = default_broadcast_interval_secs;
moduleConfig.telemetry.environment_update_interval = default_broadcast_interval_secs;
moduleConfig.telemetry.air_quality_interval = default_broadcast_interval_secs;
moduleConfig.neighbor_info.update_interval = default_broadcast_interval_secs;
}
void NodeDB::installDefaultChannels()

Wyświetl plik

@ -279,6 +279,10 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_remote_hardware_tag;
fromRadioScratch.moduleConfig.payload_variant.remote_hardware = moduleConfig.remote_hardware;
break;
case meshtastic_ModuleConfig_neighbor_info_tag:
fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_neighbor_info_tag;
fromRadioScratch.moduleConfig.payload_variant.neighbor_info = moduleConfig.neighbor_info;
break;
default:
LOG_ERROR("Unknown module config type %d\n", config_state);
}

Wyświetl plik

@ -508,6 +508,11 @@ void AdminModule::handleGetModuleConfig(const meshtastic_MeshPacket &req, const
res.get_module_config_response.which_payload_variant = meshtastic_ModuleConfig_remote_hardware_tag;
res.get_module_config_response.payload_variant.remote_hardware = moduleConfig.remote_hardware;
break;
case meshtastic_AdminMessage_ModuleConfigType_NEIGHBORINFO_CONFIG:
LOG_INFO("Getting module config: Remote Hardware\n");
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;
}
// NOTE: The phone app needs to know the ls_secsvalue so it can properly expect sleep behavior.