mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 06:06:23 +01:00
Added Display Access Point Infos on Boot on AP Display
This commit is contained in:
@@ -44,3 +44,4 @@ void prepareLUTreq(uint8_t *dst, String input);
|
||||
void prepareConfigFile(uint8_t *dst, JsonObject config);
|
||||
void getTemplate(JsonDocument &json, const char *filePath, uint8_t id, uint8_t hwtype);
|
||||
void setU8G2Font(const String &title, U8g2_for_TFT_eSPI &u8f);
|
||||
void showIpAddress(String dst);
|
||||
|
||||
@@ -1150,4 +1150,35 @@ void setU8G2Font(const String &title, U8g2_for_TFT_eSPI &u8f) {
|
||||
if (title == "glasstown_nbp_tf") u8f.setFont(u8g2_font_glasstown_nbp_tf);
|
||||
if (title == "7x14_tf") u8f.setFont(u8g2_font_7x14_tf);
|
||||
if (title == "t0_14b_tf") u8f.setFont(u8g2_font_t0_14b_tf);
|
||||
}
|
||||
}
|
||||
|
||||
void showIpAddress(String dst) {
|
||||
uint8_t mac[8];
|
||||
if (hex2mac(dst, mac)) {
|
||||
tagRecord *taginfo = nullptr;
|
||||
taginfo = tagRecord::findByMAC(mac);
|
||||
if (taginfo != nullptr) {
|
||||
String json = String("[");
|
||||
json += String("{\"text\": [0,5,\"OpenEPaperLink\",\"fonts/bahnschrift20\",2]}");
|
||||
json += String(",");
|
||||
json += String("{\"text\": [0,25,\"MAC:\",\"fonts/bahnschrift20\",1]}");
|
||||
json += String(",");
|
||||
json += String("{\"text\": [10,55,\"") + dst + String("\",\"glasstown_nbp_tf\",1]}");
|
||||
json += String(",");
|
||||
json += String("{\"text\": [0,65,\"IP:\",\"fonts/bahnschrift20\",1]}");
|
||||
json += String(",");
|
||||
json += String("{\"text\": [0,85,\"") + WiFi.localIP().toString() + String("\",\"fonts/bahnschrift20\",1]}");
|
||||
json += String("]");
|
||||
File file = LittleFS.open("/" + dst + ".json", "w");
|
||||
if (!file) {
|
||||
Serial.print("Failed to create file\n");
|
||||
return;
|
||||
}
|
||||
file.print(json);
|
||||
file.close();
|
||||
taginfo->modeConfigJson = "{\"filename\":\"" + dst + ".json\"}";
|
||||
taginfo->contentMode = 19;
|
||||
taginfo->nextupdate = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "storage.h"
|
||||
#include "web.h"
|
||||
#include "zbs_interface.h"
|
||||
#include "contentmanager.h"
|
||||
|
||||
QueueHandle_t rxCmdQueue;
|
||||
SemaphoreHandle_t txActive;
|
||||
@@ -537,6 +538,12 @@ void ShowAPInfo() {
|
||||
Serial.printf("| Power | %02X |\n", apInfo.power);
|
||||
Serial.printf("| MAC | %02X%02X%02X%02X%02X%02X%02X%02X |\n", apInfo.mac[7], apInfo.mac[6], apInfo.mac[5], apInfo.mac[4], apInfo.mac[3], apInfo.mac[2], apInfo.mac[1], apInfo.mac[0]);
|
||||
Serial.printf("| Version | 0x%04X |\n", apInfo.version);
|
||||
|
||||
if (apInfo.type == SOLUM_154_SSD1619 || apInfo.type == SOLUM_29_SSD1619 || apInfo.type == SOLUM_29_UC8151 || apInfo.type == SOLUM_42_SSD1619) {
|
||||
char macString[50];
|
||||
sprintf(macString, "%02X%02X%02X%02X%02X%02X%02X%02X", apInfo.mac[7], apInfo.mac[6], apInfo.mac[5], apInfo.mac[4], apInfo.mac[3], apInfo.mac[2], apInfo.mac[1], apInfo.mac[0]);
|
||||
showIpAddress(macString);
|
||||
}
|
||||
}
|
||||
|
||||
void notifySegmentedFlash() {
|
||||
|
||||
Reference in New Issue
Block a user