| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Modules | Functions
CRC16 compute
HCI Transport

This module implements CRC-16-CCITT (polynomial 0x1021) with 0xFFFF initial value. The data can be passed in multiple blocks. More...

## Modules
| CRC16 calculation routines configuration

## Functions
uint16_t | crc16_compute (uint8_t const *p_data, uint32_t size, uint16_t const *p_crc)
| Function for calculating CRC-16 in blocks. More...

## Detailed Description

This module implements CRC-16-CCITT (polynomial 0x1021) with 0xFFFF initial value. The data can be passed in multiple blocks.

## Function Documentation

uint16_t crc16_compute | ( | uint8_t const * | p_data,
|  | uint32_t | size,
|  | uint16_t const * | p_crc
| ) |  |

Function for calculating CRC-16 in blocks.

Feed each consecutive data block into this function, along with the current value of p_crc as returned by the previous call of this function. The first call of this function should pass NULL as the initial value of the crc in p_crc.

Parameters

  [in] | p_data | The input data block for computation.
  [in] | size | The size of the input data block in bytes.
  [in] | p_crc | The previous calculated CRC-16 value or NULL if first call.

Returns
  The updated CRC-16 value, based on the input supplied.