Researching a Communication Driver Protocol

A communication driver cannot be written without a full understanding of the protocol that the I/O device uses to communicate. A document that completely describes the protocol must be located, or the device must be reverse-engineered by monitoring communications and experimenting with the inputs and outputs. At a minimum, you will need to know:

  • The structure of the messages the I/O device sends and receives.
  • The valid values for each component of the message.
  • The format that the device expects the data to be in.
  • Error detection and correction procedures, if used.
  • If a checksum or cyclic redundancy check (CRC) is included in the message, the algorithm that is used to calculate it must be known.

Also, some protocols will define an "end of message" character to indicate the end of the packet. In other protocols, the messages are fixed length, and the length of the packet is either a constant or is indicated as part of the header. You cannot proceed without knowing this structure.