mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2025-11-28 02:30:30 -05:00
Added ability to specify static IP for WiFi STA connection
This commit is contained in:
parent
90539caee9
commit
c467b82014
4 changed files with 49 additions and 0 deletions
|
|
@ -1190,6 +1190,34 @@ void serial_callback(uint8_t sbyte) {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
} else if (command == CMD_WIFI_IP) {
|
||||
#if HAS_WIFI
|
||||
if (sbyte == FESC) { ESCAPE = true; }
|
||||
else {
|
||||
if (ESCAPE) {
|
||||
if (sbyte == TFEND) sbyte = FEND;
|
||||
if (sbyte == TFESC) sbyte = FESC;
|
||||
ESCAPE = false;
|
||||
}
|
||||
if (frame_len < CMD_L) cmdbuf[frame_len++] = sbyte;
|
||||
}
|
||||
|
||||
if (frame_len == 4) { for (uint8_t i = 0; i<4; i++) { eeprom_update(config_addr(ADDR_CONF_IP+i), cmdbuf[i]); } }
|
||||
#endif
|
||||
} else if (command == CMD_WIFI_NM) {
|
||||
#if HAS_WIFI
|
||||
if (sbyte == FESC) { ESCAPE = true; }
|
||||
else {
|
||||
if (ESCAPE) {
|
||||
if (sbyte == TFEND) sbyte = FEND;
|
||||
if (sbyte == TFESC) sbyte = FESC;
|
||||
ESCAPE = false;
|
||||
}
|
||||
if (frame_len < CMD_L) cmdbuf[frame_len++] = sbyte;
|
||||
}
|
||||
|
||||
if (frame_len == 4) { for (uint8_t i = 0; i<4; i++) { eeprom_update(config_addr(ADDR_CONF_NM+i), cmdbuf[i]); } }
|
||||
#endif
|
||||
} else if (command == CMD_BT_CTRL) {
|
||||
#if HAS_BLUETOOTH || HAS_BLE
|
||||
if (sbyte == 0x00) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue