bugfix rcommand.cpp (illegal commands chrash)
This commit is contained in:
parent
c1389427a1
commit
f659d18390
@ -138,7 +138,7 @@ void set_loraadr(uint8_t val[]) {
|
|||||||
ESP_LOGI(TAG, "Remote command: set LoRa ADR mode to %s",
|
ESP_LOGI(TAG, "Remote command: set LoRa ADR mode to %s",
|
||||||
val[0] ? "on" : "off");
|
val[0] ? "on" : "off");
|
||||||
cfg.adrmode = val[0] ? 1 : 0;
|
cfg.adrmode = val[0] ? 1 : 0;
|
||||||
LMIC_setAdrMode(cfg.adrmode);
|
LMIC_setAdrMode(cfg.adrmode);
|
||||||
#else
|
#else
|
||||||
ESP_LOGW(TAG, "Remote command: LoRa not implemented");
|
ESP_LOGW(TAG, "Remote command: LoRa not implemented");
|
||||||
#endif // HAS_LORA
|
#endif // HAS_LORA
|
||||||
@ -267,10 +267,11 @@ void rcommand(uint8_t cmd[], uint8_t cmdlength) {
|
|||||||
TAG,
|
TAG,
|
||||||
"Remote command x%02X called with missing parameter(s), skipped",
|
"Remote command x%02X called with missing parameter(s), skipped",
|
||||||
table[i].opcode);
|
table[i].opcode);
|
||||||
break; // exit table lookup loop, command was found
|
break; // command found -> exit table lookup loop
|
||||||
} // command validation
|
} // end of command validation
|
||||||
} // command table lookup loop
|
} // end of command table lookup loop
|
||||||
|
if (i < 0) // command not found -> exit parser
|
||||||
|
break;
|
||||||
} // command parsing loop
|
} // command parsing loop
|
||||||
|
|
||||||
if (storeflag)
|
if (storeflag)
|
||||||
|
Loading…
Reference in New Issue
Block a user