Configuration of model parameters. More...
Functions | |
uint32_t | access_model_publish_address_set (access_model_handle_t handle, dsm_handle_t address_handle) |
Changes the publish address for the given model. More... | |
uint32_t | access_model_publication_stop (access_model_handle_t handle) |
Stops the publication with the resetting of states for the given model. More... | |
uint32_t | access_model_publication_by_appkey_stop (dsm_handle_t appkey_handle) |
Stops the publication with the resetting of states for all models which are bound to the appkey_handle application key. More... | |
uint32_t | access_model_publish_address_get (access_model_handle_t handle, dsm_handle_t *p_address_handle) |
Gets the current publish address for the given model. More... | |
uint32_t | access_model_publish_retransmit_set (access_model_handle_t handle, access_publish_retransmit_t retransmit_params) |
Sets the publish retransmit parameters for the given model. More... | |
uint32_t | access_model_publish_retransmit_get (access_model_handle_t handle, access_publish_retransmit_t *p_retransmit_params) |
Gets the current publish retransmit parameters for the given model. More... | |
uint32_t | access_model_publish_period_divisor_set (access_model_handle_t handle, uint16_t publish_divisor) |
Sets the publish period divisor. More... | |
uint32_t | access_model_publish_period_set (access_model_handle_t handle, access_publish_resolution_t resolution, uint8_t step_number) |
Sets the publish period for the given model. More... | |
uint32_t | access_model_publish_period_get (access_model_handle_t handle, access_publish_resolution_t *p_resolution, uint8_t *p_step_number) |
Gets the publish period for the given model. More... | |
uint32_t | access_model_subscription_add (access_model_handle_t handle, dsm_handle_t address_handle) |
Adds a subscription to a model. More... | |
uint32_t | access_model_subscription_remove (access_model_handle_t handle, dsm_handle_t address_handle) |
Removes a subscription from a model. More... | |
uint32_t | access_model_subscriptions_get (access_model_handle_t handle, dsm_handle_t *p_address_handles, uint16_t *p_count) |
Gets the address handles for the subscription addresses bound to a model. More... | |
uint32_t | access_model_application_bind (access_model_handle_t handle, dsm_handle_t appkey_handle) |
Binds an application key to a model. More... | |
uint32_t | access_model_application_unbind (access_model_handle_t handle, dsm_handle_t appkey_handle) |
Unbinds an application key from a model. More... | |
uint32_t | access_model_applications_get (access_model_handle_t handle, dsm_handle_t *p_appkey_handles, uint16_t *p_count) |
Gets the applications bound to a model. More... | |
uint32_t | access_model_publish_application_set (access_model_handle_t handle, dsm_handle_t appkey_handle) |
Sets the application key to be used when publishing for the given model. More... | |
uint32_t | access_model_publish_application_get (access_model_handle_t handle, dsm_handle_t *p_appkey_handle) |
Gets the application key used when publishing for the given model. More... | |
uint32_t | access_model_publish_friendship_credential_flag_set (access_model_handle_t handle, bool flag) |
Sets the friendship credentials flag value for the given model. More... | |
uint32_t | access_model_publish_friendship_credential_flag_get (access_model_handle_t handle, bool *p_flag) |
Gets the friendship credentials flag value for the given model. More... | |
uint32_t | access_model_publish_ttl_set (access_model_handle_t handle, uint8_t ttl) |
Sets the default publication TTL value for the given model. More... | |
uint32_t | access_model_publish_ttl_get (access_model_handle_t handle, uint8_t *p_ttl) |
Gets the default publication TTL value for the given model. More... | |
uint32_t | access_model_id_get (access_model_handle_t handle, access_model_id_t *p_model_id) |
Gets the model ID of for the given model. More... | |
uint32_t | access_model_p_args_get (access_model_handle_t handle, void **pp_args) |
Gets the generic argument pointer bound to the given model. More... | |
uint32_t | access_model_subscription_list_alloc (access_model_handle_t handle) |
Allocates a subscription list for a model. More... | |
uint32_t | access_model_subscription_list_dealloc (access_model_handle_t handle) |
De-allocates a subscription list for a model. More... | |
uint32_t | access_model_subscription_lists_share (access_model_handle_t owner, access_model_handle_t other) |
Shares the subscription lists for two models. More... | |
Configuration of model parameters.
uint32_t access_model_publish_address_set | ( | access_model_handle_t | handle, |
dsm_handle_t | address_handle | ||
) |
Changes the publish address for the given model.
[in] | handle | Access model handle. |
[in] | address_handle | Address to set as the current publish address. |
NRF_SUCCESS | Successfully set the publish address. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_INVALID_PARAM | Invalid address handle. |
uint32_t access_model_publication_stop | ( | access_model_handle_t | handle | ) |
Stops the publication with the resetting of states for the given model.
[in] | handle | Access model handle. |
NRF_SUCCESS | Success. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
uint32_t access_model_publication_by_appkey_stop | ( | dsm_handle_t | appkey_handle | ) |
Stops the publication with the resetting of states for all models which are bound to the appkey_handle
application key.
[in] | appkey_handle | Application key handle. |
NRF_SUCCESS | Success. |
NRF_ERROR_INVALID_PARAM | Application key handle invalid. |
uint32_t access_model_publish_address_get | ( | access_model_handle_t | handle, |
dsm_handle_t * | p_address_handle | ||
) |
Gets the current publish address for the given model.
[in] | handle | Access model handle. |
[out] | p_address_handle | Pointer to store the current publish address handle. |
NRF_SUCCESS | Successfully returned the address handle. |
NRF_ERROR_NULL | Null pointer given to function. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
uint32_t access_model_publish_retransmit_set | ( | access_model_handle_t | handle, |
access_publish_retransmit_t | retransmit_params | ||
) |
Sets the publish retransmit parameters for the given model.
[in] | handle | Access model handle. |
[in] | retransmit_params | Retransmit parameters to be set. |
NRF_SUCCESS | Successfully set the retransmit params. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
uint32_t access_model_publish_retransmit_get | ( | access_model_handle_t | handle, |
access_publish_retransmit_t * | p_retransmit_params | ||
) |
Gets the current publish retransmit parameters for the given model.
[in] | handle | Access model handle. |
[out] | p_retransmit_params | Pointer to store the current publish retransmit params. |
NRF_SUCCESS | Successfully returned the publish retransmit params. |
NRF_ERROR_NULL | Null pointer given to function. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
uint32_t access_model_publish_period_divisor_set | ( | access_model_handle_t | handle, |
uint16_t | publish_divisor | ||
) |
Sets the publish period divisor.
Access layer will divide a publish period by the publish_divisor
value. If publication is already active, its period will be modified immediately with the new value of publish_divisor.
[in] | handle | Access model handle. |
[in] | publish_divisor | A divisor value to divide the model publication period with. This value should not be zero. |
NRF_SUCCESS | Successfully updated the publish period. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_INVALID_PARAM | The publish_divisor value is invalid. |
uint32_t access_model_publish_period_set | ( | access_model_handle_t | handle, |
access_publish_resolution_t | resolution, | ||
uint8_t | step_number | ||
) |
Sets the publish period for the given model.
period = resolution * step_numberThus, setting the
step_number
to 0
, will disable periodic publishing.[in] | handle | Access model handle. |
[in] | resolution | Resolution of each step. Most not be larger than ACCESS_PUBLISH_RESOLUTION_MAX. |
[in] | step_number | Number of steps. Must not be larger than ACCESS_PUBLISH_PERIOD_STEP_MAX. |
NRF_SUCCSES | Successfully set the publish period. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_INVALID_PARAM | Publish step and/or resolution out of range. |
NRF_ERROR_NOT_SUPPORTED | Periodic publishing not supported for this model. |
uint32_t access_model_publish_period_get | ( | access_model_handle_t | handle, |
access_publish_resolution_t * | p_resolution, | ||
uint8_t * | p_step_number | ||
) |
Gets the publish period for the given model.
[in] | handle | Access model handle. |
[out] | p_resolution | Pointer to store the resolution. |
[out] | p_step_number | Pointer to store the step number. |
NRF_SUCCESS | Successfully stored the publish period. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
uint32_t access_model_subscription_add | ( | access_model_handle_t | handle, |
dsm_handle_t | address_handle | ||
) |
Adds a subscription to a model.
[in] | handle | Access model handle. |
[in] | address_handle | Address to add to the model's subscription list. |
NRF_SUCCESS | Successfully added the subscription. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_NOT_SUPPORTED | Subscriptions not supported for this model. |
NRF_ERROR_INVALID_PARAM | Invalid address handle. |
uint32_t access_model_subscription_remove | ( | access_model_handle_t | handle, |
dsm_handle_t | address_handle | ||
) |
Removes a subscription from a model.
[in] | handle | Access model handle. |
[in] | address_handle | Address to remove from the model's subscription list. |
NRF_SUCCESS | Successfully removed the subscription. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_NOT_SUPPORTED | Subscriptions not supported for this model. |
NRF_ERROR_INVALID_PARAM | Invalid address handle. |
uint32_t access_model_subscriptions_get | ( | access_model_handle_t | handle, |
dsm_handle_t * | p_address_handles, | ||
uint16_t * | p_count | ||
) |
Gets the address handles for the subscription addresses bound to a model.
[in] | handle | Access model handle. |
[out] | p_address_handles | Pointer to array for storing address handles. |
[in,out] | p_count | Pointer to number of available handles in p_address_handles. The number of written handles is returned |
NRF_SUCCESS | Successfully stored the address handles. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_NOT_SUPPORTED | Subscriptions are not supported by this model. |
NRF_ERROR_INVALID_LENGTH | Size of p_address_handles too small for storing all the bound keys. |
uint32_t access_model_application_bind | ( | access_model_handle_t | handle, |
dsm_handle_t | appkey_handle | ||
) |
Binds an application key to a model.
[in] | handle | Access model handle. |
[in] | appkey_handle | Application handle to add to the model. |
NRF_SUCCESS | Successfully added the application key. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_INVALID_PARAM | Invalid application key handle. |
uint32_t access_model_application_unbind | ( | access_model_handle_t | handle, |
dsm_handle_t | appkey_handle | ||
) |
Unbinds an application key from a model.
[in] | handle | Access model handle. |
[in] | appkey_handle | Application handle to remove from the model. |
NRF_SUCCESS | Successfully removed the application key. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_INVALID_PARAM | Invalid application key handle. |
uint32_t access_model_applications_get | ( | access_model_handle_t | handle, |
dsm_handle_t * | p_appkey_handles, | ||
uint16_t * | p_count | ||
) |
Gets the applications bound to a model.
[in] | handle | Access model handle. |
[out] | p_appkey_handles | Pointer to array where the DSM handles will be stored. |
[in,out] | p_count | Pointer to number of handles available in p_appkey_handles. The number of written handles will be returned in p_count. |
NRF_SUCCESS | Successfully stored the application handles. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_INVALID_PARAM | Invalid access model handle. |
NRF_ERROR_INVALID_LENGTH | Size of p_appkey_handles too small for storing all the bound keys. |
uint32_t access_model_publish_application_set | ( | access_model_handle_t | handle, |
dsm_handle_t | appkey_handle | ||
) |
Sets the application key to be used when publishing for the given model.
[in] | handle | Access model handle. |
[in] | appkey_handle | Application handle to bind with model. |
NRF_SUCCESS | Successfully set the application key used for publishing. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_INVALID_PARAM | Invalid application key handle. |
uint32_t access_model_publish_application_get | ( | access_model_handle_t | handle, |
dsm_handle_t * | p_appkey_handle | ||
) |
Gets the application key used when publishing for the given model.
[in] | handle | Access model handle. |
[out] | p_appkey_handle | Pointer to store the application handle. |
NRF_SUCCESS | Successfully stored the application key used for publishing. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
uint32_t access_model_publish_friendship_credential_flag_set | ( | access_model_handle_t | handle, |
bool | flag | ||
) |
Sets the friendship credentials flag value for the given model.
[in] | handle | Access model handle. |
[in] | flag | New friendship credentials flag value. |
NRF_SUCCESS | Successfully set the default publication TTL value. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
uint32_t access_model_publish_friendship_credential_flag_get | ( | access_model_handle_t | handle, |
bool * | p_flag | ||
) |
Gets the friendship credentials flag value for the given model.
[in] | handle | Access model handle. |
[in] | p_flag | Pointer to store the friendship credentials flag value. |
NRF_SUCCESS | Successfully retrived the friendship credentials flag value. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
uint32_t access_model_publish_ttl_set | ( | access_model_handle_t | handle, |
uint8_t | ttl | ||
) |
Sets the default publication TTL value for the given model.
[in] | handle | Access model handle. |
[in] | ttl | New default TTL value. |
NRF_SUCCESS | Successfully set the default publication TTL value. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_INVALID_PARAM | TTL value has to be less than NRF_MESH_TTL_MAX. |
uint32_t access_model_publish_ttl_get | ( | access_model_handle_t | handle, |
uint8_t * | p_ttl | ||
) |
Gets the default publication TTL value for the given model.
[in] | handle | Access model handle. |
[out] | p_ttl | Pointer to store the default TTL value. |
NRF_SUCCESS | Successfully retrived the default publication TTL value. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
uint32_t access_model_id_get | ( | access_model_handle_t | handle, |
access_model_id_t * | p_model_id | ||
) |
Gets the model ID of for the given model.
[in] | handle | Access model handle. |
[out] | p_model_id | Pointer to store the model ID. |
NRF_SUCCESS | Successfully got the model ID. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_NOT_FOUND | Invalid access handle. |
uint32_t access_model_p_args_get | ( | access_model_handle_t | handle, |
void ** | pp_args | ||
) |
Gets the generic argument pointer bound to the given model.
[in] | handle | Access model handle. |
[out] | pp_args | Double pointer to return the generic argument pointer. |
NRF_SUCCESS | Successfully returned the generic argument pointer. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
uint32_t access_model_subscription_list_alloc | ( | access_model_handle_t | handle | ) |
Allocates a subscription list for a model.
Allocating a subscription list for a model that already has one allocated results in Success and does not cause changes to the already allocated subscription list.
[in] | handle | Model handle to allocate list for. |
NRF_SUCCESS | Successfully allocated subscription list. |
NRF_ERROR_NO_MEM | No more subscription lists available in memory pool. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_FORBIDDEN | Device has been provisioned and changes to model subscription list are not allowed. |
uint32_t access_model_subscription_list_dealloc | ( | access_model_handle_t | handle | ) |
De-allocates a subscription list for a model.
This function is intended to be used during the initialization of the extended models. De-allocating a subscription list for a model that does not have any list allocated yet results in Success. It is not allowed to de-allocate the subscription list once the model-subscription list configuration is written in the flash or when access layer data is being stored to the flash.
[in] | handle | Model handle to de-allocate list for. |
NRF_SUCCESS | Successfully de-allocated subscription list. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_FORBIDDEN | Device has been provisioned and changes to model subscription list are not allowed. |
uint32_t access_model_subscription_lists_share | ( | access_model_handle_t | owner, |
access_model_handle_t | other | ||
) |
Shares the subscription lists for two models.
This function is used with models that operate on bound states and need to share a single subscription list. Subscription list of the owner
will be shared with other
. If the other
model already has a subscription list allocated, this API will de-allocate it before sharing the list of the owner
.
[in] | owner | The owner of the subscription list (the model handle that has allocated a subscription list). |
[in] | other | The model that will share the owner's subscription list. |
NRF_SUCCESS | Successfully shared the subscription list. |
NRF_ERROR_NOT_FOUND | Access handle invalid for one or more of the models. |
NRF_ERROR_INVALID_STATE | Invalid parameter combination. The owner must have a subscription list allocated. |
NRF_ERROR_FORBIDDEN | Device has been provisioned and changes to model subscription list are not allowed. |