This group of constants, macros, variables and functions implement the CRC support.
More...
This group of constants, macros, variables and functions implement the CRC support.
unsigned short ccitt_crc16 |
( |
unsigned char * |
message, |
|
|
short |
length |
|
) |
| |
CRC-CCITT calculation using the tabular form.
- Parameters
-
[in] | message | - the pointer to the message array. |
[in] | length | - the length of the message. |
- Returns
- the 16-bit CRC value.
char ccitt_crc16_test |
( |
unsigned char * |
message, |
|
|
short |
length |
|
) |
| |
Test the input message against its attached CRC16 code.
- Note
- Here we assume that the CRC is attached as the last two bytes of the message.
- Parameters
-
[in] | message | - pointer to the message character array |
[in] | length | - the length of the message array |
- Returns
- the result of the test.
Value | Meaning |
0 | The CRC test is failed |
1 | The CRC test is passed |
This function checks the presence of the CRC field in the CGMCP command.
The function checks the presence of CRC by checking the command length corresponding to each of the possible CGMCP operation.
- Parameters
-
[in] | pMsg | - the pointer to the CGMCP command message |
- Returns
- The result
Value | Meaning |
0 | The CRC is missing |
1 | The CRC is present |
This function checks the presence of the CRC field in the RACP command.
The function checks the presence of CRC by checking the command length corresponding to each of the possible RACP operation.
- Parameters
-
[in] | pMsg | - the pointer to the RACP command message |
- Returns
- The result
Value | Meaning |
0 | The CRC is missing |
1 | The CRC is present |