nRF5 SDK for Mesh v5.0.0
Data Structures | Macros | Typedefs | Functions
Scene client model interface

Data Structures

struct  scene_client_callbacks_t
 
struct  scene_client_settings_t
 User provided settings and callbacks for the model instance. More...
 
union  scene_client_msg_data_t
 Union for holding current message packet. More...
 
struct  scene_client_t
 

Macros

#define SCENE_CLIENT_MODEL_ID   0x1205
 Client model ID.
 

Typedefs

typedef void(* scene_state_status_cb_t) (const scene_client_t *p_self, const access_message_rx_meta_t *p_meta, const scene_status_params_t *p_in)
 Callback type for scene state related transactions. More...
 
typedef void(* scene_register_state_status_cb_t) (const scene_client_t *p_self, const access_message_rx_meta_t *p_meta, const scene_register_status_params_t *p_in)
 Callback type for register scene state related transactions. More...
 

Functions

uint32_t scene_client_init (scene_client_t *p_client, uint8_t element_index)
 Initializes Scene client. More...
 
uint32_t scene_client_store (scene_client_t *p_client, const scene_store_params_t *p_params)
 Sends a Store message to the server. More...
 
uint32_t scene_client_store_unack (scene_client_t *p_client, const scene_store_params_t *p_params, uint8_t repeats)
 Sends a Store Unacknowledged message to the server. More...
 
uint32_t scene_client_delete (scene_client_t *p_client, const scene_delete_params_t *p_params)
 Sends a Delete message to the server. More...
 
uint32_t scene_client_delete_unack (scene_client_t *p_client, const scene_delete_params_t *p_params, uint8_t repeats)
 Sends a Delete Unacknowledged message to the server. More...
 
uint32_t scene_client_recall (scene_client_t *p_client, const scene_recall_params_t *p_params, const model_transition_t *p_transition)
 Sends a Recall message to the server. More...
 
uint32_t scene_client_recall_unack (scene_client_t *p_client, const scene_recall_params_t *p_params, const model_transition_t *p_transition, uint8_t repeats)
 Sends a Recall Unacknowledged message to the server. More...
 
uint32_t scene_client_get (scene_client_t *p_client)
 Sends a Get message to the server. More...
 
uint32_t scene_client_register_get (scene_client_t *p_client)
 Sends a Register Get message to the server. More...
 

Detailed Description

Typedef Documentation

◆ scene_state_status_cb_t

typedef void(* scene_state_status_cb_t) (const scene_client_t *p_self, const access_message_rx_meta_t *p_meta, const scene_status_params_t *p_in)

Callback type for scene 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 67 of file scene_client.h.

◆ scene_register_state_status_cb_t

typedef void(* scene_register_state_status_cb_t) (const scene_client_t *p_self, const access_message_rx_meta_t *p_meta, const scene_register_status_params_t *p_in)

Callback type for register scene 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 78 of file scene_client.h.

Function Documentation

◆ scene_client_init()

uint32_t scene_client_init ( scene_client_t *  p_client,
uint8_t  element_index 
)

Initializes Scene 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_SUCCESSThe model is initialized successfully.
NRF_ERROR_NULLNULL pointer given to function.
NRF_ERROR_BUSYThe model is busy publishing another message.
NRF_ERROR_NO_MEMNo memory available to send the message at this point.
NRF_ERROR_NOT_FOUNDThe model is not initialized.
NRF_ERROR_INVALID_PARAMIncorrect transition parameters, the model not bound to application key, or publish address not set.
NRF_ERROR_FORBIDDENFailed to allocate a sequence number from network.

◆ scene_client_store()

uint32_t scene_client_store ( scene_client_t *  p_client,
const scene_store_params_t p_params 
)

Sends a Store 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_SUCCESSThe message is handed over to the mesh stack for transmission.
NRF_ERROR_NULLNULL pointer given to function.
NRF_ERROR_BUSYThe model is busy publishing another message.
NRF_ERROR_NO_MEMNo memory available to send the message at this point.
NRF_ERROR_NOT_FOUNDThe model is not initialized.
NRF_ERROR_INVALID_PARAMThe model not bound to application key or publish address not set.
NRF_ERROR_FORBIDDENFailed to allocate a sequence number from network.

◆ scene_client_store_unack()

uint32_t scene_client_store_unack ( scene_client_t *  p_client,
const scene_store_params_t p_params,
uint8_t  repeats 
)

Sends a Store 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_SUCCESSThe message is handed over to the mesh stack for transmission.
NRF_ERROR_NULLNULL pointer given to function.
NRF_ERROR_NO_MEMNo memory available to send the message at this point.
NRF_ERROR_NOT_FOUNDThe model is not initialized.
NRF_ERROR_INVALID_PARAMThe model not bound to application key or publish address not set.
NRF_ERROR_FORBIDDENFailed to allocate a sequence number from network.
NRF_ERROR_INVALID_STATEThere's already a segmented packet that is being to sent to this destination. Wait for the transmission to finish before sending new segmented packets.

◆ scene_client_delete()

uint32_t scene_client_delete ( scene_client_t *  p_client,
const scene_delete_params_t p_params 
)

Sends a Delete 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_SUCCESSThe message is handed over to the mesh stack for transmission.
NRF_ERROR_NULLNULL pointer given to function.
NRF_ERROR_BUSYThe model is busy publishing another message.
NRF_ERROR_NO_MEMNo memory available to send the message at this point.
NRF_ERROR_NOT_FOUNDThe model is not initialized.
NRF_ERROR_INVALID_PARAMThe model not bound to application key or publish address not set.
NRF_ERROR_FORBIDDENFailed to allocate a sequence number from network.

◆ scene_client_delete_unack()

uint32_t scene_client_delete_unack ( scene_client_t *  p_client,
const scene_delete_params_t p_params,
uint8_t  repeats 
)

Sends a Delete 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_SUCCESSThe message is handed over to the mesh stack for transmission.
NRF_ERROR_NULLNULL pointer given to function.
NRF_ERROR_NO_MEMNo memory available to send the message at this point.
NRF_ERROR_NOT_FOUNDThe model is not initialized.
NRF_ERROR_INVALID_PARAMThe model not bound to application key or publish address not set.
NRF_ERROR_FORBIDDENFailed to allocate a sequence number from network.
NRF_ERROR_INVALID_STATEThere's already a segmented packet that is being to sent to this destination. Wait for the transmission to finish before sending new segmented packets.

◆ scene_client_recall()

uint32_t scene_client_recall ( scene_client_t *  p_client,
const scene_recall_params_t p_params,
const model_transition_t p_transition 
)

Sends a Recall 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]p_transitionOptional transition parameters
Return values
NRF_SUCCESSThe message is handed over to the mesh stack for transmission.
NRF_ERROR_NULLNULL pointer given to function.
NRF_ERROR_BUSYThe model is busy publishing another message.
NRF_ERROR_NO_MEMNo memory available to send the message at this point.
NRF_ERROR_NOT_FOUNDThe model is not initialized.
NRF_ERROR_INVALID_PARAMIncorrect transition parameters, the model not bound to application key, or publish address not set.
NRF_ERROR_FORBIDDENFailed to allocate a sequence number from network.

◆ scene_client_recall_unack()

uint32_t scene_client_recall_unack ( scene_client_t *  p_client,
const scene_recall_params_t p_params,
const model_transition_t p_transition,
uint8_t  repeats 
)

Sends a Recall 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]p_transitionOptional transition parameters
[in]repeatsNumber of repetitions to use while sending unacknowledged message.
Return values
NRF_SUCCESSThe message is handed over to the mesh stack for transmission.
NRF_ERROR_NULLNULL pointer given to function.
NRF_ERROR_NO_MEMNo memory available to send the message at this point.
NRF_ERROR_NOT_FOUNDThe model is not initialized.
NRF_ERROR_INVALID_PARAMIncorrect transition parameters, the model not bound to application key, or publish address not set.
NRF_ERROR_FORBIDDENFailed to allocate a sequence number from network.
NRF_ERROR_INVALID_STATEThere's already a segmented packet that is being to sent to this destination. Wait for the transmission to finish before sending new segmented packets.

◆ scene_client_get()

uint32_t scene_client_get ( scene_client_t *  p_client)

Sends a Get message to the server.

Note
Expected response: Status, if the message is sent as acknowledged message.
Parameters
[in]p_clientClient model context pointer.
Return values
NRF_SUCCESSThe message is handed over to the mesh stack for transmission.
NRF_ERROR_NULLNULL pointer given to function.
NRF_ERROR_BUSYThe model is busy publishing another message.
NRF_ERROR_NO_MEMNo memory available to send the message at this point.
NRF_ERROR_NOT_FOUNDThe model is not initialized.
NRF_ERROR_INVALID_PARAMThe model not bound to application key or publish address not set.
NRF_ERROR_FORBIDDENFailed to allocate a sequence number from network.

◆ scene_client_register_get()

uint32_t scene_client_register_get ( scene_client_t *  p_client)

Sends a Register Get message to the server.

Note
Expected response: Status, if the message is sent as acknowledged message.
Parameters
[in]p_clientClient model context pointer.
Return values
NRF_SUCCESSThe message is handed over to the mesh stack for transmission.
NRF_ERROR_NULLNULL pointer given to function.
NRF_ERROR_BUSYThe model is busy publishing another message.
NRF_ERROR_NO_MEMNo memory available to send the message at this point.
NRF_ERROR_NOT_FOUNDThe model is not initialized.
NRF_ERROR_INVALID_PARAMThe model not bound to application key or publish address not set.
NRF_ERROR_FORBIDDENFailed to allocate a sequence number from network.

Documentation feedback | Developer Zone | Subscribe | Updated