From 5eba5500accd8260005395a01ea85d17a63dcc07 Mon Sep 17 00:00:00 2001 From: Jason Schmidlapp Date: Fri, 1 Apr 2016 23:01:16 -0600 Subject: [PATCH] Don't reset programming target until actual image data is received from network. Thanks! --- serial/serbridge.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/serial/serbridge.c b/serial/serbridge.c index 1e82e3d..a471f05 100644 --- a/serial/serbridge.c +++ b/serial/serbridge.c @@ -177,8 +177,11 @@ serbridgeRecvCb(void *arg, char *data, unsigned short len) (len == 2 && strncmp(data, "?\n", 2) == 0) || (len == 3 && strncmp(data, "?\r\n", 3) == 0)) { startPGM = true; - conn->conn_mode = cmPGM; + // Don't actually reboot the target until we've actually received + // serial data to send to the target. + conn->conn_mode = cmPGMInit; + return; // If the connection starts with a telnet negotiation we will do telnet } else if (len >= 3 && strncmp(data, (char[]){IAC, WILL, ComPortOpt}, 3) == 0) {