src.dualinventive.com/jjacobs/dinetrpcll-sniffer/libdi/include/di/drv/xbee/checksum.h

44 lines
993 B
C

/**
* @file include/di/drv/xbee/checksum.h
* @ingroup XBee
* @brief DI XBee checksum functions.
* @date March 30, 2017
* @author svlies
* @copyright 2017 Dual Inventive Technology Centre B.V.
*
* DI XBee checksum functions.
* @{
*/
#ifndef LIBDI_INCLUDE_DI_DRV_XBEE_CHECKSUM_H_
#define LIBDI_INCLUDE_DI_DRV_XBEE_CHECKSUM_H_
#include <di/buffer.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Check if reveived frame in ctx buffer is correct.
* @param buf Buffer with the frame to verify.
* @return Returns DNOK if XBee frame is correct.
*/
di_errno_t di_drv_xbee_checksum_verify(struct di_buffer *buf);
/**
* Generates a checksum for the data in the buffer.
* @param buf Buffer with the frame the make a checksum.
* @param size Size of the buffer.
* @return Returns the checksum of the data in the buffer.
*/
uint8_t di_drv_xbee_checksum_calc(const uint8_t *buf, size_t size);
#ifdef __cplusplus
}
#endif
/** @} */
#endif /* LIBDI_INCLUDE_DI_DRV_XBEE_CHECKSUM_H_ */