Browse Source

Merge pull request #903 from mcspr/embedis-get

Customize GET terminal command
fastled^2
Xose Pérez 6 years ago
committed by GitHub
parent
commit
d6d1605516
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 1 deletions
  1. +21
    -1
      code/espurna/settings.ino

+ 21
- 1
code/espurna/settings.ino View File

@ -151,7 +151,7 @@ void _settingsKeysCommand() {
DEBUG_MSG_P(PSTR("Current settings:\n")); DEBUG_MSG_P(PSTR("Current settings:\n"));
for (unsigned int i=0; i<keys.size(); i++) { for (unsigned int i=0; i<keys.size(); i++) {
String value = getSetting(keys[i]); String value = getSetting(keys[i]);
DEBUG_MSG_P(PSTR("> %s => %s\n"), (keys[i]).c_str(), value.c_str());
DEBUG_MSG_P(PSTR("> %s => \"%s\"\n"), (keys[i]).c_str(), value.c_str());
} }
unsigned long freeEEPROM = SPI_FLASH_SEC_SIZE - settingsSize(); unsigned long freeEEPROM = SPI_FLASH_SEC_SIZE - settingsSize();
@ -251,6 +251,26 @@ void _settingsInitCommands() {
DEBUG_MSG_P(PSTR("+OK\n")); DEBUG_MSG_P(PSTR("+OK\n"));
}); });
settingsRegisterCommand(F("GET"), [](Embedis* e) {
if (e->argc < 2) {
DEBUG_MSG_P(PSTR("-ERROR: Wrong arguments\n"));
return;
}
for (unsigned char i = 1; i < e->argc; i++) {
String key = String(e->argv[i]);
String value;
if (!Embedis::get(key, value)) {
DEBUG_MSG_P(PSTR("> %s =>\n"), key.c_str());
continue;
}
DEBUG_MSG_P(PSTR("> %s => \"%s\"\n"), key.c_str(), value.c_str());
}
DEBUG_MSG_P(PSTR("+OK\n"));
});
#if WEB_SUPPORT #if WEB_SUPPORT
settingsRegisterCommand(F("RELOAD"), [](Embedis* e) { settingsRegisterCommand(F("RELOAD"), [](Embedis* e) {
wsReload(); wsReload();


Loading…
Cancel
Save