rendered paste body while ((n = myReadn (connfd, buf, 1) > 0)) { if (buf[0]!=' ') { sscanf(buf,"%c", &ch); if (buf[1]!=' ') { if (ch=='Q') return; if (ch=='H') { while ((n = myReadn (connfd, buf, sizeof (uint8_t)) > 0)) { memcpy ((void *) &byte, buf, sizeof (uint8_t)); if (byte==1 || byte==2) { memset(buf, '\0', sizeof(buf)); snprintf (buf, sizeof(buf), "?\r\n"); Writen (connfd, buf, strlen(buf)); //err_msg("Numero catturato: %d - lancio Calcolo(); \r\n", (uint8_t)byte); //calc(connfd, byte); return; } else send_err(connfd); } }else send_err(connfd); }else send_err(connfd); }else send_err(connfd); } /* while */}