![]() To verify the check sum of an API packet add all bytes including the checksum (do not include the delimiter and length) and if correct, the last two far right digits of the sum will equal FF. If an API data packet is composed with an incorrect checksum, the XBee/XBee-PRO Zigbee RF Module will consider the packet invalid and will ignore the data. In this case, you should only save the 8 lowest bits of the result. Online Checksum Calculator - SCADACore SCADACores Checksum Calculator can be used to verify the checksum algorithm used by field devices. 0x3B is the checksum for this data packet. To calculate the checksum of an API frame: Remove the start delimiter 0x7E and any other unnecessary bytes from the packet before adding them together (the second and third bytes). Subtract 0xC4 from 0xFF and you get 0x3B (0xFF - 0xC4 = 0x3B). Now take the result of 0x01C4 and keep only the lowest 8 bits which in this example is 0xC4 (the two far right digits). To calculate the check sum you add all bytes of the packet, excluding the frame delimiter 7E and the length (the second and third bytes):Ġx08 + 0x01 + 0x4E + 0x49 + 0x58 + 0x42 + 0x45 + 0x45 = 0x01C4 If the checksum is correct, the last two digits on the far right of the sum equal 0xFF.Ĭonsider the following sample data packet: 7E 00 08 08 01 4E 49 58 42 45 45 3B Byte(s).Add all bytes including the checksum do not include the delimiter and length.I will do both methods: Step 1a.1: I will add the first two fields (4500 + 062A). Calculate the ones complement sum of all the IPv4 headers fields: We can add all these numbers either in hex, or in binary. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |