diff --git a/examples/simple_repeater/MyMesh.h b/examples/simple_repeater/MyMesh.h index c45c141dc..729c5b7d3 100644 --- a/examples/simple_repeater/MyMesh.h +++ b/examples/simple_repeater/MyMesh.h @@ -137,7 +137,7 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks { #if ENV_INCLUDE_GPS == 1 void applyGpsPrefs() { - sensors.setSettingByKey("gps", _prefs.gps_enabled?"1":"0"); + sensors.setSettingValue("gps", _prefs.gps_enabled?"1":"0"); } #endif diff --git a/examples/simple_room_server/MyMesh.h b/examples/simple_room_server/MyMesh.h index 60ef1e735..f6ce31e51 100644 --- a/examples/simple_room_server/MyMesh.h +++ b/examples/simple_room_server/MyMesh.h @@ -151,7 +151,7 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks { #if ENV_INCLUDE_GPS == 1 void applyGpsPrefs() { - sensors.setSettingByKey("gps", _prefs.gps_enabled?"1":"0"); + sensors.setSettingValue("gps", _prefs.gps_enabled?"1":"0"); } #endif diff --git a/examples/simple_sensor/SensorMesh.h b/examples/simple_sensor/SensorMesh.h index cdc3940c3..ff0698dc9 100644 --- a/examples/simple_sensor/SensorMesh.h +++ b/examples/simple_sensor/SensorMesh.h @@ -151,7 +151,7 @@ class SensorMesh : public mesh::Mesh, public CommonCLICallbacks { #if ENV_INCLUDE_GPS == 1 void applyGpsPrefs() { - sensors.setSettingByKey("gps", _prefs.gps_enabled?"1":"0"); + sensors.setSettingValue("gps", _prefs.gps_enabled?"1":"0"); } #endif }; diff --git a/src/helpers/CommonCLI.cpp b/src/helpers/CommonCLI.cpp index 87f20f5ad..77f0b0856 100644 --- a/src/helpers/CommonCLI.cpp +++ b/src/helpers/CommonCLI.cpp @@ -545,7 +545,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch int num = mesh::Utils::parseTextParts(tmp, parts, 2, ' '); const char *key = (num > 0) ? parts[0] : ""; const char *value = (num > 1) ? parts[1] : "null"; - if (sensors.setSettingByKey(key, value)) { + if (sensors.setSettingValue(key, value)) { strcpy(reply, "ok"); } else { strcpy(reply, "can't find custom var"); @@ -577,7 +577,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch } #if ENV_INCLUDE_GPS == 1 } else if (memcmp(command, "gps on", 6) == 0) { - if (sensors.setSettingByKey("gps", "1")) { + if (sensors.setSettingValue("gps", "1")) { _prefs->gps_enabled = 1; savePrefs(); strcpy(reply, "ok"); @@ -585,7 +585,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch strcpy(reply, "gps toggle not found"); } } else if (memcmp(command, "gps off", 7) == 0) { - if (sensors.setSettingByKey("gps", "0")) { + if (sensors.setSettingValue("gps", "0")) { _prefs->gps_enabled = 0; savePrefs(); strcpy(reply, "ok"); diff --git a/src/helpers/SensorManager.h b/src/helpers/SensorManager.h index 38c1d806b..89a174c22 100644 --- a/src/helpers/SensorManager.h +++ b/src/helpers/SensorManager.h @@ -34,14 +34,4 @@ class SensorManager { } return NULL; } - - bool setSettingByKey(const char* key, const char* value) { - int num = getNumSettings(); - for (int i = 0; i < num; i++) { - if (strcmp(getSettingName(i), key) == 0) { - return setSettingValue(key, value); - } - } - return false; - } };