Update serbridge.c

Updates for changing/selecting telnet ports
-Add function to reinit serbridge after change Telnet ports.
pull/205/head
Alex 8 years ago committed by GitHub
parent f315385534
commit 59edf885e6
  1. 8
      serial/serbridge.c

@ -469,6 +469,8 @@ serbridgeInitPins()
} }
// Start transparent serial bridge TCP server on specified port (typ. 23) // Start transparent serial bridge TCP server on specified port (typ. 23)
// Here is where we need to change the ports. But how do we do this from the Ajax call?
void ICACHE_FLASH_ATTR void ICACHE_FLASH_ATTR
serbridgeInit(int port1, int port2) serbridgeInit(int port1, int port2)
{ {
@ -501,6 +503,12 @@ serbridgeInit(int port1, int port2)
espconn_regist_time(&serbridgeConn2, SER_BRIDGE_TIMEOUT, 0); espconn_regist_time(&serbridgeConn2, SER_BRIDGE_TIMEOUT, 0);
} }
//Reinit serial bridge after changing telnet ports
serbridgeReinit()
{
serbridgeInit(flashConfig.telnet_port1, flashConfig.telnet_port2);
}
int ICACHE_FLASH_ATTR serbridgeInMCUFlashing() int ICACHE_FLASH_ATTR serbridgeInMCUFlashing()
{ {
return in_mcu_flashing; return in_mcu_flashing;

Loading…
Cancel
Save