Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6ICRC16::reset ( P6CRC16FLAGS  flags,
P6UINT16  polynomial,
P6UINT16  initValue,
P6UINT16  finalXOR,
P6BOOL  reflected 
)
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.

Parameters
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.)
Returns
SuccessP6R::eOk 
FailureP6R::eAlreadyInitializedThe call is ignored.