nRF5 SDK for Mesh v5.0.0
Macros | Functions

Provides support for writing lists of packed 12-bit key indexes. More...

Macros

#define PACKED_INDEX_LIST_SIZE(INDEX_COUNT)   (((INDEX_COUNT) / 2) * 3 + ((INDEX_COUNT) & 1) * 2)
 Calculates the size of a packed index list. More...
 

Functions

void packed_index_list_create (const uint16_t *restrict p_index_list, uint8_t *restrict p_packed_list, uint16_t index_count)
 Creates a packed index list. More...
 

Detailed Description

Provides support for writing lists of packed 12-bit key indexes.

Macro Definition Documentation

◆ PACKED_INDEX_LIST_SIZE

#define PACKED_INDEX_LIST_SIZE (   INDEX_COUNT)    (((INDEX_COUNT) / 2) * 3 + ((INDEX_COUNT) & 1) * 2)

Calculates the size of a packed index list.

Every pair of indexes needs 3 octets. If the number of octets is odd, the last octet needs 2 octets by itself.

Parameters
[in]INDEX_COUNTNumber of indexes that the list will contain.
Returns
The size in bytes of the packed index list with the specified number of indexes.

Definition at line 60 of file packed_index_list.h.

Function Documentation

◆ packed_index_list_create()

void packed_index_list_create ( const uint16_t *restrict  p_index_list,
uint8_t *restrict  p_packed_list,
uint16_t  index_count 
)

Creates a packed index list.

Parameters
[in]p_index_listList of indexes to pack into the output list.
[out]p_packed_listPointer to the start of a buffer where the packed index list is written. The size that this buffer must have can be obtained by using PACKED_INDEX_LIST_SIZE.
[in]index_countNumber of indexes to store in the packed index list.

Documentation feedback | Developer Zone | Subscribe | Updated