Data Structures | |
| struct | generic_level_client_callbacks_t |
| struct | generic_level_client_settings_t |
| User provided settings and callbacks for the model instance. More... | |
| union | generic_level_client_msg_data_t |
| Union for holding current message packet. More... | |
| struct | generic_level_client_t |
Macros | |
| #define | GENERIC_LEVEL_CLIENT_MODEL_ID 0x1003 |
| Client model ID. | |
Typedefs | |
| typedef void(* | generic_level_state_status_cb_t) (const generic_level_client_t *p_self, const access_message_rx_meta_t *p_meta, const generic_level_status_params_t *p_in) |
| Callback type for Level state related transactions. More... | |
Functions | |
| uint32_t | generic_level_client_init (generic_level_client_t *p_client, uint8_t element_index) |
| Initializes Generic On Off client. More... | |
| uint32_t | generic_level_client_set (generic_level_client_t *p_client, const generic_level_set_params_t *p_params, const model_transition_t *p_transition) |
| Sends a Set message to the server. More... | |
| uint32_t | generic_level_client_set_unack (generic_level_client_t *p_client, const generic_level_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 | generic_level_client_delta_set (generic_level_client_t *p_client, const generic_level_delta_set_params_t *p_params, const model_transition_t *p_transition) |
| Sends a Delta Set message to the server. More... | |
| uint32_t | generic_level_client_delta_set_unack (generic_level_client_t *p_client, const generic_level_delta_set_params_t *p_params, const model_transition_t *p_transition, uint8_t repeats) |
| Sends a Delta Set Unacknowledged message to the server. More... | |
| uint32_t | generic_level_client_move_set (generic_level_client_t *p_client, const generic_level_move_set_params_t *p_params, const model_transition_t *p_transition) |
| Sends a Move Set message to the server. More... | |
| uint32_t | generic_level_client_move_set_unack (generic_level_client_t *p_client, const generic_level_move_set_params_t *p_params, const model_transition_t *p_transition, uint8_t repeats) |
| Sends a Move Set Unacknowledged message to the server. More... | |
| uint32_t | generic_level_client_get (generic_level_client_t *p_client) |
| Sends a Get message to the server. More... | |
Detailed Description
Typedef Documentation
◆ generic_level_state_status_cb_t
| typedef void(* generic_level_state_status_cb_t) (const generic_level_client_t *p_self, const access_message_rx_meta_t *p_meta, const generic_level_status_params_t *p_in) |
Callback type for Level state related transactions.
- Parameters
-
[in] p_self Pointer to the model structure [in] p_meta Access metadata for the received message [in] p_in Pointer to the input event parameters for the user application
Definition at line 68 of file generic_level_client.h.
Function Documentation
◆ generic_level_client_init()
| uint32_t generic_level_client_init | ( | generic_level_client_t * | p_client, |
| uint8_t | element_index | ||
| ) |
Initializes Generic On Off client.
- Note
- This function should only be called once.
- The client handles the model allocation and adding.
- Parameters
-
[in] p_client Client model context pointer. [in] element_index Element index to add the model
- Return values
-
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.
◆ generic_level_client_set()
| uint32_t generic_level_client_set | ( | generic_level_client_t * | p_client, |
| const generic_level_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_client Client model context pointer. [in] p_params Message parameters. [in] p_transition Optional transition parameters
- Return values
-
NRF_SUCCESS The message is handed over to the mesh stack for transmission. NRF_ERROR_NULL NULL pointer given to function. NRF_ERROR_BUSY The model is busy publishing another message. 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 Incorrect transition parameters, the model not bound to application key, or publish address not set. NRF_ERROR_FORBIDDEN Failed to allocate a sequence number from network.
◆ generic_level_client_set_unack()
| uint32_t generic_level_client_set_unack | ( | generic_level_client_t * | p_client, |
| const generic_level_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_client Client model context pointer. [in] p_params Message parameters. [in] p_transition Optional transition parameters [in] repeats Number of repetitions to use while sending unacknowledged message.
- Return values
-
NRF_SUCCESS The message is handed over to the mesh stack for transmission. 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 Incorrect transition parameters, 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.
◆ generic_level_client_delta_set()
| uint32_t generic_level_client_delta_set | ( | generic_level_client_t * | p_client, |
| const generic_level_delta_set_params_t * | p_params, | ||
| const model_transition_t * | p_transition | ||
| ) |
Sends a Delta Set message to the server.
- Note
- Expected response: Status, if the message is sent as acknowledged message.
- Parameters
-
[in] p_client Client model context pointer. [in] p_params Message parameters. [in] p_transition Optional transition parameters
- Return values
-
NRF_SUCCESS The message is handed over to the mesh stack for transmission. NRF_ERROR_NULL NULL pointer given to function. NRF_ERROR_BUSY The model is busy publishing another message. 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 Incorrect transition parameters, the model not bound to application key, or publish address not set. NRF_ERROR_FORBIDDEN Failed to allocate a sequence number from network.
◆ generic_level_client_delta_set_unack()
| uint32_t generic_level_client_delta_set_unack | ( | generic_level_client_t * | p_client, |
| const generic_level_delta_set_params_t * | p_params, | ||
| const model_transition_t * | p_transition, | ||
| uint8_t | repeats | ||
| ) |
Sends a Delta Set Unacknowledged message to the server.
- Note
- Expected response: Status, if the message is sent as acknowledged message.
- Parameters
-
[in] p_client Client model context pointer. [in] p_params Message parameters. [in] p_transition Optional transition parameters [in] repeats Number of repetitions to use while sending unacknowledged message.
- Return values
-
NRF_SUCCESS The message is handed over to the mesh stack for transmission. 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 Incorrect transition parameters, 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.
◆ generic_level_client_move_set()
| uint32_t generic_level_client_move_set | ( | generic_level_client_t * | p_client, |
| const generic_level_move_set_params_t * | p_params, | ||
| const model_transition_t * | p_transition | ||
| ) |
Sends a Move Set message to the server.
- Note
- Expected response: Status, if the message is sent as acknowledged message.
- Parameters
-
[in] p_client Client model context pointer. [in] p_params Message parameters. [in] p_transition Optional transition parameters
- Return values
-
NRF_SUCCESS The message is handed over to the mesh stack for transmission. NRF_ERROR_NULL NULL pointer given to function. NRF_ERROR_BUSY The model is busy publishing another message. 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 Incorrect transition parameters, the model not bound to application key, or publish address not set. NRF_ERROR_FORBIDDEN Failed to allocate a sequence number from network.
◆ generic_level_client_move_set_unack()
| uint32_t generic_level_client_move_set_unack | ( | generic_level_client_t * | p_client, |
| const generic_level_move_set_params_t * | p_params, | ||
| const model_transition_t * | p_transition, | ||
| uint8_t | repeats | ||
| ) |
Sends a Move Set Unacknowledged message to the server.
- Note
- Expected response: Status, if the message is sent as acknowledged message.
- Parameters
-
[in] p_client Client model context pointer. [in] p_params Message parameters. [in] p_transition Optional transition parameters [in] repeats Number of repetitions to use while sending unacknowledged message.
- Return values
-
NRF_SUCCESS The message is handed over to the mesh stack for transmission. 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 Incorrect transition parameters, 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.
◆ generic_level_client_get()
| uint32_t generic_level_client_get | ( | generic_level_client_t * | p_client | ) |
Sends a Get message to the server.
- Note
- Expected response: Status
- Parameters
-
[in] p_client Client model context pointer.
- Return values
-
NRF_SUCCESS The message is handed over to the mesh stack for transmission. NRF_ERROR_NULL NULL pointer given to function. NRF_ERROR_BUSY The model is busy publishing another message. 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.