One common format for sending data between computers for from sensors to computers is to send human-readable text strings. While it is less compact than other methods, it is easy to implement, debug and parse in any language without explanation or software decoding, and is more than adequate for moderate message lengths and data rates. A common form is seen in GPS NMEA messages. These are comma-delimited lines with the form of $ MSGTYPE,value,value,value * HH The output from the program below is: $ XY,10.1,20.0 * 03 The content is all of the characters between the $ and the * . The last two characters are a CRC checksum (cyclic redundancy code) to provide an option for the receiving device to verify the message. It is 8 bits, formatted as two hex digits. A search for the way to generate this will lead to many variations of codes. It was a long search to find a solution that actually generated the correct 8-bit code used in gps NMEA style messages. [Here is a working...
Comments