Data Structures | |
| struct | unpacked_marshalled_sensor_data_t |
| struct | unpacked_sensor_data_t |
| struct | sensor_client_callbacks_t |
| struct | sensor_client_settings_t |
| User provided settings and callbacks for the model instance. More... | |
| struct | sensor_client_t |
Macros | |
| #define | SENSOR_CLIENT_MODEL_ID 0x1102 |
| Client model ID. | |
Typedefs | |
| typedef void(* | sensor_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_status_msg_pkt_t *p_in, uint16_t bytes) |
| Callback type for incoming sensor data. More... | |
| typedef void(* | sensor_descriptor_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_descriptor_t *p_in, uint16_t num_descriptors) |
| Callback type for sensor descriptor state related transactions. More... | |
| typedef void(* | sensor_cadence_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_cadence_status_msg_pkt_t *p_in, uint16_t length) |
| Callback type for cadence related transactions. More... | |
| typedef void(* | sensor_column_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_column_status_msg_pkt_t *p_in, uint16_t length) |
| Callback type for column state related transactions. More... | |
| typedef void(* | sensor_series_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_series_status_msg_pkt_t *p_in, uint16_t length) |
| Callback type for series state related transactions. More... | |
| typedef void(* | sensor_settings_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_settings_status_msg_pkt_t *p_in, uint16_t length) |
| Callback type for settings state related transactions. More... | |
| typedef void(* | sensor_setting_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_setting_status_msg_pkt_t *p_in, uint16_t length) |
| Callback type for setting state related transactions. More... | |
Functions | |
| uint32_t | sensor_client_init (sensor_client_t *p_client, uint16_t element_index) |
| Initializes Sensor Client. More... | |
| uint32_t | sensor_client_cadence_set (sensor_client_t *p_client, const sensor_cadence_set_msg_pkt_t *p_params, uint16_t length) |
| Sends a Set cadence message to the server. More... | |
| uint32_t | sensor_client_cadence_set_unack (sensor_client_t *p_client, const sensor_cadence_set_msg_pkt_t *p_params, uint16_t length, uint8_t repeats) |
| Sends a Set Cadence Unacknowledged message to the server. More... | |
| uint32_t | sensor_client_setting_set (sensor_client_t *p_client, const sensor_setting_set_msg_pkt_t *p_params, uint16_t length) |
| Sends a Set setting message to the server. More... | |
| uint32_t | sensor_client_setting_set_unack (sensor_client_t *p_client, const sensor_setting_set_msg_pkt_t *p_params, uint16_t length, uint8_t repeats) |
| Sends a Set Setting Unacknowledged message to the server. More... | |
| uint32_t | sensor_client_get (sensor_client_t *p_client, uint16_t property_id) |
| Sends a Get message to the server. More... | |
| uint32_t | sensor_client_descriptor_get (sensor_client_t *p_client, uint16_t property_id) |
| Sends a Descriptor Get message to the server. More... | |
| uint32_t | sensor_client_cadence_get (sensor_client_t *p_client, uint16_t property_id) |
| Sends a Cadence Get message to the server. More... | |
| uint32_t | sensor_client_settings_get (sensor_client_t *p_client, uint16_t property_id) |
| Sends a Settings Get message to the server. More... | |
| uint32_t | sensor_client_setting_get (sensor_client_t *p_client, uint16_t property_id, uint16_t setting_property_id) |
| Sends a Setting Get message to the server. More... | |
| uint32_t | sensor_client_column_get (sensor_client_t *p_client, sensor_column_get_msg_pkt_t *p_rawbuf, uint16_t length) |
| Sends a Column Get message to the server. More... | |
| uint32_t | sensor_client_series_get (sensor_client_t *p_client, sensor_series_get_msg_pkt_t *p_raw_colbuf, uint16_t length) |
| Sends a Series Get message to the server. More... | |
Detailed Description
Typedef Documentation
◆ sensor_state_status_cb_t
| typedef void(* sensor_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_status_msg_pkt_t *p_in, uint16_t bytes) |
Callback type for incoming sensor data.
- 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 [in] bytes The number of bytes of data at p_in
Definition at line 83 of file sensor_client.h.
◆ sensor_descriptor_state_status_cb_t
| typedef void(* sensor_descriptor_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_descriptor_t *p_in, uint16_t num_descriptors) |
Callback type for sensor descriptor 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 [in] num_descriptors The number of descriptors described at p_in
Definition at line 96 of file sensor_client.h.
◆ sensor_cadence_state_status_cb_t
| typedef void(* sensor_cadence_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_cadence_status_msg_pkt_t *p_in, uint16_t length) |
Callback type for cadence 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 [in] length Length of the message (p_in) in bytes
Definition at line 109 of file sensor_client.h.
◆ sensor_column_state_status_cb_t
| typedef void(* sensor_column_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_column_status_msg_pkt_t *p_in, uint16_t length) |
Callback type for column 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 [in] length Incoming data length
Definition at line 122 of file sensor_client.h.
◆ sensor_series_state_status_cb_t
| typedef void(* sensor_series_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_series_status_msg_pkt_t *p_in, uint16_t length) |
Callback type for series 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 [in] length Incoming data length
Definition at line 135 of file sensor_client.h.
◆ sensor_settings_state_status_cb_t
| typedef void(* sensor_settings_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_settings_status_msg_pkt_t *p_in, uint16_t length) |
Callback type for settings 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 [in] length Length of the message (p_in) in bytes
Definition at line 148 of file sensor_client.h.
◆ sensor_setting_state_status_cb_t
| typedef void(* sensor_setting_state_status_cb_t) (const sensor_client_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_setting_status_msg_pkt_t *p_in, uint16_t length) |
Callback type for setting 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 [in] length Length of the message (p_in) in bytes
Definition at line 161 of file sensor_client.h.
Function Documentation
◆ sensor_client_init()
| uint32_t sensor_client_init | ( | sensor_client_t * | p_client, |
| uint16_t | element_index | ||
| ) |
Initializes Sensor 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.
◆ sensor_client_cadence_set()
| uint32_t sensor_client_cadence_set | ( | sensor_client_t * | p_client, |
| const sensor_cadence_set_msg_pkt_t * | p_params, | ||
| uint16_t | length | ||
| ) |
Sends a Set cadence 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] length Length in bytes of data at p_params.
- 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 Invalid model handle or model not bound to element. NRF_ERROR_INVALID_PARAM Model not bound to application key, publish address not set or wrong opcode format. NRF_ERROR_INVALID_STATE Message already scheduled for an acknowledged transfer.
◆ sensor_client_cadence_set_unack()
| uint32_t sensor_client_cadence_set_unack | ( | sensor_client_t * | p_client, |
| const sensor_cadence_set_msg_pkt_t * | p_params, | ||
| uint16_t | length, | ||
| uint8_t | repeats | ||
| ) |
Sends a Set Cadence 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] length Length in bytes of data at p_params. [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 Not enough memory available for message. NRF_ERROR_NOT_FOUND Invalid model handle or model not bound to element. NRF_ERROR_INVALID_ADDR The element index is greater than the number of local unicast addresses stored by the Device State Manager. NRF_ERROR_INVALID_PARAM Model not bound to appkey, publish address not set or wrong opcode format. 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.
◆ sensor_client_setting_set()
| uint32_t sensor_client_setting_set | ( | sensor_client_t * | p_client, |
| const sensor_setting_set_msg_pkt_t * | p_params, | ||
| uint16_t | length | ||
| ) |
Sends a Set setting 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] length Length in bytes of data at p_params.
- 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 Invalid model handle or model not bound to element. NRF_ERROR_INVALID_PARAM Model not bound to application key, publish address not set or wrong opcode format. NRF_ERROR_INVALID_STATE Message already scheduled for an acknowledged transfer.
◆ sensor_client_setting_set_unack()
| uint32_t sensor_client_setting_set_unack | ( | sensor_client_t * | p_client, |
| const sensor_setting_set_msg_pkt_t * | p_params, | ||
| uint16_t | length, | ||
| uint8_t | repeats | ||
| ) |
Sends a Set Setting 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] length Length in bytes of data at p_params. [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 Not enough memory available for message. NRF_ERROR_NOT_FOUND Invalid model handle or model not bound to element. NRF_ERROR_INVALID_ADDR The element index is greater than the number of local unicast addresses stored by the Device State Manager. NRF_ERROR_INVALID_PARAM Model not bound to appkey, publish address not set or wrong opcode format. 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.
◆ sensor_client_get()
| uint32_t sensor_client_get | ( | sensor_client_t * | p_client, |
| uint16_t | property_id | ||
| ) |
Sends a Get message to the server.
- Note
- Expected response: Status
- Parameters
-
[in] p_client Client model context pointer. [in] property_id Property ID specifying sensor status to return
- 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 Invalid model handle or model not bound to element. NRF_ERROR_INVALID_PARAM Model not bound to application key, publish address not set or wrong opcode format. NRF_ERROR_INVALID_STATE Message already scheduled for an acknowledged transfer.
◆ sensor_client_descriptor_get()
| uint32_t sensor_client_descriptor_get | ( | sensor_client_t * | p_client, |
| uint16_t | property_id | ||
| ) |
Sends a Descriptor Get message to the server.
- Note
- Expected response: Status
- Parameters
-
[in] p_client Client model context pointer. [in] property_id Property ID specifying descriptor to return
- 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 Invalid model handle or model not bound to element. NRF_ERROR_INVALID_PARAM Model not bound to application key, publish address not set or wrong opcode format. NRF_ERROR_INVALID_STATE Message already scheduled for an acknowledged transfer.
◆ sensor_client_cadence_get()
| uint32_t sensor_client_cadence_get | ( | sensor_client_t * | p_client, |
| uint16_t | property_id | ||
| ) |
Sends a Cadence Get message to the server.
- Note
- Expected response: Status
- Parameters
-
[in] p_client Client model context pointer. [in] property_id Property ID specifying cadence to return
- 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 Invalid model handle or model not bound to element. NRF_ERROR_INVALID_PARAM Model not bound to application key, publish address not set or wrong opcode format. NRF_ERROR_INVALID_STATE Message already scheduled for an acknowledged transfer.
◆ sensor_client_settings_get()
| uint32_t sensor_client_settings_get | ( | sensor_client_t * | p_client, |
| uint16_t | property_id | ||
| ) |
Sends a Settings Get message to the server.
- Note
- Expected response: Status
- Parameters
-
[in] p_client Client model context pointer. [in] property_id Property ID specifying settings to return
- 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 Invalid model handle or model not bound to element. NRF_ERROR_INVALID_PARAM Model not bound to application key, publish address not set or wrong opcode format. NRF_ERROR_INVALID_STATE Message already scheduled for an acknowledged transfer.
◆ sensor_client_setting_get()
| uint32_t sensor_client_setting_get | ( | sensor_client_t * | p_client, |
| uint16_t | property_id, | ||
| uint16_t | setting_property_id | ||
| ) |
Sends a Setting Get message to the server.
- Note
- Expected response: Status
- Parameters
-
[in] p_client Client model context pointer. [in] property_id Property ID specifying settings to return [in] setting_property_id Setting property ID specifying setting to return
- 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 Invalid model handle or model not bound to element. NRF_ERROR_INVALID_PARAM Model not bound to application key, publish address not set or wrong opcode format. NRF_ERROR_INVALID_STATE Message already scheduled for an acknowledged transfer.
◆ sensor_client_column_get()
| uint32_t sensor_client_column_get | ( | sensor_client_t * | p_client, |
| sensor_column_get_msg_pkt_t * | p_rawbuf, | ||
| uint16_t | length | ||
| ) |
Sends a Column Get message to the server.
- Note
- Expected response: Status
- Parameters
-
[in] p_client Client model context pointer. [in] p_rawbuf Pointer to column message data. [in] length The number of bytes of data at p_rawbuf.
- 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 Invalid model handle or model not bound to element. NRF_ERROR_INVALID_PARAM Model not bound to application key, publish address not set or wrong opcode format. NRF_ERROR_INVALID_STATE Message already scheduled for an acknowledged transfer.
◆ sensor_client_series_get()
| uint32_t sensor_client_series_get | ( | sensor_client_t * | p_client, |
| sensor_series_get_msg_pkt_t * | p_raw_colbuf, | ||
| uint16_t | length | ||
| ) |
Sends a Series Get message to the server.
- Note
- Expected response: Status
- Parameters
-
[in] p_client Client model context pointer. [in] p_raw_colbuf Pointer to series message data. [in] length The number of bytes of data at p_raw_colbuf.
- 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 Invalid model handle or model not bound to element. NRF_ERROR_INVALID_PARAM Model not bound to application key, publish address not set or wrong opcode format. NRF_ERROR_INVALID_STATE Message already scheduled for an acknowledged transfer.