From 3079101c485f397cce2b55d23cfe004eb8b4ffbb Mon Sep 17 00:00:00 2001 From: atc1441 Date: Mon, 7 Aug 2023 11:53:28 +0200 Subject: [PATCH] Tag DB Size was only 8bit now 32bit, need to be fixed in further UDP usage later as well --- ESP32_AP-Flasher/include/tag_db.h | 2 +- ESP32_AP-Flasher/src/tag_db.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ESP32_AP-Flasher/include/tag_db.h b/ESP32_AP-Flasher/include/tag_db.h index 02e43d4f..ef08cce4 100644 --- a/ESP32_AP-Flasher/include/tag_db.h +++ b/ESP32_AP-Flasher/include/tag_db.h @@ -78,7 +78,7 @@ void fillNode(JsonObject &tag, tagRecord* &taginfo); void saveDB(String filename); void loadDB(String filename); void destroyDB(); -uint8_t getTagCount(); +uint32_t getTagCount(); void mac2hex(uint8_t* mac, char* hexBuffer); bool hex2mac(const String& hexString, uint8_t* mac); void clearPending(tagRecord* taginfo); diff --git a/ESP32_AP-Flasher/src/tag_db.cpp b/ESP32_AP-Flasher/src/tag_db.cpp index da3b5788..9573a666 100644 --- a/ESP32_AP-Flasher/src/tag_db.cpp +++ b/ESP32_AP-Flasher/src/tag_db.cpp @@ -235,7 +235,7 @@ void loadDB(String filename) { void destroyDB() { Serial.println("destoying DB"); Serial.printf("before, free heap: %d\n", ESP.getFreeHeap()); - for (int16_t c = 0; c < tagDB.size(); c++) { + for (uint32_t c = 0; c < tagDB.size(); c++) { tagRecord* tag = nullptr; tag = tagDB.at(c); if (tag->data != nullptr) { @@ -248,9 +248,9 @@ void destroyDB() { Serial.printf("after, free heap: %d\n", ESP.getFreeHeap()); } -uint8_t getTagCount() { - uint8_t tagcount = 0; - for (int16_t c = 0; c < tagDB.size(); c++) { +uint32_t getTagCount() { + uint32_t tagcount = 0; + for (uint32_t c = 0; c < tagDB.size(); c++) { tagRecord* taginfo = nullptr; taginfo = tagDB.at(c); if (taginfo->isExternal == false) tagcount++; @@ -264,7 +264,7 @@ void clearPending(tagRecord* taginfo) { //check if this is the last copy of the buffer int datacount = 0; - for (int16_t c = 0; c < tagDB.size(); c++) { + for (uint32_t c = 0; c < tagDB.size(); c++) { if (tagDB.at(c)->data == taginfo->data) datacount++; } if (datacount == 1) free(taginfo->data);