From d0925023e21397e15d151af746f9f370cc41765a Mon Sep 17 00:00:00 2001 From: Torsten Stauder Date: Sat, 13 Feb 2021 22:15:03 +0100 Subject: [PATCH] Added new mod-card: enable FTP-server --- html/management.html | 1 + src/HTMLmanagement.h | 1 + src/main.cpp | 36 +++++++++++++++++++++++++----------- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/html/management.html b/html/management.html index 296ef23..4104d41 100644 --- a/html/management.html +++ b/html/management.html @@ -228,6 +228,7 @@ +
diff --git a/src/HTMLmanagement.h b/src/HTMLmanagement.h index f7bc14b..65b6c81 100644 --- a/src/HTMLmanagement.h +++ b/src/HTMLmanagement.h @@ -228,6 +228,7 @@ static const char management_HTML[] PROGMEM = "\ \ \ \ + \ \ \
\ diff --git a/src/main.cpp b/src/main.cpp index b9aae47..4ae80ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -144,6 +144,7 @@ char *logBuf = (char*) calloc(serialLoglength, sizeof(char)); // Buffer for all #define DIMM_LEDS_NIGHTMODE 120 // Changes LED-brightness #define TOGGLE_WIFI_STATUS 130 // Toggles WiFi-status #define TOGGLE_BLUETOOTH_MODE 140 // Toggles Normal/Bluetooth Mode +#define ENABLE_FTP_SERVER 150 // Enables FTP-server // Repeat-Modes #define NO_REPEAT 0 // No repeat @@ -2912,24 +2913,37 @@ void doRfidCardModifications(const uint32_t mod) { break; #ifdef BLUETOOTH_ENABLE - case TOGGLE_BLUETOOTH_MODE: - if (readOperationModeFromNVS() == OPMODE_NORMAL) { - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif - setOperationMode(OPMODE_BLUETOOTH); - } else if (readOperationModeFromNVS() == OPMODE_BLUETOOTH) { + case TOGGLE_BLUETOOTH_MODE: + if (readOperationModeFromNVS() == OPMODE_NORMAL) { + #ifdef NEOPIXEL_ENABLE + showLedOk = true; + #endif + setOperationMode(OPMODE_BLUETOOTH); + } else if (readOperationModeFromNVS() == OPMODE_BLUETOOTH) { + #ifdef NEOPIXEL_ENABLE + showLedOk = true; + #endif + setOperationMode(OPMODE_NORMAL); + } else { + #ifdef NEOPIXEL_ENABLE + showLedError = true; + #endif + } + break; + #endif + case ENABLE_FTP_SERVER: + if (!ftpEnableLastStatus && !ftpEnableCurrentStatus) { + ftpEnableLastStatus = true; #ifdef NEOPIXEL_ENABLE showLedOk = true; #endif - setOperationMode(OPMODE_NORMAL); } else { - #ifdef NEOPIXEL_ENABLE + #ifdef NEOPIXEL_ENABLE showLedError = true; #endif } - break; - #endif + + break; default: snprintf(logBuf, serialLoglength, "%s %d !", (char *) FPSTR(modificatorDoesNotExist), mod); loggerNl(serialDebug, logBuf, LOGLEVEL_ERROR);