MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / checkVars

Function checkVars

ESP32_AP-Flasher/src/contentmanager.cpp:103–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void checkVars() {
104 JsonDocument cfgobj;
105 for (tagRecord *tag : tagDB) {
106 if (tag->contentMode == 19) {
107 deserializeJson(cfgobj, tag->modeConfigJson);
108 const String jsonfile = cfgobj["filename"].as<String>();
109 if (!util::isEmptyOrNull(jsonfile)) {
110 File file = contentFS->open(jsonfile, "r");
111 if (file) {
112 const size_t fileSize = file.size();
113 std::unique_ptr<char[]> fileContent(new char[fileSize + 1]);
114 file.readBytes(fileContent.get(), fileSize);
115 file.close();
116 fileContent[fileSize] = '\0';
117 const char *contentPtr = fileContent.get();
118 for (const auto &entry : varDB) {
119 if (entry.second.changed && strstr(contentPtr, entry.first.c_str()) != nullptr) {
120 Serial.println("updating " + jsonfile + " because of var " + entry.first.c_str());
121 tag->nextupdate = 0;
122 }
123 }
124 }
125 file.close();
126 }
127 }
128 if (tag->contentMode == 21) {
129 if (varDB["ap_tagcount"].changed || varDB["ap_ip"].changed || varDB["ap_ch"].changed) {
130 tag->nextupdate = 0;
131 }
132 }
133 }
134 for (const auto &entry : varDB) {
135 if (entry.second.changed) varDB[entry.first].changed = false;
136 }
137}
138
139/// @brief Draw a counter
140/// @param mac Destination mac

Callers 1

loopFunction · 0.85

Calls 6

isEmptyOrNullFunction · 0.85
openMethod · 0.80
getMethod · 0.80
closeMethod · 0.80
printlnMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected