diff --git a/code/espurna/rfm69.ino b/code/espurna/rfm69.ino index 94f900a0..ac6c4746 100644 --- a/code/espurna/rfm69.ino +++ b/code/espurna/rfm69.ino @@ -73,20 +73,20 @@ void _rfm69WebSocketOnAction(uint32_t client_id, const char * action, JsonObject void _rfm69CleanNodes(unsigned char num) { // Look for the last defined node - int i = 0; - while (i < num) { - if (0 == getSetting({"node", i}, 0)) break; - if (!getSetting({"key", i}).length()) break; - if (!getSetting({"topic", i}).length()) break; - ++i; + unsigned char id = 0; + while (id < num) { + if (0 == getSetting({"node", id}, 0)) break; + if (!getSetting({"key", id}).length()) break; + if (!getSetting({"topic", id}).length()) break; + ++id; } // Delete all other settings - while (i < WIFI_MAX_NETWORKS) { - delSetting("node", i); - delSetting("key", i); - delSetting("topic", i); - ++i; + while (id < SETTINGS_MAX_LIST_COUNT) { + delSetting({"node", id}); + delSetting({"key", id}); + delSetting({"topic", id}); + ++id; } } @@ -166,7 +166,7 @@ void _rfm69Process(packet_t * data) { if (!RFM69_PROMISCUOUS_SENDS && (RFM69_GATEWAY_ID != data->targetID)) return; // Try to find a matching mapping - for (unsigned int i=0; isenderID) && (getSetting({"key", i}).equals(data->key))) { diff --git a/code/test/build/nondefault.h b/code/test/build/nondefault.h index 10cfd77e..bda85ecc 100644 --- a/code/test/build/nondefault.h +++ b/code/test/build/nondefault.h @@ -9,3 +9,4 @@ #define INFLUXDB_SUPPORT 1 #define OTA_MQTT_SUPPORT 1 #define RPN_RULES_SUPPORT 1 +#define RFM69_SUPPORT 1