Lines Matching defs:checksum
28 * checksum. A packet consists of $\<packet info\>#\<checksum\> where:
31 * - \<checksum\> :: two hex digits computed as mod-256 sum of \<packet info\>
191 * Scans input for the sequence $\<packet info\>#\<checksum\>. If the
192 * checksum is valid, acknowledges it to the sender and returns the buffer.
198 uint8_t checksum, xmitcsum;
207 checksum = 0;
216 break; // found start of checksum
218 checksum += ch;
231 if (checksum != xmitcsum) {
232 DEBUG("bad checksum. My count=0x%x, sent=0x%x. buf='%s'",
233 checksum, xmitcsum, buffer);
234 myputchar('-'); // failed checksum
243 /** \brief Send the packet in the buffer, adding a checksum.
245 * Sends the packet, using the format: $\<packet info\>#\<checksum\>.
251 uint8_t checksum = 0;
257 checksum += ch;
261 myputchar(tohex(checksum >> 4)); // top bits of checksum
262 myputchar(tohex(checksum & 0xf)); // bottom bits of checksum