I'm looking for some help please. I'm trying to communicate to a device over TCP / IP using ASCII. The protocol includes a checksum that consists of two ASCII characters that represent a two character hexadecimal number in the range 00 through FF.
I know that the hexadecimal number is generated by performing a modulo-256 10 summation of all previous characters in the frame (that is, over <STX> … <ETX>
, inclusive) and then expressing the resulting 8-bit unsigned integer in hexadecimal format.
For example I know that this checksum is 84, but how is that calculated? <STX>ID_DATA<FS><RS>aMOD<GS>LIS<GS><GS><GS><FS>iIID<GS>333<GS><GS><GS><FS><RS><ETX>84<EOT>
And that being said, what would the checksum be for this? <STX>SMP_REQ<FS><RS>aMOD<GS>LIS<GS><GS><GS><FS>iIID<GS>42731<GS><GS><GS><FS>rSEQ<GS>16<GS><GS><GS><FS><RS><ETX>{chksum}<EOT>
Any guidance is greatly appreciated? :) TIA!