From 59edf885e6b46fea5593b0d90b41553d583afa71 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 27 Oct 2016 16:37:03 -0500 Subject: [PATCH] Update serbridge.c Updates for changing/selecting telnet ports -Add function to reinit serbridge after change Telnet ports. --- serial/serbridge.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/serial/serbridge.c b/serial/serbridge.c index cebc561..ce4693f 100644 --- a/serial/serbridge.c +++ b/serial/serbridge.c @@ -469,6 +469,8 @@ serbridgeInitPins() } // 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 serbridgeInit(int port1, int port2) { @@ -501,6 +503,12 @@ serbridgeInit(int port1, int port2) 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() { return in_mcu_flashing;