|
pure virtual |
To reuse this object either with the same or different polynomial this function must be called.
This function will reset the CRC computation back to its starting state.
In most cases, the caller will simply set the parameter useDefaults to P6TRUE and be done. The result is that the CCITT CRC16 polynomial is used. However, if the caller wishes to use another 16 bit polynomial then the remaining parameters must be set. The description of the polynomial should define how the remaining parameters are to be set.
flags | [ in ] valid flags { P6CRC16_NOFLAGS | P6CRC16_USEDEFAULTS } |
polynomial | [ in ] hexadecimal representation of the desired polynomial, for example * 16 12 5 16
* X + X + X + 1 is represented as 0x1021, where X is assumed and the
* remaining coefficients are ones in the number:
* 12 11 10 98 7654 3210
* 0001 0 0 00 0010 0001 (bits 12, 5, and 0 are set to 1).
*
|
initValue | [ in ] hexadecimal value, initialize the CRC register with this value |
finalXOR | [ in ] hexadecimal value, XOR this value with the final computed CRC value |
reflected | [ in ] Some polynomials require the CRC shift register to shift bits right instead of left. To do this requires the reflected algorthm to be on (e.g., CRC32 uses this mode.) |
Success | P6R::eOk | |
Failure | P6R::eAlreadyInitialized | The call is ignored. |