update
This commit is contained in:
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
@@ -48,6 +48,12 @@
|
|||||||
"streambuf": "cpp",
|
"streambuf": "cpp",
|
||||||
"cinttypes": "cpp",
|
"cinttypes": "cpp",
|
||||||
"typeinfo": "cpp",
|
"typeinfo": "cpp",
|
||||||
"tjpgd.h": "c"
|
"tjpgd.h": "c",
|
||||||
|
"chrono": "cpp",
|
||||||
|
"condition_variable": "cpp",
|
||||||
|
"list": "cpp",
|
||||||
|
"ratio": "cpp",
|
||||||
|
"mutex": "cpp",
|
||||||
|
"thread": "cpp"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,19 +150,12 @@ IPAddress FSWebServer::startWiFi(uint32_t timeout, const char *apSSID, const cha
|
|||||||
|
|
||||||
const char *_ssid;
|
const char *_ssid;
|
||||||
const char *_pass;
|
const char *_pass;
|
||||||
#if defined(ESP8266)
|
|
||||||
struct station_config conf;
|
|
||||||
wifi_station_get_config_default(&conf);
|
|
||||||
_ssid = reinterpret_cast<const char *>(conf.ssid);
|
|
||||||
_pass = reinterpret_cast<const char *>(conf.password);
|
|
||||||
|
|
||||||
#elif defined(ESP32)
|
|
||||||
wifi_config_t conf;
|
wifi_config_t conf;
|
||||||
esp_wifi_get_config(WIFI_IF_STA, &conf);
|
esp_wifi_get_config(WIFI_IF_STA, &conf);
|
||||||
|
|
||||||
_ssid = reinterpret_cast<const char *>(conf.sta.ssid);
|
_ssid = reinterpret_cast<const char *>(conf.sta.ssid);
|
||||||
_pass = reinterpret_cast<const char *>(conf.sta.password);
|
_pass = reinterpret_cast<const char *>(conf.sta.password);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (strlen(_ssid) && strlen(_pass))
|
if (strlen(_ssid) && strlen(_pass))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -493,6 +493,7 @@ void NotifyApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state)
|
|||||||
notify.iconWasPushed = false;
|
notify.iconWasPushed = false;
|
||||||
notify.iconPosition = 0;
|
notify.iconPosition = 0;
|
||||||
notify.scrollDelay = 0;
|
notify.scrollDelay = 0;
|
||||||
|
DisplayManager.showGif=false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ Ticker TimerTicker;
|
|||||||
#define MATRIX_HEIGHT 8
|
#define MATRIX_HEIGHT 8
|
||||||
fs::File gifFile;
|
fs::File gifFile;
|
||||||
GifPlayer gif;
|
GifPlayer gif;
|
||||||
bool showGif;
|
|
||||||
|
uint16_t gifX, gifY;
|
||||||
CRGB leds[MATRIX_WIDTH * MATRIX_HEIGHT];
|
CRGB leds[MATRIX_WIDTH * MATRIX_HEIGHT];
|
||||||
// Awtrix Big / Ulanzi
|
// Awtrix Big / Ulanzi
|
||||||
|
|
||||||
@@ -93,9 +94,13 @@ bool DisplayManager_::setAutoTransition(bool active)
|
|||||||
|
|
||||||
void DisplayManager_::drawGIF(uint16_t x, uint16_t y, fs::File gFile)
|
void DisplayManager_::drawGIF(uint16_t x, uint16_t y, fs::File gFile)
|
||||||
{
|
{
|
||||||
gif.setFile(gFile);
|
gifX = x;
|
||||||
|
gifY = y;
|
||||||
if (!showGif)
|
if (!showGif)
|
||||||
|
{
|
||||||
|
gif.setFile(gFile);
|
||||||
showGif = true;
|
showGif = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayManager_::drawJPG(uint16_t x, uint16_t y, fs::File jpgFile)
|
void DisplayManager_::drawJPG(uint16_t x, uint16_t y, fs::File jpgFile)
|
||||||
@@ -245,7 +250,7 @@ void removeCustomApp(const String &name)
|
|||||||
ui->setApps(Apps);
|
ui->setApps(Apps);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayManager_::generateCustomPage(String name, const char *json)
|
void DisplayManager_::generateCustomPage(const String &name, const char *json)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (strcmp(json, "") == 0 && customApps.count(name))
|
if (strcmp(json, "") == 0 && customApps.count(name))
|
||||||
@@ -256,12 +261,14 @@ void DisplayManager_::generateCustomPage(String name, const char *json)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Serial.printf("Appname %s", name);
|
|
||||||
|
|
||||||
DynamicJsonDocument doc(1024);
|
DynamicJsonDocument doc(1024);
|
||||||
DeserializationError error = deserializeJson(doc, json);
|
DeserializationError error = deserializeJson(doc, json);
|
||||||
if (error)
|
if (error)
|
||||||
|
{
|
||||||
|
doc.clear();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
CustomApp customApp;
|
CustomApp customApp;
|
||||||
|
|
||||||
@@ -349,6 +356,10 @@ void DisplayManager_::generateCustomPage(String name, const char *json)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (customApp.icon)
|
||||||
|
{
|
||||||
|
customApp.icon.close();
|
||||||
|
}
|
||||||
if (LittleFS.exists("/ICONS/" + iconFileName + ".jpg"))
|
if (LittleFS.exists("/ICONS/" + iconFileName + ".jpg"))
|
||||||
{
|
{
|
||||||
customApp.isGif = false;
|
customApp.isGif = false;
|
||||||
@@ -374,6 +385,7 @@ void DisplayManager_::generateCustomPage(String name, const char *json)
|
|||||||
|
|
||||||
pushCustomApp(name, pos - 1);
|
pushCustomApp(name, pos - 1);
|
||||||
customApps[name] = customApp;
|
customApps[name] = customApp;
|
||||||
|
doc.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayManager_::generateNotification(const char *json)
|
void DisplayManager_::generateNotification(const char *json)
|
||||||
@@ -387,7 +399,7 @@ void DisplayManager_::generateNotification(const char *json)
|
|||||||
notify.rainbow = doc.containsKey("rainbow") ? doc["rainbow"].as<bool>() : false;
|
notify.rainbow = doc.containsKey("rainbow") ? doc["rainbow"].as<bool>() : false;
|
||||||
notify.hold = doc.containsKey("hold") ? doc["hold"].as<bool>() : false;
|
notify.hold = doc.containsKey("hold") ? doc["hold"].as<bool>() : false;
|
||||||
notify.pushIcon = doc.containsKey("pushIcon") ? doc["pushIcon"] : 0;
|
notify.pushIcon = doc.containsKey("pushIcon") ? doc["pushIcon"] : 0;
|
||||||
notify.flag = true;
|
|
||||||
notify.startime = millis();
|
notify.startime = millis();
|
||||||
notify.scrollposition = 9;
|
notify.scrollposition = 9;
|
||||||
notify.iconWasPushed = false;
|
notify.iconWasPushed = false;
|
||||||
@@ -446,6 +458,9 @@ void DisplayManager_::generateNotification(const char *json)
|
|||||||
notify.color = TEXTCOLOR_565;
|
notify.color = TEXTCOLOR_565;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
notify.flag = true;
|
||||||
|
showGif = false;
|
||||||
|
|
||||||
if (doc.containsKey("icon"))
|
if (doc.containsKey("icon"))
|
||||||
{
|
{
|
||||||
String iconFileName = doc["icon"].as<String>();
|
String iconFileName = doc["icon"].as<String>();
|
||||||
@@ -472,6 +487,7 @@ void DisplayManager_::generateNotification(const char *json)
|
|||||||
fs::File nullPointer;
|
fs::File nullPointer;
|
||||||
notify.icon = nullPointer;
|
notify.icon = nullPointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayManager_::loadNativeApps()
|
void DisplayManager_::loadNativeApps()
|
||||||
@@ -534,6 +550,9 @@ void DisplayManager_::setup()
|
|||||||
setMatrixLayout(MATRIX_LAYOUT);
|
setMatrixLayout(MATRIX_LAYOUT);
|
||||||
gif.setMatrix(matrix);
|
gif.setMatrix(matrix);
|
||||||
ui->setAppAnimation(SLIDE_DOWN);
|
ui->setAppAnimation(SLIDE_DOWN);
|
||||||
|
ui->setTimePerApp(TIME_PER_APP);
|
||||||
|
ui->setTimePerTransition(TIME_PER_TRANSITION);
|
||||||
|
ui->setTargetFPS(MATRIX_FPS);
|
||||||
ui->setOverlays(overlays, 4);
|
ui->setOverlays(overlays, 4);
|
||||||
setAutoTransition(AUTO_TRANSITION);
|
setAutoTransition(AUTO_TRANSITION);
|
||||||
ui->init();
|
ui->init();
|
||||||
@@ -551,7 +570,6 @@ void DisplayManager_::tick()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (ui->getUiState()->appState == IN_TRANSITION && !appIsSwitching)
|
if (ui->getUiState()->appState == IN_TRANSITION && !appIsSwitching)
|
||||||
{
|
{
|
||||||
appIsSwitching = true;
|
appIsSwitching = true;
|
||||||
@@ -565,8 +583,8 @@ void DisplayManager_::tick()
|
|||||||
}
|
}
|
||||||
int remainingTimeBudget = ui->update();
|
int remainingTimeBudget = ui->update();
|
||||||
|
|
||||||
if (showGif)
|
if (showGif && !MenuManager.inMenu)
|
||||||
gif.drawFrame(0, 0);
|
gif.drawFrame(gifX, gifY);
|
||||||
matrix->show();
|
matrix->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -645,8 +663,10 @@ void DisplayManager_::selectButtonLong()
|
|||||||
|
|
||||||
void DisplayManager_::dismissNotify()
|
void DisplayManager_::dismissNotify()
|
||||||
{
|
{
|
||||||
|
|
||||||
notify.hold = false;
|
notify.hold = false;
|
||||||
notify.flag = false;
|
notify.flag = false;
|
||||||
|
showGif = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void timerCallback()
|
void timerCallback()
|
||||||
@@ -672,7 +692,7 @@ void DisplayManager_::gererateTimer(String Payload)
|
|||||||
futureTimeinfo.tm_sec += seconds;
|
futureTimeinfo.tm_sec += seconds;
|
||||||
time_t futureTime = mktime(&futureTimeinfo);
|
time_t futureTime = mktime(&futureTimeinfo);
|
||||||
int interval = difftime(futureTime, now) * 1000;
|
int interval = difftime(futureTime, now) * 1000;
|
||||||
TimerTicker.attach_ms(interval, timerCallback);
|
TimerTicker.once_ms(interval, timerCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayManager_::switchToApp(const char *json)
|
void DisplayManager_::switchToApp(const char *json)
|
||||||
@@ -701,6 +721,7 @@ void DisplayManager_::setNewSettings(const char *json)
|
|||||||
BRIGHTNESS = doc.containsKey("brightness") ? doc["brightness"] : BRIGHTNESS;
|
BRIGHTNESS = doc.containsKey("brightness") ? doc["brightness"] : BRIGHTNESS;
|
||||||
AUTO_BRIGHTNESS = doc.containsKey("autobrightness") ? doc["autobrightness"] : AUTO_BRIGHTNESS;
|
AUTO_BRIGHTNESS = doc.containsKey("autobrightness") ? doc["autobrightness"] : AUTO_BRIGHTNESS;
|
||||||
AUTO_TRANSITION = doc.containsKey("autotransition") ? doc["autotransition"] : AUTO_TRANSITION;
|
AUTO_TRANSITION = doc.containsKey("autotransition") ? doc["autotransition"] : AUTO_TRANSITION;
|
||||||
|
UPPERCASE_LETTERS = doc.containsKey("uppercase") ? doc["uppercase"] : UPPERCASE_LETTERS;
|
||||||
applyAllSettings();
|
applyAllSettings();
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
@@ -910,7 +931,7 @@ void DisplayManager_::updateAppVector(const char *json)
|
|||||||
|
|
||||||
String DisplayManager_::getStat()
|
String DisplayManager_::getStat()
|
||||||
{
|
{
|
||||||
StaticJsonDocument<200> doc;
|
StaticJsonDocument<256> doc;
|
||||||
char buffer[5];
|
char buffer[5];
|
||||||
#ifdef ULANZI
|
#ifdef ULANZI
|
||||||
doc[BatKey] = BATTERY_PERCENT;
|
doc[BatKey] = BATTERY_PERCENT;
|
||||||
@@ -928,9 +949,9 @@ String DisplayManager_::getStat()
|
|||||||
doc[UpTimeKey] = PeripheryManager.readUptime();
|
doc[UpTimeKey] = PeripheryManager.readUptime();
|
||||||
doc[SignalStrengthKey] = WiFi.RSSI();
|
doc[SignalStrengthKey] = WiFi.RSSI();
|
||||||
doc[UpdateKey] = UPDATE_AVAILABLE;
|
doc[UpdateKey] = UPDATE_AVAILABLE;
|
||||||
|
doc["messages"] = RECEIVED_MESSAGES;
|
||||||
String jsonString;
|
String jsonString;
|
||||||
serializeJson(doc, jsonString);
|
return serializeJson(doc, jsonString), jsonString;
|
||||||
return jsonString;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayManager_::setAppTime(uint16_t duration)
|
void DisplayManager_::setAppTime(uint16_t duration)
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
static DisplayManager_ &getInstance();
|
static DisplayManager_ &getInstance();
|
||||||
bool appIsSwitching;
|
bool appIsSwitching;
|
||||||
|
bool showGif;
|
||||||
void setup();
|
void setup();
|
||||||
void tick();
|
void tick();
|
||||||
void clear();
|
void clear();
|
||||||
@@ -49,7 +50,7 @@ public:
|
|||||||
void setFPS(uint8_t);
|
void setFPS(uint8_t);
|
||||||
void MatrixState(bool);
|
void MatrixState(bool);
|
||||||
void generateNotification(const char *json);
|
void generateNotification(const char *json);
|
||||||
void generateCustomPage(String name, const char *json);
|
void generateCustomPage(const String &name, const char *json);
|
||||||
void printText(int16_t x, int16_t y, const char *text, bool centered, bool ignoreUppercase);
|
void printText(int16_t x, int16_t y, const char *text, bool centered, bool ignoreUppercase);
|
||||||
bool setAutoTransition(bool active);
|
bool setAutoTransition(bool active);
|
||||||
void switchToApp(const char *json);
|
void switchToApp(const char *json);
|
||||||
|
|||||||
@@ -509,25 +509,26 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zeichne das Bild auf die Matrix
|
int pixel, yOffset;
|
||||||
int yOffset, pixel;
|
|
||||||
for (int y = tbiImageY; y < tbiHeight + tbiImageY; y++)
|
for (int y = tbiImageY; y < tbiHeight + tbiImageY; y++)
|
||||||
{
|
{
|
||||||
yOffset = y * WIDTH;
|
yOffset = y * WIDTH;
|
||||||
for (int x = tbiImageX; x < tbiWidth + tbiImageX; x++)
|
for (int x = tbiImageX; x < tbiWidth + tbiImageX; x++)
|
||||||
{
|
{
|
||||||
pixel = imageData[yOffset + x];
|
pixel = imageData[yOffset + x];
|
||||||
if (pixel == -99)
|
if (pixel == transparentColorIndex) // Check if the pixel index is the transparent index
|
||||||
{
|
{
|
||||||
mtx->drawPixel(x + offsetX, y + offsetY, mtx->Color(0, 0, 0));
|
mtx->drawPixel(x + offsetX, y + offsetY, mtx->Color(0, 0, 0)); // Draw a black pixel
|
||||||
continue;
|
lastFrame[yOffset + x] = -99; // Save it as a special value
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
color.red = gifPalette[pixel].Red;
|
||||||
|
color.green = gifPalette[pixel].Green;
|
||||||
|
color.blue = gifPalette[pixel].Blue;
|
||||||
|
mtx->drawPixel(x + offsetX, y + offsetY, color);
|
||||||
|
lastFrame[yOffset + x] = pixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastFrame[yOffset + x] = pixel;
|
|
||||||
color.red = gifPalette[pixel].Red;
|
|
||||||
color.green = gifPalette[pixel].Green;
|
|
||||||
color.blue = gifPalette[pixel].Blue;
|
|
||||||
mtx->drawPixel(x + offsetX, y + offsetY, color);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
needNewFrame = false;
|
needNewFrame = false;
|
||||||
@@ -596,6 +597,8 @@ public:
|
|||||||
|
|
||||||
unsigned long drawFrame(int x, int y)
|
unsigned long drawFrame(int x, int y)
|
||||||
{
|
{
|
||||||
|
offsetX = x;
|
||||||
|
offsetY = y;
|
||||||
if (!file)
|
if (!file)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -607,8 +610,6 @@ public:
|
|||||||
|
|
||||||
lastFrameDrawn = false;
|
lastFrameDrawn = false;
|
||||||
|
|
||||||
offsetX = x;
|
|
||||||
offsetY = y;
|
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
while (!done)
|
while (!done)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ void loadSettings()
|
|||||||
AUTO_BRIGHTNESS = Settings.getBool("ABRI", true);
|
AUTO_BRIGHTNESS = Settings.getBool("ABRI", true);
|
||||||
TEXTCOLOR_565 = Settings.getUInt("COL", 0xFFFF);
|
TEXTCOLOR_565 = Settings.getUInt("COL", 0xFFFF);
|
||||||
AUTO_TRANSITION = Settings.getBool("TRANS", true);
|
AUTO_TRANSITION = Settings.getBool("TRANS", true);
|
||||||
TIME_PER_TRANSITION = Settings.getUInt("TSPEED", 500);
|
TIME_PER_TRANSITION = Settings.getUInt("TSPEED", 400);
|
||||||
TIME_PER_APP = Settings.getUInt("ADUR", 5000);
|
TIME_PER_APP = Settings.getUInt("ADUR", 5000);
|
||||||
TIME_FORMAT = Settings.getString("TFORMAT", "%H:%M:%S");
|
TIME_FORMAT = Settings.getString("TFORMAT", "%H:%M:%S");
|
||||||
DATE_FORMAT = Settings.getString("DFORMAT", "%d.%m.%y");
|
DATE_FORMAT = Settings.getString("DFORMAT", "%d.%m.%y");
|
||||||
@@ -135,7 +135,7 @@ IPAddress gateway;
|
|||||||
IPAddress subnet;
|
IPAddress subnet;
|
||||||
IPAddress primaryDNS;
|
IPAddress primaryDNS;
|
||||||
IPAddress secondaryDNS;
|
IPAddress secondaryDNS;
|
||||||
const char *VERSION = "0.47";
|
const char *VERSION = "0.48";
|
||||||
String MQTT_HOST = "";
|
String MQTT_HOST = "";
|
||||||
uint16_t MQTT_PORT = 1883;
|
uint16_t MQTT_PORT = 1883;
|
||||||
String MQTT_USER;
|
String MQTT_USER;
|
||||||
@@ -202,4 +202,5 @@ String BOOT_SOUND = "";
|
|||||||
uint8_t VOLUME_PERCENT;
|
uint8_t VOLUME_PERCENT;
|
||||||
uint8_t VOLUME;
|
uint8_t VOLUME;
|
||||||
int MATRIX_LAYOUT;
|
int MATRIX_LAYOUT;
|
||||||
bool UPDATE_AVAILABLE = false;
|
bool UPDATE_AVAILABLE = false;
|
||||||
|
long RECEIVED_MESSAGES;
|
||||||
@@ -72,6 +72,7 @@ extern uint8_t VOLUME_PERCENT;
|
|||||||
extern uint8_t VOLUME;
|
extern uint8_t VOLUME;
|
||||||
extern int MATRIX_LAYOUT;
|
extern int MATRIX_LAYOUT;
|
||||||
extern bool UPDATE_AVAILABLE;
|
extern bool UPDATE_AVAILABLE;
|
||||||
|
extern long RECEIVED_MESSAGES;
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
void saveSettings();
|
void saveSettings();
|
||||||
#endif // Globals_H
|
#endif // Globals_H
|
||||||
@@ -140,61 +140,72 @@ void onMqttMessage(const char *topic, const uint8_t *payload, uint16_t length)
|
|||||||
char *payloadCopy = new char[length + 1];
|
char *payloadCopy = new char[length + 1];
|
||||||
memcpy(payloadCopy, payload, length);
|
memcpy(payloadCopy, payload, length);
|
||||||
payloadCopy[length] = '\0';
|
payloadCopy[length] = '\0';
|
||||||
if (strTopic == MQTT_PREFIX + "/notify")
|
++RECEIVED_MESSAGES;
|
||||||
|
if (strTopic.equals(MQTT_PREFIX + "/notify"))
|
||||||
{
|
{
|
||||||
if (payload[0] != '{' || payload[length - 1] != '}')
|
if (payload[0] != '{' || payload[length - 1] != '}')
|
||||||
{
|
{
|
||||||
|
delete[] payloadCopy;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DisplayManager.generateNotification(payloadCopy);
|
DisplayManager.generateNotification(payloadCopy);
|
||||||
|
delete[] payloadCopy;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strTopic == MQTT_PREFIX + "/timer")
|
if (strTopic.equals(MQTT_PREFIX + "/timer"))
|
||||||
{
|
{
|
||||||
DisplayManager.gererateTimer(payloadCopy);
|
DisplayManager.gererateTimer(payloadCopy);
|
||||||
|
delete[] payloadCopy;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strTopic == MQTT_PREFIX + "/notify/dismiss")
|
if (strTopic.equals(MQTT_PREFIX + "/notify/dismiss"))
|
||||||
{
|
{
|
||||||
DisplayManager.dismissNotify();
|
DisplayManager.dismissNotify();
|
||||||
|
delete[] payloadCopy;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strTopic == MQTT_PREFIX + "/apps")
|
if (strTopic.equals(MQTT_PREFIX + "/apps"))
|
||||||
{
|
{
|
||||||
DisplayManager.updateAppVector(payloadCopy);
|
DisplayManager.updateAppVector(payloadCopy);
|
||||||
|
delete[] payloadCopy;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strTopic == MQTT_PREFIX + "/switch")
|
if (strTopic.equals(MQTT_PREFIX + "/switch"))
|
||||||
{
|
{
|
||||||
DisplayManager.switchToApp(payloadCopy);
|
DisplayManager.switchToApp(payloadCopy);
|
||||||
|
delete[] payloadCopy;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strTopic == MQTT_PREFIX + "/settings")
|
if (strTopic.equals(MQTT_PREFIX + "/settings"))
|
||||||
{
|
{
|
||||||
DisplayManager.setNewSettings(payloadCopy);
|
DisplayManager.setNewSettings(payloadCopy);
|
||||||
|
delete[] payloadCopy;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strTopic == MQTT_PREFIX + "/nextapp")
|
if (strTopic.equals(MQTT_PREFIX + "/nextapp"))
|
||||||
{
|
{
|
||||||
DisplayManager.nextApp();
|
DisplayManager.nextApp();
|
||||||
|
delete[] payloadCopy;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strTopic == MQTT_PREFIX + "/previousapp")
|
if (strTopic.equals(MQTT_PREFIX + "/previousapp"))
|
||||||
{
|
{
|
||||||
DisplayManager.previousApp();
|
DisplayManager.previousApp();
|
||||||
|
delete[] payloadCopy;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (strTopic == MQTT_PREFIX + "/doupdate")
|
if (strTopic.equals(MQTT_PREFIX + "/doupdate"))
|
||||||
{
|
{
|
||||||
if (UPDATE_AVAILABLE)
|
if (UPDATE_AVAILABLE)
|
||||||
UpdateManager.updateFirmware();
|
UpdateManager.updateFirmware();
|
||||||
|
delete[] payloadCopy;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,9 +219,9 @@ void onMqttMessage(const char *topic, const uint8_t *payload, uint16_t length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DisplayManager.generateCustomPage(topic_str, payloadCopy);
|
DisplayManager.generateCustomPage(topic_str, payloadCopy);
|
||||||
|
delete[] payloadCopy;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
delete[] payloadCopy;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onMqttConnected()
|
void onMqttConnected()
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ void BootAnimation(void *parameter)
|
|||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
loadSettings();
|
loadSettings();
|
||||||
Serial.begin(9600);
|
Serial.begin(115200);
|
||||||
PeripheryManager.setup();
|
PeripheryManager.setup();
|
||||||
delay(500);
|
delay(500);
|
||||||
ServerManager.loadSettings();
|
ServerManager.loadSettings();
|
||||||
|
|||||||
Reference in New Issue
Block a user