mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 12:05:51 +01:00
bugfix ap info screen
This commit is contained in:
@@ -94,6 +94,11 @@ void checkVars() {
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
if (tag->contentMode == 21) {
|
||||
if (varDB["ap_tagcount"].changed || varDB["ap_ip"].changed || varDB["ap_ch"].changed) {
|
||||
tag->nextupdate = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const auto &entry : varDB) {
|
||||
if (entry.second.changed) varDB[entry.first].changed = false;
|
||||
@@ -356,15 +361,8 @@ void drawNew(uint8_t mac[8], bool buttonPressed, tagRecord *&taginfo) {
|
||||
|
||||
case 21: // ap info
|
||||
drawAPinfo(filename, cfgobj, taginfo, imageParams);
|
||||
/*
|
||||
if (imageParams.bpp == 16) {
|
||||
taginfo->nextupdate = now + 60;
|
||||
} else {
|
||||
taginfo->nextupdate = now + 600;
|
||||
}
|
||||
*/
|
||||
taginfo->nextupdate = 3216153600;
|
||||
updateTagImage(filename, mac, 0, taginfo, imageParams);
|
||||
taginfo->nextupdate = 3216153600;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -264,17 +264,20 @@ uint32_t getTagCount(uint32_t& timeoutcount) {
|
||||
uint32_t tagcount = 0;
|
||||
time_t now;
|
||||
time(&now);
|
||||
// Serial.printf("now: %d\n", now);
|
||||
for (uint32_t c = 0; c < tagDB.size(); c++) {
|
||||
tagRecord* taginfo = nullptr;
|
||||
taginfo = tagDB.at(c);
|
||||
if (taginfo->isExternal == false) tagcount++;
|
||||
int32_t timeout1 = now - taginfo->lastseen;
|
||||
int32_t timeout2 = taginfo->lastseen - taginfo->expectedNextCheckin;
|
||||
// Serial.printf("%d expected: %d lastseen: %d -> %d %d\n", c, taginfo->expectedNextCheckin, timeout1, timeout2);
|
||||
if (((taginfo->expectedNextCheckin < 3600 && timeout1 > 3600) ||
|
||||
(taginfo->expectedNextCheckin > 3600 && timeout2 > 600)) &&
|
||||
now > 3600 && millis() > 60000) timeoutcount++;
|
||||
int32_t timeout = now - taginfo->lastseen;
|
||||
if (taginfo->expectedNextCheckin < 3600) {
|
||||
// not initialised, timeout if not seen last 10 minutes
|
||||
if (timeout > 600) timeoutcount++;
|
||||
} else {
|
||||
if (now - taginfo->expectedNextCheckin > 600) {
|
||||
//expected checkin is behind, timeout if not seen last 10 minutes
|
||||
if (timeout > 600) timeoutcount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return tagcount;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ void wsSendSysteminfo() {
|
||||
uint32_t tagcount = getTagCount(timeoutcount);
|
||||
char result[40];
|
||||
if (timeoutcount > 0) {
|
||||
snprintf(result, sizeof(result), "%lu / %lu, %lu timeout", tagcount, tagDB.size(), timeoutcount);
|
||||
snprintf(result, sizeof(result), "%lu / %lu, %lu timed out", tagcount, tagDB.size(), timeoutcount);
|
||||
} else {
|
||||
snprintf(result, sizeof(result), "%lu / %lu", tagcount, tagDB.size());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user