Tag DB Size was only 8bit now 32bit, need to be fixed in further UDP usage later as well

This commit is contained in:
atc1441
2023-08-07 11:53:28 +02:00
parent 0b66a23ce4
commit 3079101c48
2 changed files with 6 additions and 6 deletions

View File

@@ -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);

View File

@@ -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);