Reading Binary file to find Checksum
Okay here's the deal. I have a binary file that I need to read in and check the checksum.
The file lays out as follows:
Sync 0x16, SOH 0x1, Address, STX 0x2, Data, ETX 0x3, Checksum, EOT 0x4
There are a few different sets of Data in the file so the actual checksum comparison will take place inside of an IF statement based on the Address. It's sort of like an email thing.
Anyway I need to know how to go about figuring the checksum and comparing it to the sent checksum.