Functions for managing the set of addresses known to the device. More...
Functions | |
uint32_t | dsm_address_publish_add (uint16_t raw_address, dsm_handle_t *p_address_handle) |
Adds an address to the DSM to be used as a publish address. More... | |
uint32_t | dsm_address_publish_add_handle (dsm_handle_t address_handle) |
Adds a publication to an existing address handle. More... | |
uint32_t | dsm_address_publish_virtual_add (const uint8_t *p_label_uuid, dsm_handle_t *p_address_handle) |
Adds a virtual address to the DSM to be used as a publish address. More... | |
uint32_t | dsm_address_publish_remove (dsm_handle_t address_handle) |
Removes an address that has been used as a publish address. More... | |
uint32_t | dsm_local_unicast_addresses_set (const dsm_local_unicast_address_t *p_address) |
Set the unicast addresses of the device. More... | |
void | dsm_local_unicast_addresses_get (dsm_local_unicast_address_t *p_address) |
Get the local unicast address range of the device. More... | |
uint32_t | dsm_address_subscription_add (uint16_t raw_address, dsm_handle_t *p_address_handle) |
Adds the specified address to the global subscription list. More... | |
uint32_t | dsm_address_subscription_virtual_add (const uint8_t *p_label_uuid, dsm_handle_t *p_address_handle) |
Adds the specified virtual address to the global subscription list. More... | |
uint32_t | dsm_address_subscription_add_handle (dsm_handle_t address_handle) |
Adds a subscription to an existing address handle. More... | |
_DEPRECATED bool | dsm_address_subscription_get (dsm_handle_t address_handle) |
Returns whether the given address_handle is in the global subscription list. More... | |
_DEPRECATED bool | dsm_address_is_rx (const nrf_mesh_address_t *p_addr) |
Returns whether the device will process packets received on the given destination address. More... | |
uint32_t | dsm_address_subscription_count_get (dsm_handle_t address_handle, uint16_t *p_count) |
Returns the number of subscriptions registered for an address in the global subscription list. More... | |
uint32_t | dsm_address_subscription_remove (dsm_handle_t address_handle) |
Removes the given address_handle from the global subscription list. More... | |
uint32_t | dsm_address_get (dsm_handle_t address_handle, nrf_mesh_address_t *p_address) |
Retrieves the address for a given address handle and fills out the given nrf_mesh_address_t structure. More... | |
uint32_t | dsm_address_get_all (dsm_handle_t *p_address_handle_list, uint32_t *p_count) |
Get a list of all address handles in the address pool. More... | |
uint32_t | dsm_address_handle_get (const nrf_mesh_address_t *p_address, dsm_handle_t *p_address_handle) |
Retrieves the address handle for a given nrf_mesh_address_t structure. More... | |
Functions for managing the set of addresses known to the device.
uint32_t dsm_address_publish_add | ( | uint16_t | raw_address, |
dsm_handle_t * | p_address_handle | ||
) |
Adds an address to the DSM to be used as a publish address.
This address can be either a unicast or a group address.
[in] | raw_address | The address to add to the device. |
[out] | p_address_handle | Pointer to a variable where the handle assigned to this address is stored. |
NRF_SUCCESS | The address was successfully added. |
NRF_ERROR_INVALID_PARAM | The address provided was not a unicast or group address. |
NRF_ERROR_NULL | The p_address_handle parameter was NULL. |
uint32_t dsm_address_publish_add_handle | ( | dsm_handle_t | address_handle | ) |
Adds a publication to an existing address handle.
[in] | address_handle | handle of the address. |
NRF_SUCCESS | The publication was successfully added to the address. |
NRF_ERROR_NOT_FOUND | The handle did not point to a previously added address. |
uint32_t dsm_address_publish_virtual_add | ( | const uint8_t * | p_label_uuid, |
dsm_handle_t * | p_address_handle | ||
) |
Adds a virtual address to the DSM to be used as a publish address.
[in] | p_label_uuid | Pointer to the start of the virtual address label UUID. |
[out] | p_address_handle | Pointer to a variable where the handle assigned to this address is stored. |
NRF_SUCCESS | The address was successfully added. |
NRF_ERROR_NULL | The p_address_handle parameter was NULL. |
NRF_ERROR_NO_MEM | The address could not be added due to resource constraints. |
uint32_t dsm_address_publish_remove | ( | dsm_handle_t | address_handle | ) |
Removes an address that has been used as a publish address.
[in] | address_handle | Handle of the address to remove. |
NRF_SUCCESS | The address was successfully removed. |
NRF_ERROR_NOT_FOUND | The address_handle was not pointing to a valid address. |
uint32_t dsm_local_unicast_addresses_set | ( | const dsm_local_unicast_address_t * | p_address | ) |
Set the unicast addresses of the device.
[in] | p_address | The unicast addresses to assign to this device. |
NRF_SUCCESS | The addresses has been successfully assigned. |
NRF_ERROR_FORBIDDEN | The unicast addresses have been set once before, and the device state must be reset before they can be changed again. |
NRF_ERROR_INVALID_DATA | The given address range is invalid or it overlaps with non-unicast type addresses. |
void dsm_local_unicast_addresses_get | ( | dsm_local_unicast_address_t * | p_address | ) |
Get the local unicast address range of the device.
[out] | p_address | Returns the unicast addresses assigned to this device. |
uint32_t dsm_address_subscription_add | ( | uint16_t | raw_address, |
dsm_handle_t * | p_address_handle | ||
) |
Adds the specified address to the global subscription list.
This function can only be called for group addresses.
[in] | raw_address | The raw 16-bit address to subscribe to. |
[out] | p_address_handle | Pointer to a variable where the handle of the address is stored. |
NRF_SUCCESS | The given address has been successfully added to the global subscription list. |
NRF_ERROR_INVALID_PARAM | The provided address handle does not represent a group address. |
NRF_ERROR_NO_MEM | The rx list for group addresses is full, DSM_SUBS_LIST_MAX . |
NRF_ERROR_NOT_FOUND | The given address handle does not represent a valid address. |
uint32_t dsm_address_subscription_virtual_add | ( | const uint8_t * | p_label_uuid, |
dsm_handle_t * | p_address_handle | ||
) |
Adds the specified virtual address to the global subscription list.
[in] | p_label_uuid | Pointer to the start of the virtual address label UUID. |
[out] | p_address_handle | Pointer to a variable where the handle assigned to this address is stored. |
NRF_SUCCESS | The specified address has been successfully added to the global subscription list. |
NRF_ERROR_NO_MEM | The list of RX addresses is full, DSM_SUBS_LIST_MAX . |
uint32_t dsm_address_subscription_add_handle | ( | dsm_handle_t | address_handle | ) |
Adds a subscription to an existing address handle.
[in] | address_handle | handle of the address. |
NRF_SUCCESS | The subscription was successfully added to the address. |
NRF_ERROR_NOT_FOUND | The handle did not point to a previously added address. |
_DEPRECATED bool dsm_address_subscription_get | ( | dsm_handle_t | address_handle | ) |
Returns whether the given address_handle is in the global subscription list.
[in] | address_handle | The reserved handle of the address. |
_DEPRECATED bool dsm_address_is_rx | ( | const nrf_mesh_address_t * | p_addr | ) |
Returns whether the device will process packets received on the given destination address.
[in] | p_addr | The raw address to check for. |
uint32_t dsm_address_subscription_count_get | ( | dsm_handle_t | address_handle, |
uint16_t * | p_count | ||
) |
Returns the number of subscriptions registered for an address in the global subscription list.
[in] | address_handle | The reserved handle of the address. |
[out] | p_count | A pointer to a variable where the subscription count is stored. |
NRF_SUCCESS | The subscription count was successfully returned. |
NRF_ERROR_NOT_FOUND | The address was not found in the address list. |
NRF_ERROR_NULL | The p_count parameter was NULL . |
uint32_t dsm_address_subscription_remove | ( | dsm_handle_t | address_handle | ) |
Removes the given address_handle from the global subscription list.
This function can only be called for group and virtual addresses. The address will only be removed from the rx list, but it will still be available in the relevant address list. Therefore, after the removal a valid address can still be retreived with the same handle.
[in] | address_handle | The reserved handle of the address. |
NRF_SUCCESS | The given address has been successfully removed from the rx list. |
NRF_ERROR_FORBIDDEN | Unicast addresses can't be removed from the rx list. |
NRF_ERROR_NOT_FOUND | The given address handle does not exist in the subscription lists. |
uint32_t dsm_address_get | ( | dsm_handle_t | address_handle, |
nrf_mesh_address_t * | p_address | ||
) |
Retrieves the address for a given address handle and fills out the given nrf_mesh_address_t structure.
[in] | address_handle | The reserved handle of the address. |
[in,out] | p_address | The address retrieved via the given address_handle . |
NRF_SUCCESS | An address has been found and returned via the p_address . |
NRF_ERROR_NULL | Unexpected NULL pointer is given. |
NRF_ERROR_NOT_FOUND | The given address handle does not exist in the subscription lists. |
uint32_t dsm_address_get_all | ( | dsm_handle_t * | p_address_handle_list, |
uint32_t * | p_count | ||
) |
Get a list of all address handles in the address pool.
[in,out] | p_address_handle_list | Pointer to the array for storing all the address handles. |
[in,out] | p_count | The size of the p_address_handle_list array. Will be changed to the number of address handles returned via the p_address_handle_list . |
NRF_SUCCESS | The p_address_handle_list has been successfully populated by all known address handles. |
NRF_ERROR_NULL | An unexpected NULL pointer is given. |
NRF_ERROR_INVALID_LENGTH | The p_address_handle_list is not large enough to store all address handles, so only a partial list (the first *p_count indices) is returned. |
uint32_t dsm_address_handle_get | ( | const nrf_mesh_address_t * | p_address, |
dsm_handle_t * | p_address_handle | ||
) |
Retrieves the address handle for a given nrf_mesh_address_t structure.
[in] | p_address | The address. |
[in,out] | p_address_handle | The address handle retrieved via the given p_address . |
NRF_SUCCESS | An address has been found and returned via the p_address . |
NRF_ERROR_NULL | Unexpected NULL pointer is given. |
NRF_ERROR_NOT_FOUND | The given address handle does not exist in the subscription lists. |