Garmin Fleet Management Controller  2.19.0
utl_crc.h
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * MODULE NAME:
4 * UTL_crc.h - CRC Routines
5 *
6 * DESCRIPTION:
7 *
8 * PUBLIC PROCEDURES:
9 * Name Title
10 * ----------------------- --------------------------------------
11 * UTL_calc_crc32 Calculate 32-bit CRC
12 *
13 * PRIVATE PROCEDURES:
14 * Name Title
15 * ----------------------- --------------------------------------
16 * UTL_accumulate_crc32 Accumulate 32-bit CRC Calculation
17 * UTL_complete_crc32 Complete 32-bit CRC Calculation
18 *
19 * LOCAL PROCEDURES:
20 * Name Title
21 * ----------------------- --------------------------------------
22 *
23 * NOTES:
24 *
25 * Copyright 2008 by Garmin Ltd. or its subsidiaries.
26 *********************************************************************/
27 
28 /*--------------------------------------------------------------------
29  GENERAL INCLUDES
30 --------------------------------------------------------------------*/
31 
32 /*--------------------------------------------------------------------
33  LITERAL CONSTANTS
34 --------------------------------------------------------------------*/
35 
36 /*--------------------------------------------------------------------
37  TYPES
38 --------------------------------------------------------------------*/
39 
40 /*--------------------------------------------------------------------
41  PROJECT INCLUDES
42 --------------------------------------------------------------------*/
43 #include "garmin_types.h"
44 /*--------------------------------------------------------------------
45  MEMORY CONSTANTS
46 --------------------------------------------------------------------*/
47 
48 /*--------------------------------------------------------------------
49  VARIABLES
50 --------------------------------------------------------------------*/
51 
52 /*--------------------------------------------------------------------
53  MACROS
54 --------------------------------------------------------------------*/
55 
56 /*--------------------------------------------------------------------
57  PROCEDURES
58 --------------------------------------------------------------------*/
59 
61  (
62  uint8 const * const data,
63  uint32 const size,
64  uint32 const initial_value = 0
65  );
66 
68  (
69  uint8 const * const data,
70  uint32 const size,
71  uint32 const accumulative_value
72  );
73 
75  (
76  uint32 const actual_crc
77  );
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.
Definition: utl_crc.cpp:78
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.
Definition: utl_crc.cpp:110
uint32 UTL_complete_crc32(uint32 const actual_crc)
Complete the 32-bit CRC calculation.
Definition: utl_crc.cpp:145
unsigned char uint8
8-bit unsigned integer
Definition: garmin_types.h:62
unsigned long int uint32
32-bit unsigned integer
Definition: garmin_types.h:66