nRF5 SDK for Mesh v3.2.0  08c60f6
Generic Power OnOff client model interface

Data Structures

struct  generic_ponoff_client_callbacks_t
 
struct  generic_ponoff_client_settings_t
 User provided settings and callbacks for the model instance. More...
 
union  generic_ponoff_client_msg_data_t
 Union for holding current message packet. More...
 
struct  generic_ponoff_client_t
 

Macros

#define GENERIC_PONOFF_CLIENT_MODEL_ID   0x1008
 Client model ID.
 

Typedefs

typedef void(* generic_ponoff_state_status_cb_t) (const generic_ponoff_client_t *p_self, const access_message_rx_meta_t *p_meta, const generic_ponoff_status_params_t *p_in)
 Callback type for Power OnOff state related transactions. More...
 

Functions

uint32_t generic_ponoff_client_init (generic_ponoff_client_t *p_client, uint8_t element_index)
 Initializes Generic Power OnOff client. More...
 
uint32_t generic_ponoff_client_set (generic_ponoff_client_t *p_client, const generic_ponoff_set_params_t *p_params)
 Sends a Set message to the server. More...
 
uint32_t generic_ponoff_client_set_unack (generic_ponoff_client_t *p_client, const generic_ponoff_set_params_t *p_params, uint8_t repeats)
 Sends a Set Unacknowledged message to the server. More...
 
uint32_t generic_ponoff_client_get (generic_ponoff_client_t *p_client)
 Sends a Get message to the server. More...
 

Detailed Description

Typedef Documentation

◆ generic_ponoff_state_status_cb_t

typedef void(* generic_ponoff_state_status_cb_t) (const generic_ponoff_client_t *p_self, const access_message_rx_meta_t *p_meta, const generic_ponoff_status_params_t *p_in)

Callback type for Power OnOff state related transactions.

Parameters
[in]p_selfPointer to the model structure
[in]p_metaAccess metadata for the received message
[in]p_inPointer to the input event parameters for the user application

Definition at line 69 of file generic_ponoff_client.h.

Function Documentation

◆ generic_ponoff_client_init()

uint32_t generic_ponoff_client_init ( generic_ponoff_client_t *  p_client,
uint8_t  element_index 
)

Initializes Generic Power OnOff client.

Note
This function should only be called once.
The client handles the model allocation and adding.
Parameters
[in]p_clientClient model context pointer.
[in]element_indexElement index to add the model
Return values
NRF_SUCCESSIf model is initialized succesfully
Returns
Other appropriate error codes on failure.

◆ generic_ponoff_client_set()

uint32_t generic_ponoff_client_set ( generic_ponoff_client_t *  p_client,
const generic_ponoff_set_params_t p_params 
)

Sends a Set message to the server.

Note
Expected response: Status, if the message is sent as acknowledged message.
Parameters
[in]p_clientClient model context pointer.
[in]p_paramsMessage parameters.
Return values
NRF_SUCCESSIf the message is handed over to the mesh stack for transmission.
Returns
Other appropriate error codes on failure.

◆ generic_ponoff_client_set_unack()

uint32_t generic_ponoff_client_set_unack ( generic_ponoff_client_t *  p_client,
const generic_ponoff_set_params_t p_params,
uint8_t  repeats 
)

Sends a Set Unacknowledged message to the server.

Note
Expected response: Status, if the message is sent as acknowledged message.
Parameters
[in]p_clientClient model context pointer.
[in]p_paramsMessage parameters.
[in]repeatsNumber of repetitions to use while sending unacknowledged message.
Return values
NRF_SUCCESSIf the message is handed over to the mesh stack for transmission.
Returns
Other appropriate error codes on failure.

◆ generic_ponoff_client_get()

uint32_t generic_ponoff_client_get ( generic_ponoff_client_t *  p_client)

Sends a Get message to the server.

Note
Expected response: Status
Parameters
[in]p_clientClient model context pointer.
Return values
NRF_SUCCESSIf the message is handed over to the mesh stack for transmission.
Returns
Other appropriate error codes on failure.