diff --git a/QnetITAP.cpp b/QnetITAP.cpp index 07efd32..d0472e6 100644 --- a/QnetITAP.cpp +++ b/QnetITAP.cpp @@ -247,10 +247,9 @@ void CQnetITAP::Run(const char *cfgfile) // there is something to read! unsigned char buf[100]; ssize_t len; - REPLY_TYPE rt = RT_NOTHING; if (FD_ISSET(serfd, &readfds)) { - rt = GetITAPData(buf); + REPLY_TYPE rt = GetITAPData(buf); if (rt == RT_ERROR) break; @@ -258,16 +257,6 @@ void CQnetITAP::Run(const char *cfgfile) if (rt == RT_TIMEOUT) continue; - } else if (FD_ISSET(ug2m, &readfds)) { - len = Gate2Modem.Read(buf, 100); - - if (len < 0) { - printf("ERROR: Run: recvfrom(gsock) returned error %d, %s\n", errno, strerror(errno)); - break; - } - } - - if (rt != RT_NOTHING) { lastdata = std::chrono::steady_clock::now(); //printf("read %d bytes from ITAP\n", (int)buf[0]); if (RT_DATA==rt || RT_HEADER==rt) { @@ -275,12 +264,18 @@ void CQnetITAP::Run(const char *cfgfile) break; } else { switch (rt) { - //case RT_HEADER_ACK: - // printf("DEBUG: Run: got header acknowledgement\n"); - // break; - //case RT_DATA_ACK: - // printf("DEBUG: Run: got data acknowledgement\n"); - // break; + case RT_HEADER_ACK: + printf("HEADER_ACK"); + for (int i=0; i