Garmin Fleet Management Controller  2.19.0
utl_crc.h File Reference
#include "garmin_types.h"

Go to the source code of this file.

Functions

uint32 UTL_accumulate_crc32 (uint8 const *const data, uint32 const size, uint32 const accumulative_value)
 Accumulate the 32-bit CRC for a block of data. More...
 
uint32 UTL_calc_crc32 (uint8 const *const data, uint32 const size, uint32 const initial_value=0)
 Compute and finalize a 32-bit in one shot. More...
 
uint32 UTL_complete_crc32 (uint32 const actual_crc)
 Complete the 32-bit CRC calculation. More...
 

Function Documentation

uint32 UTL_accumulate_crc32 ( uint8 const *const  data,
uint32 const  size,
uint32 const  accumulative_value 
)

Accumulate the 32-bit CRC for a block of data.

This form should be used when computing the CRC32 for data that spans multiple buffers. To use, call this function for each block of data, passing the returned value from one call as the accumulative_value for the next call. Finally, call UTL_complete_crc32 to finalize the value.

Parameters
dataThe array of data bytes to accumulate the CRC32 for.
sizeThe number of bytes in data
accumulative_valueThe accumulated CRC32 returned by the last call.
Returns
The accumulated CRC32 checksum.

Definition at line 110 of file utl_crc.cpp.

References my_crc32_tbl, and UTL_complete_crc32().

Referenced by UTL_calc_crc32().

uint32 UTL_calc_crc32 ( uint8 const *const  data,
uint32 const  size,
uint32 const  initial_value 
)

Compute and finalize a 32-bit in one shot.

Parameters
dataThe array of data bytes to compute the CRC32 for.
sizeThe number of bytes in data
initial_valueThe initial value of the CRC32, normally 0.
Returns
The CRC32 checksum of data.

Definition at line 78 of file utl_crc.cpp.

References UTL_accumulate_crc32(), and UTL_complete_crc32().

Referenced by FmiApplicationLayer::rx().

uint32 UTL_complete_crc32 ( uint32 const  actual_crc)

Complete the 32-bit CRC calculation.

This form should be used when computing the CRC32 for data that spans multiple buffers. To use, call this function for each block of data, passing the returned value from one call as the accumulative_value for the next call. Finally, call UTL_complete_crc32 to finalize the value.

Parameters
actual_crcThe accumulated CRC from the last call to UTL_accumulate_crc32()
Returns
The CRC32 checksum.

Definition at line 145 of file utl_crc.cpp.

Referenced by UTL_accumulate_crc32(), and UTL_calc_crc32().