下面是BOOTLOADER中的部分内容
Communication safety
All communications from the programming tool (PC) to the device are verified by:
1. checksum: all received bytes are XORed. A byte containing the computed XOR of all
previous bytes is added to the end of each communication (checksum byte). By
XORing all received bytes, data + checksum, the result at the end of the packet must
be 0x00.
2. for each command the host sends a byte and its complement (XOR = 0x00)
3. UART: parity check active (even parity)
第二条我不太明白:是不是命令的代码和它的complement相异或?要是这样的话,入命令GET,他的代码是0x00,它的complement是0xFF,这样0x00和0xFF异或结果不是0呀? |