Data Structures | |
struct | generic_level_server_state_cbs_t |
Transaction callbacks for the Level state. More... | |
struct | generic_level_server_callbacks_t |
Level server callback list. More... | |
struct | generic_level_server_settings_t |
User provided settings and callbacks for the model instance. More... | |
struct | generic_level_server_t |
Macros | |
#define | GENERIC_LEVEL_SERVER_MODEL_ID 0x1002 |
Server model ID. | |
Typedefs | |
typedef void(* | generic_level_state_set_cb_t) (const generic_level_server_t *p_self, const access_message_rx_meta_t *p_meta, const generic_level_set_params_t *p_in, const model_transition_t *p_in_transition, generic_level_status_params_t *p_out) |
Callback type for Generic Level Set/Set Unacknowledged message. More... | |
typedef void(* | generic_level_state_get_cb_t) (const generic_level_server_t *p_self, const access_message_rx_meta_t *p_meta, generic_level_status_params_t *p_out) |
Callback type for Generic Level Get message. More... | |
typedef void(* | generic_level_state_delta_set_cb_t) (const generic_level_server_t *p_self, const access_message_rx_meta_t *p_meta, const generic_level_delta_set_params_t *p_in, const model_transition_t *p_in_transition, generic_level_status_params_t *p_out) |
Callback type for Generic Level Delta Set/Delta Set Unacknowledged message. More... | |
typedef void(* | generic_level_state_move_set_cb_t) (const generic_level_server_t *p_self, const access_message_rx_meta_t *p_meta, const generic_level_move_set_params_t *p_in, const model_transition_t *p_in_transition, generic_level_status_params_t *p_out) |
Callback type for Generic Level Move Set/Move Set Unacknowledged message. More... | |
Functions | |
uint32_t | generic_level_server_init (generic_level_server_t *p_server, uint8_t element_index) |
Initializes Generic Level server. More... | |
uint32_t | generic_level_server_status_publish (generic_level_server_t *p_server, const generic_level_status_params_t *p_params) |
Publishes unsolicited Status message. More... | |
uint32_t | generic_level_server_state_set (generic_level_server_t *p_server, int16_t level) |
Function to trigger level value set as a Generic Level server callback. More... | |
typedef void(* generic_level_state_set_cb_t) (const generic_level_server_t *p_self, const access_message_rx_meta_t *p_meta, const generic_level_set_params_t *p_in, const model_transition_t *p_in_transition, generic_level_status_params_t *p_out) |
Callback type for Generic Level Set/Set Unacknowledged message.
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | p_in | Pointer to the input parameters for the user application. |
[in] | p_in_transition | Pointer to transition parameters, if present in the incoming message, otherwise set to null. |
[out] | p_out | Pointer to store the output parameters from the user application. If null, indicates that it is UNACKNOWLEDGED message and no output params are required. |
Definition at line 70 of file generic_level_server.h.
typedef void(* generic_level_state_get_cb_t) (const generic_level_server_t *p_self, const access_message_rx_meta_t *p_meta, generic_level_status_params_t *p_out) |
Callback type for Generic Level Get message.
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[out] | p_out | Pointer to store the output parameters from the user application. |
Definition at line 83 of file generic_level_server.h.
typedef void(* generic_level_state_delta_set_cb_t) (const generic_level_server_t *p_self, const access_message_rx_meta_t *p_meta, const generic_level_delta_set_params_t *p_in, const model_transition_t *p_in_transition, generic_level_status_params_t *p_out) |
Callback type for Generic Level Delta Set/Delta Set Unacknowledged message.
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | p_in | Pointer to the input parameters for the user application. |
[in] | p_in_transition | Pointer to transition parameters, if present in the incoming message, otherwise set to null. |
[out] | p_out | Pointer to store the output parameters from the user application. If null, indicates that it is UNACKNOWLEDGED message and no output params are required. |
Definition at line 103 of file generic_level_server.h.
typedef void(* generic_level_state_move_set_cb_t) (const generic_level_server_t *p_self, const access_message_rx_meta_t *p_meta, const generic_level_move_set_params_t *p_in, const model_transition_t *p_in_transition, generic_level_status_params_t *p_out) |
Callback type for Generic Level Move Set/Move Set Unacknowledged message.
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | p_in | Pointer to the input parameters for the user application. |
[in] | p_in_transition | Pointer to transition parameters, if present in the incoming message, otherwise set to null. |
[out] | p_out | Pointer to store the output parameters from the user application. If null, indicates that it is UNACKNOWLEDGED message and no output params are required. |
Definition at line 122 of file generic_level_server.h.
uint32_t generic_level_server_init | ( | generic_level_server_t * | p_server, |
uint8_t | element_index | ||
) |
Initializes Generic Level server.
[in] | p_server | Generic Level server context pointer. |
[in] | element_index | Element index to add the model to. |
NRF_SUCCESS | The model is initialized successfully. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_NO_MEM | ACCESS_MODEL_COUNT number of models already allocated or no more subscription lists available in memory pool (see ACCESS_SUBSCRIPTION_LIST_COUNT). |
NRF_ERROR_FORBIDDEN | Multiple model instances per element are not allowed or changes to device composition are not allowed. Adding a new model after device is provisioned is not allowed. |
NRF_ERROR_NOT_FOUND | Invalid access element index. |
uint32_t generic_level_server_status_publish | ( | generic_level_server_t * | p_server, |
const generic_level_status_params_t * | p_params | ||
) |
Publishes unsolicited Status message.
This API can be used to send unsolicited messages to report updated state value as a result of local action.
[in] | p_server | Status server context pointer. |
[in] | p_params | Message parameters. |
NRF_SUCCESS | If the message is published successfully. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_NO_MEM | No memory available to send the message at this point. |
NRF_ERROR_NOT_FOUND | The model is not initialized. |
NRF_ERROR_INVALID_PARAM | The model not bound to application key or publish address not set. |
NRF_ERROR_FORBIDDEN | Failed to allocate a sequence number from network. |
NRF_ERROR_INVALID_STATE | There's already a segmented packet that is being to sent to this destination. Wait for the transmission to finish before sending new segmented packets. |
uint32_t generic_level_server_state_set | ( | generic_level_server_t * | p_server, |
int16_t | level | ||
) |
Function to trigger level value set as a Generic Level server callback.
This is called when the mesh is initialized and stable. The caller is responsible for reading the saved state values out of flash and pass those to this function. So that function calls set_cb to propogate given value to higher layers.
[in] | p_server | Server context pointer. |
[in] | level | Set value of the level state. |
NRF_SUCCESS | The model is initialized successfully. |
NRF_ERROR_NULL | NULL pointer given to function. |