69: {
70: while (inputByte(IDLE_TMO) >= 0);
71: }
78:
79: while ((c = inputByte(0)) < 0);
80: return (c == CTLC || c == CAN) ? E_CANCEL : c;
96: outputByte(NAK);
97: c = inputByte(SOH1_TMO);
98: ctlch = -1;
108: // leading letter in the ack is extracted
109: c = inputByte(SOH_TMO);
110: }
115: // Is CAN followed by another CAN?
116: c = inputByte(IDLE_TMO);
117: if (c < 0 || c == CAN || c == CTLC)
127: // read a block number & check
128: if ((i = inputByte(RECV_TMO)) < 0) continue;
129: if ((c = inputByte(RECV_TMO)) < 0) continue;
130: if (i + c != 0xff) continue;
139: for (cksum = 0, i = 0; i < blksz; i++) {
140: if ((c = inputByte(RECV_TMO)) < 0) break;
141: cksum += (blkbuf[i] = c);
145: // validate checksum
146: if (inputByte(RECV_TMO) == cksum && ctlch != ACK) break;
147: }