Landis+Gyr GridStream Protocol: Difference between revisions

Line 127: Line 127:
====Checksum====
====Checksum====
----
----
C++ source code below used to calculate the CRC, different providers use a different initial CRC value. Assume this is to segment traffic, unsure if Routers/Collectors are shared by different providers to return traffic or not.
<syntaxhighlight lang="c++">
<syntaxhighlight lang="c++">
uint16_t Landis_crc16 (uint16_t crc, const std::vector<uint8_t> &data, size_t size) {  
uint16_t Landis_crc16 (uint16_t crc, const std::vector<uint8_t> &data, size_t size) {