nRF5 SDK for Mesh v3.2.0  08c60f6
Generic Level server model interface

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...
 

Detailed Description

Typedef Documentation

◆ generic_level_state_set_cb_t

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.

Parameters
[in]p_selfPointer to the model structure.
[in]p_metaAccess metadata for the received message.
[in]p_inPointer to the input parameters for the user application.
[in]p_in_transitionPointer to transition parameters, if present in the incoming message, otherwise set to null.
[out]p_outPointer 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.

◆ generic_level_state_get_cb_t

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.

Parameters
[in]p_selfPointer to the model structure.
[in]p_metaAccess metadata for the received message.
[out]p_outPointer to store the output parameters from the user application.

Definition at line 83 of file generic_level_server.h.

◆ generic_level_state_delta_set_cb_t

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.

Note
This message callback implementation should check if the transaction is new or same as previous by calling model_transaction_is_new() API, and take appropriate action as required by section 3.3.2.2.3 of Mesh Model Specification v1.0.
Parameters
[in]p_selfPointer to the model structure.
[in]p_metaAccess metadata for the received message.
[in]p_inPointer to the input parameters for the user application.
[in]p_in_transitionPointer to transition parameters, if present in the incoming message, otherwise set to null.
[out]p_outPointer 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.

◆ generic_level_state_move_set_cb_t

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.

Parameters
[in]p_selfPointer to the model structure.
[in]p_metaAccess metadata for the received message.
[in]p_inPointer to the input parameters for the user application.
[in]p_in_transitionPointer to transition parameters, if present in the incoming message, otherwise set to null.
[out]p_outPointer 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.

Function Documentation

◆ generic_level_server_init()

uint32_t generic_level_server_init ( generic_level_server_t *  p_server,
uint8_t  element_index 
)

Initializes Generic Level server.

Note
The server handles the model allocation and adding.
Parameters
[in]p_serverGeneric Level server context pointer.
[in]element_indexElement index to add the model to.
Return values
NRF_SUCCESSIf the model is initialized successfully.
Returns
Other appropriate error codes on failure.

◆ generic_level_server_status_publish()

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.

Parameters
[in]p_serverStatus server context pointer.
[in]p_paramsMessage parameters.
Return values
NRF_SUCCESSIf the message is published successfully.
Returns
Other appropriate error codes on failure.