Lines Matching defs:packet
142 /* Take 128 bytes of data and make a packet out of it.
144 * Each packet looks like this:
157 * start 3 bytes after the beginning of the packet to leave room for the
158 * XMODEM header. LEN is the length of the data portion of the packet (and
163 xmodem_send_packet (struct serial *desc, unsigned char *packet, int len, int hashmark)
170 /* build the packet header */
172 packet[1] = blknum;
173 packet[2] = ~blknum;
179 packet[0] = SOH;
184 packet[0] = STX;
190 /* Add ^Z padding if packet < 128 (or 1024) bytes */
192 memset (packet + 3 + len, '\026', datasize - len);
198 crc = docrc (packet + 3, datasize);
200 packet[3 + datasize] = crc >> 8;
201 packet[3 + datasize + 1] = crc;
210 sum += packet[i];
212 packet[3 + datasize] = sum; /* add the checksum */
220 serial_write (desc, packet, pktlen);