Files
kunlun/app/smart_grid/inc/proto_crc16.h
2024-09-28 14:24:04 +08:00

49 lines
1.6 KiB
C

/****************************************************************************
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
be copied by any method or incorporated into another program without
the express written consent of Aerospace C.Power. This Information or any portion
thereof remains the property of Aerospace C.Power. The Information contained herein
is believed to be accurate and Aerospace C.Power assumes no responsibility or
liability for its use in any way and conveys no license or title under
any patent or copyright and makes no representation or warranty that this
Information is free from patent or copyright infringement.
****************************************************************************/
#ifndef PROTO_CRC16_H
#define PROTO_CRC16_H
#include "os_types_api.h"
#include "iot_utils_api.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief proto_fcs16_get_check_sum - get a CRC16 check code.
* @param data: pointer to data.
* @param len: length of the data.
* @retval: a CRC16 check code.
*/
uint16_t proto_fcs16_get_check_sum(uint8_t *data, uint16_t length);
/**
* @brief proto_fcs16_check - check a CRC16 check code.
* @param data: pointer to data.
* @param len: length of the data.
* @retval: ERR_OK -- crc16 check success.
* @retval: ERR_FAIL -- crc16 check fail.
*/
uint32_t proto_fcs16_check(uint8_t* data, uint16_t len);
#ifdef __cplusplus
}
#endif
#endif /* PROTO_CRC16_H */