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

Data Structures

struct  light_lightness_client_callbacks_t
 
struct  light_lightness_client_settings_t
 User provided settings and callbacks for the model instance. More...
 
union  light_lightness_client_msg_data_t
 Union for holding current message packet. More...
 
struct  light_lightness_client_t
 

Macros

#define LIGHT_LIGHTNESS_CLIENT_MODEL_ID   0x1302
 Client model ID.
 

Typedefs

typedef void(* light_lightness_state_status_cb_t) (const light_lightness_client_t *p_self, const access_message_rx_meta_t *p_meta, const light_lightness_status_params_t *p_in)
 Callback type for lightness state related transactions. More...
 
typedef void(* light_lightness_linear_state_status_cb_t) (const light_lightness_client_t *p_self, const access_message_rx_meta_t *p_meta, const light_lightness_linear_status_params_t *p_in)
 Callback type for linear lightness state related transactions. More...
 
typedef void(* light_lightness_last_state_status_cb_t) (const light_lightness_client_t *p_self, const access_message_rx_meta_t *p_meta, const light_lightness_last_status_params_t *p_in)
 Callback type for last state related transactions. More...
 
typedef void(* light_lightness_default_state_status_cb_t) (const light_lightness_client_t *p_self, const access_message_rx_meta_t *p_meta, const light_lightness_default_status_params_t *p_in)
 Callback type for default state related transactions. More...
 
typedef void(* light_lightness_range_state_status_cb_t) (const light_lightness_client_t *p_self, const access_message_rx_meta_t *p_meta, const light_lightness_range_status_params_t *p_in)
 Callback type for range state related transactions. More...
 

Functions

uint32_t light_lightness_client_init (light_lightness_client_t *p_client, uint8_t element_index)
 Initializes Light Lightness client. More...
 
uint32_t light_lightness_client_set (light_lightness_client_t *p_client, const light_lightness_set_params_t *p_params, const model_transition_t *p_transition)
 Sends a Set message to the server. More...
 
uint32_t light_lightness_client_set_unack (light_lightness_client_t *p_client, const light_lightness_set_params_t *p_params, const model_transition_t *p_transition, uint8_t repeats)
 Sends a Set Unacknowledged message to the server. More...
 
uint32_t light_lightness_client_linear_set (light_lightness_client_t *p_client, const light_lightness_linear_set_params_t *p_params, const model_transition_t *p_transition)
 Sends a Linear Set message to the server. More...
 
uint32_t light_lightness_client_linear_set_unack (light_lightness_client_t *p_client, const light_lightness_linear_set_params_t *p_params, const model_transition_t *p_transition, uint8_t repeats)
 Sends a Linear Set Unacknowledged message to the server. More...
 
uint32_t light_lightness_client_default_set (light_lightness_client_t *p_client, const light_lightness_default_set_params_t *p_params)
 Sends a Default Set message to the server. More...
 
uint32_t light_lightness_client_default_set_unack (light_lightness_client_t *p_client, const light_lightness_default_set_params_t *p_params, uint8_t repeats)
 Sends a Default Set Unacknowledged message to the server. More...
 
uint32_t light_lightness_client_range_set (light_lightness_client_t *p_client, const light_lightness_range_set_params_t *p_params)
 Sends a Range Set message to the server. More...
 
uint32_t light_lightness_client_range_set_unack (light_lightness_client_t *p_client, const light_lightness_range_set_params_t *p_params, uint8_t repeats)
 Sends a Range Set Unacknowledged message to the server. More...
 
uint32_t light_lightness_client_get (light_lightness_client_t *p_client)
 Sends a Get message to the server. More...
 
uint32_t light_lightness_client_linear_get (light_lightness_client_t *p_client)
 Sends a Linear Get message to the server. More...
 
uint32_t light_lightness_client_last_get (light_lightness_client_t *p_client)
 Sends a Last Get message to the server. More...
 
uint32_t light_lightness_client_default_get (light_lightness_client_t *p_client)
 Sends a Default Get message to the server. More...
 
uint32_t light_lightness_client_range_get (light_lightness_client_t *p_client)
 Sends a Range Get message to the server. More...
 

Detailed Description

Typedef Documentation

◆ light_lightness_state_status_cb_t

typedef void(* light_lightness_state_status_cb_t) (const light_lightness_client_t *p_self, const access_message_rx_meta_t *p_meta, const light_lightness_status_params_t *p_in)

Callback type for lightness 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 68 of file light_lightness_client.h.

◆ light_lightness_linear_state_status_cb_t

typedef void(* light_lightness_linear_state_status_cb_t) (const light_lightness_client_t *p_self, const access_message_rx_meta_t *p_meta, const light_lightness_linear_status_params_t *p_in)

Callback type for linear lightness 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 79 of file light_lightness_client.h.

◆ light_lightness_last_state_status_cb_t

typedef void(* light_lightness_last_state_status_cb_t) (const light_lightness_client_t *p_self, const access_message_rx_meta_t *p_meta, const light_lightness_last_status_params_t *p_in)

Callback type for last 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 90 of file light_lightness_client.h.

◆ light_lightness_default_state_status_cb_t

typedef void(* light_lightness_default_state_status_cb_t) (const light_lightness_client_t *p_self, const access_message_rx_meta_t *p_meta, const light_lightness_default_status_params_t *p_in)

Callback type for default 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 102 of file light_lightness_client.h.

◆ light_lightness_range_state_status_cb_t

typedef void(* light_lightness_range_state_status_cb_t) (const light_lightness_client_t *p_self, const access_message_rx_meta_t *p_meta, const light_lightness_range_status_params_t *p_in)

Callback type for range 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 113 of file light_lightness_client.h.

Function Documentation

◆ light_lightness_client_init()

uint32_t light_lightness_client_init ( light_lightness_client_t *  p_client,
uint8_t  element_index 
)

Initializes Light Lightness 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_NO_MEMACCESS_MODEL_COUNT number of models already allocated or no more subscription lists available in memory pool (see ACCESS_SUBSCRIPTION_LIST_COUNT).
NRF_ERROR_FORBIDDENMultiple 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_FOUNDInvalid access element index.

◆ light_lightness_client_set()

uint32_t light_lightness_client_set ( light_lightness_client_t *  p_client,
const light_lightness_set_params_t p_params,
const model_transition_t p_transition 
)

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

◆ light_lightness_client_set_unack()

uint32_t light_lightness_client_set_unack ( light_lightness_client_t *  p_client,
const light_lightness_set_params_t p_params,
const model_transition_t p_transition,
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]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.

◆ light_lightness_client_linear_set()

uint32_t light_lightness_client_linear_set ( light_lightness_client_t *  p_client,
const light_lightness_linear_set_params_t p_params,
const model_transition_t p_transition 
)

Sends a Linear 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.
[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.

◆ light_lightness_client_linear_set_unack()

uint32_t light_lightness_client_linear_set_unack ( light_lightness_client_t *  p_client,
const light_lightness_linear_set_params_t p_params,
const model_transition_t p_transition,
uint8_t  repeats 
)

Sends a Linear 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]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.

◆ light_lightness_client_default_set()

uint32_t light_lightness_client_default_set ( light_lightness_client_t *  p_client,
const light_lightness_default_set_params_t p_params 
)

Sends a Default 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_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.

◆ light_lightness_client_default_set_unack()

uint32_t light_lightness_client_default_set_unack ( light_lightness_client_t *  p_client,
const light_lightness_default_set_params_t p_params,
uint8_t  repeats 
)

Sends a Default 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_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.

◆ light_lightness_client_range_set()

uint32_t light_lightness_client_range_set ( light_lightness_client_t *  p_client,
const light_lightness_range_set_params_t p_params 
)

Sends a Range 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_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 message parameters, the model not bound to application key, or publish address not set.
NRF_ERROR_FORBIDDENFailed to allocate a sequence number from network.

◆ light_lightness_client_range_set_unack()

uint32_t light_lightness_client_range_set_unack ( light_lightness_client_t *  p_client,
const light_lightness_range_set_params_t p_params,
uint8_t  repeats 
)

Sends a Range 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_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 message 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.

◆ light_lightness_client_get()

uint32_t light_lightness_client_get ( light_lightness_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_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.

◆ light_lightness_client_linear_get()

uint32_t light_lightness_client_linear_get ( light_lightness_client_t *  p_client)

Sends a Linear Get message to the server.

Note
Expected response: Status
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.

◆ light_lightness_client_last_get()

uint32_t light_lightness_client_last_get ( light_lightness_client_t *  p_client)

Sends a Last Get message to the server.

Note
Expected response: Status
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.

◆ light_lightness_client_default_get()

uint32_t light_lightness_client_default_get ( light_lightness_client_t *  p_client)

Sends a Default Get message to the server.

Note
Expected response: Status
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.

◆ light_lightness_client_range_get()

uint32_t light_lightness_client_range_get ( light_lightness_client_t *  p_client)

Sends a Range Get message to the server.

Note
Expected response: Status
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