mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
CMD_SET_CUSTOM_VAR will update gps and gps_interval
This commit is contained in:
parent
df3cb3d192
commit
cfb7ed876c
1 changed files with 11 additions and 0 deletions
|
|
@ -1525,6 +1525,17 @@ void MyMesh::handleCmdFrame(size_t len) {
|
||||||
*np++ = 0; // modify 'cmd_frame', replace ':' with null
|
*np++ = 0; // modify 'cmd_frame', replace ':' with null
|
||||||
bool success = sensors.setSettingValue(sp, np);
|
bool success = sensors.setSettingValue(sp, np);
|
||||||
if (success) {
|
if (success) {
|
||||||
|
#if ENV_INCLUDE_GPS == 1
|
||||||
|
// Update node preferences for GPS settings
|
||||||
|
if (strcmp(sp, "gps") == 0) {
|
||||||
|
_prefs.gps_enabled = (np[0] == '1') ? 1 : 0;
|
||||||
|
savePrefs();
|
||||||
|
} else if (strcmp(sp, "gps_interval") == 0) {
|
||||||
|
uint32_t interval_seconds = atoi(np);
|
||||||
|
_prefs.gps_interval = constrain(interval_seconds, 0, 86400);
|
||||||
|
savePrefs();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
writeOKFrame();
|
writeOKFrame();
|
||||||
} else {
|
} else {
|
||||||
writeErrFrame(ERR_CODE_ILLEGAL_ARG);
|
writeErrFrame(ERR_CODE_ILLEGAL_ARG);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue