CGM Simulator  0.1.3
A CGM simulator to demonstrate the BLE CGM profile v1.1
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
crc.h
Go to the documentation of this file.
1 
15 #ifndef _CRC16_
16 #define _CRC16_
17 
18 
19 /*
20  @brief CRC-CITT calculation using the tabular form.
21  @param [in] message - the pointer to the message array.
22  @param [in] length - the length of the message.
23  @return the 16-bit CRC value.*/
24 unsigned short ccitt_crc16 (unsigned char * message,short length);
25 /*
26  * @brief Test the input message against its attached CRC16 code.
27  * @note Here we assume that the CRC is attached as the last two bytes of the message.
28  * @param [in] message - pointer to the message character array
29  * @param [in] length - the length of the message array
30  * @return the result of the test.
31  * <table><th><td>Value</td><td>Meaning</td></th>
32  * <tr><td>0</td><td>The CRC test is failed</td></tr>
33  * <tr><td>1</td><td>The CRC test is passed</td></tr>
34  * </table>*/
35 char ccitt_crc16_test(unsigned char *message,short length);
36 #endif
unsigned short ccitt_crc16(unsigned char *message, short length)
CRC-CCITT calculation using the tabular form.
Definition: crc.c:27
char ccitt_crc16_test(unsigned char *message, short length)
Test the input message against its attached CRC16 code.
Definition: crc.c:82