1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
3 * The information contained herein is property of Nordic Semiconductor ASA.
4 * Terms and conditions of usage are described in detail in NORDIC
5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
7 * Licensees are granted free, non-transferable use of the information. NO
8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
15 * @defgroup crc_compute CRC compute
17 * @ingroup hci_transport
19 * @brief This module implements the CRC-16 calculation in the blocks.
31 /**@brief Function for calculating CRC-16 in blocks.
33 * Feed each consecutive data block into this function, along with the current value of p_crc as
34 * returned by the previous call of this function. The first call of this function should pass NULL
35 * as the initial value of the crc in p_crc.
37 * @param[in] p_data The input data block for computation.
38 * @param[in] size The size of the input data block in bytes.
39 * @param[in] p_crc The previous calculated CRC-16 value or NULL if first call.
41 * @return The updated CRC-16 value, based on the input supplied.
43 uint16_t crc16_compute(const uint8_t * p_data, uint32_t size, const uint16_t * p_crc);