Data Structures | |
struct | sensor_server_settings_t |
User provided settings and callbacks for the model instance. More... | |
struct | sensor_server_t |
struct | sensor_setup_server_cbs_t |
Transaction callbacks for the Sensor state. More... | |
struct | sensor_setup_server_callbacks_t |
Sensor server callback list. More... | |
struct | sensor_setup_server_settings_t |
User provided settings and callbacks for the model instance. More... | |
struct | sensor_setup_server_t |
Macros | |
#define | SENSOR_SERVER_MODEL_ID 0x1100 |
Server model ID. | |
#define | SENSOR_SETUP_SERVER_MODEL_ID 0x1101 |
Setup server model ID. | |
Typedefs | |
typedef void(* | sensor_descriptor_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, sensor_descriptor_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor descriptor get message. More... | |
typedef void(* | sensor_state_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, sensor_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Get message. More... | |
typedef void(* | sensor_column_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_column_get_msg_pkt_t *p_in, uint16_t in_bytes, sensor_column_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Column Get message. More... | |
typedef void(* | sensor_series_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_series_get_msg_pkt_t *p_in, uint16_t in_bytes, sensor_series_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Series Get message. More... | |
typedef void(* | sensor_cadence_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, sensor_cadence_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Cadence Get message. More... | |
typedef void(* | sensor_cadence_set_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, const sensor_cadence_set_msg_pkt_t *p_in, uint16_t in_bytes, sensor_cadence_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Cadence Set message. More... | |
typedef void(* | sensor_settings_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, sensor_settings_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Settings Get message. More... | |
typedef void(* | sensor_setting_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, uint16_t setting_property_id, sensor_setting_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Setting Get message. More... | |
typedef void(* | sensor_setting_set_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, uint16_t settings_property_id, const sensor_setting_set_msg_pkt_t *p_in, uint16_t in_bytes, sensor_setting_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Setting Set message. More... | |
typedef void(* | sensor_publication_schedule_cb_t) (const sensor_setup_server_t *p_self) |
Callback type for scheduling sensor publications. More... | |
Functions | |
uint32_t | sensor_server_status_publish (const sensor_server_t *p_server, const sensor_status_msg_pkt_t *p_data, uint16_t data_length, sensor_opcode_t status_opcode) |
Publishes unsolicited Status message. More... | |
uint32_t | sensor_server_setup_status_publish (const sensor_setup_server_t *p_s_server, const sensor_status_msg_pkt_t *p_data, uint16_t data_length, sensor_opcode_t status_opcode) |
Publishes unsolicited Status message. More... | |
uint32_t | sensor_setup_server_init (sensor_setup_server_t *p_server, uint16_t element_index) |
Initializes Sensor Setup server. More... | |
typedef void(* sensor_descriptor_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, sensor_descriptor_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor descriptor get message.
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | property_id | The requested property id (or 0 if no PID specified) |
[out] | pp_out | Pointer to the response message. |
[out] | p_out_bytes | The number of response message bytes. |
Definition at line 76 of file sensor_setup_server.h.
typedef void(* sensor_state_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, sensor_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Get message.
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | property_id | The requested property id (or 0 if no PID specified) |
[out] | pp_out | Pointer to the response message. |
[out] | p_out_bytes | The number of response message bytes. |
Definition at line 91 of file sensor_setup_server.h.
typedef void(* sensor_column_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_column_get_msg_pkt_t *p_in, uint16_t in_bytes, sensor_column_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Column Get message.
(setting is singular, not settings)
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | property_id | The requested property id (or 0 if no PID specified) |
[in] | p_in | The input message |
[in] | in_bytes | The number of data bytes at p_in |
[out] | pp_out | Pointer to the response message. |
[out] | p_out_bytes | The number of response message bytes. |
Definition at line 108 of file sensor_setup_server.h.
typedef void(* sensor_series_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, const sensor_series_get_msg_pkt_t *p_in, uint16_t in_bytes, sensor_series_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Series Get message.
(setting is singular, not settings)
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | property_id | The requested property id (or 0 if no PID specified) |
[in] | p_in | The input message |
[in] | in_bytes | The number of data bytes at p_in |
[out] | pp_out | Pointer to the response message. |
[out] | p_out_bytes | The number of response message bytes at *pp_out. |
Definition at line 126 of file sensor_setup_server.h.
typedef void(* sensor_cadence_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, sensor_cadence_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Cadence Get message.
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | property_id | The requested property id (or 0 if no PID specified) |
[out] | pp_out | Pointer to the response message. |
[out] | p_out_bytes | The number of response message bytes. |
Definition at line 143 of file sensor_setup_server.h.
typedef void(* sensor_cadence_set_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, const sensor_cadence_set_msg_pkt_t *p_in, uint16_t in_bytes, sensor_cadence_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Cadence Set message.
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | property_id | The requested property id (or 0 if no PID specified) |
[in] | p_in | The input message |
[in] | in_bytes | The number of data bytes at p_in |
[out] | p_out | Pointer to the response message. |
[out] | p_out_bytes | The number of response message bytes. |
Definition at line 160 of file sensor_setup_server.h.
typedef void(* sensor_settings_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, sensor_settings_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Settings Get message.
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | property_id | The requested property id (or 0 if no PID specified) |
[out] | p_out | Pointer to the response message. |
[out] | p_out_bytes | The number of response message bytes. |
Definition at line 176 of file sensor_setup_server.h.
typedef void(* sensor_setting_get_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, uint16_t setting_property_id, sensor_setting_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Setting Get message.
(setting is singular, not settings)
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | property_id | The requested property id (or 0 if no PID specified) |
[in] | setting_property_id | The requested setting property id. |
[out] | p_out | Pointer to the response message. |
[out] | p_out_bytes | The number of response message bytes. |
Definition at line 192 of file sensor_setup_server.h.
typedef void(* sensor_setting_set_cb_t) (const sensor_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, uint16_t property_id, uint16_t settings_property_id, const sensor_setting_set_msg_pkt_t *p_in, uint16_t in_bytes, sensor_setting_status_msg_pkt_t **pp_out, uint16_t *p_out_bytes) |
Callback type for Sensor Setting Set message.
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | property_id | The requested property id (or 0 if no PID specified) |
[in] | settings_property_id | The requested settings property id. |
[in] | p_in | Pointer to the input message |
[in] | in_bytes | The number of data bytes at p_in |
[out] | p_out | Pointer to the response message. |
[out] | p_out_bytes | The number of response message bytes. |
Definition at line 211 of file sensor_setup_server.h.
typedef void(* sensor_publication_schedule_cb_t) (const sensor_setup_server_t *p_self) |
Callback type for scheduling sensor publications.
[in] | p_self | Pointer to the model structure. |
Definition at line 225 of file sensor_setup_server.h.
uint32_t sensor_server_status_publish | ( | const sensor_server_t * | p_server, |
const sensor_status_msg_pkt_t * | p_data, | ||
uint16_t | data_length, | ||
sensor_opcode_t | status_opcode | ||
) |
Publishes unsolicited Status message.
This API can be used to send unsolicited messages to report updated state value as a result of local action.
[in] | p_server | Status server context pointer. |
[in] | p_data | Message buffer |
[in] | data_length | Length of message buffer in bytes |
[in] | status_opcode | Identifies the status type |
NRF_SUCCESS | The message is published successfully. |
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_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. |
uint32_t sensor_server_setup_status_publish | ( | const sensor_setup_server_t * | p_s_server, |
const sensor_status_msg_pkt_t * | p_data, | ||
uint16_t | data_length, | ||
sensor_opcode_t | status_opcode | ||
) |
Publishes unsolicited Status message.
This API can be used to send unsolicited messages to report updated state value as a result of local action.
[in] | p_s_server | Status server context pointer. |
[in] | p_data | Message buffer |
[in] | data_length | Length of message buffer in bytes |
[in] | status_opcode | Identifies the status type |
NRF_SUCCESS | The message is published successfully. |
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_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. |
uint32_t sensor_setup_server_init | ( | sensor_setup_server_t * | p_server, |
uint16_t | element_index | ||
) |
Initializes Sensor Setup server.
[in] | p_server | Sensor server context pointer. |
[in] | element_index | Element index to add the model to. |
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. |