Open main menu

Changes

====Checksum====
----
<pre>uint16_t Landis_crc16 (uint16_t crc, const std::vector<uint8_t> &data, size_t size) {<br>// CoServ CRC = 0x45F8<br>// Oncor CRC = 0x5FD6<br>// Hard coded Poly 0x1021<br>    uint16_t i = 0;<br>
    while (size--) {       
crc ^= data[i] << 8; i++; for (unsigned k = 0; k < 8; k++) crc = crc & 0x8000 ? (crc << 1) ^ 0x1021 : crc << 1;     
    }     
return crc;
}</pre>
----<br />