nrfxlib API 3.3.99
Loading...
Searching...
No Matches

◆ nrf_802154_bsmap_rec_write()

bool nrf_802154_bsmap_rec_write ( nrf_802154_bsmap_t * p_bsmap,
const void * p_key,
const void * p_value,
void * p_aux_memory )

Write a record associated with a key into the BSMAP.

If the key is not found in the BSMAP, a new entry is inserted into the BSMAP with provided key and value. If the key is found in the BSMAP, the value associated with the key is updated with the provided value.

This function is optimized for low priority execution. It is thread-safe with respect to high priority lookups performed by the nrf_802154_bsmap_rec_get function. This function is not thread-safe with respect to itself or nrf_802154_bsmap_rec_delete.

Parameters
[in]p_bsmapPointer to the BSMAP object to write to.
[in]p_keyPointer to the key to write. Must not be NULL.
[in]p_valuePointer to the value to write. If the BSMAP is initialized with value_size equal to 0, this parameter is ignored and can be NULL. Otherwise this parameter must not be NULL and must point to a storage containing value_size bytes as passed to the nrf_802154_bsmap_init function.
[in]p_aux_memoryPointer to an auxiliary memory storage used during modification. It must be able to store NRF_802154_BSMAP_AUX_MEMORY_SIZE bytes.
Return values
trueIf the record was successfully written to the BSMAP.
falseIf the record was not written to the BSMAP because BSMAP is full.