This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

求解答 串口命令



To issue a read command, the host must perform the following steps:
1. Host sends four Start bytes
2. Host sends the Checksum byte.
3. Host sends the Flags byte, where:
• Bit 6 is set to 0x1 to indicate the host wants a reply from the device.
• Bit 7 is set to 0x1 to indicate a read transaction.
4. Host sends the Sequence byte. When a single command is more than 64 bytes, it is sent as multiple
USB packets and the sequence byte is used to number the packets so the device can assemble them
in the right sequence. Otherwise, this value is irrelevant and generally set to 0.
5. Host sends two bytes with the length of the data packet. This length denotes the number of data bytes
in the packet and excludes the number of bytes in steps 1 through 4. It denotes the total number of
bytes sent in steps 5 (command bytes) and 6 (data bytes).
6. Host sends two Command bytes: Command Byte 0 and Command Byte 1.
7. Host sends data appropriate to command.
8. Host sends four Trailer bytes.
9. After completion of this command, DLP NIRscan Nano responds with a packet that includes:
(a) Byte with the command requested by the host (the matching Sequence byte)
(b) Length of the data packet
(c) Data requested

求解释 步骤4 5 6