Model implementing the Health Client foundation model.
More...
|
uint32_t | health_client_fault_get (health_client_t *p_client, uint16_t company_id) |
| Requests the current fault status from a server. More...
|
|
uint32_t | health_client_fault_clear (health_client_t *p_client, uint16_t company_id, bool acked) |
| Clears the fault array for a specified company ID. More...
|
|
uint32_t | health_client_fault_test (health_client_t *p_client, uint16_t company_id, uint8_t test_id, bool acked) |
| Requests a server to run a self-test. More...
|
|
uint32_t | health_client_period_get (health_client_t *p_client) |
| Gets the current health period state of an element. More...
|
|
uint32_t | health_client_period_set (health_client_t *p_client, uint8_t fast_period_divisor, bool acked) |
| Sets the health period state of an element. More...
|
|
uint32_t | health_client_attention_get (health_client_t *p_client) |
| Gets the attention timer from a server. More...
|
|
uint32_t | health_client_attention_set (health_client_t *p_client, uint8_t attention_timer, bool acked) |
| Sets the attention timer on a server. More...
|
|
uint32_t | health_client_init (health_client_t *p_client, uint16_t element_index, health_client_evt_cb_t evt_handler) |
| Initializes a health client instance. More...
|
|
void | health_client_pending_msg_cancel (health_client_t *p_client) |
| Cancel any ongoing reliable message transfer. More...
|
|
Model implementing the Health Client foundation model.
◆ health_client_evt_cb_t
typedef void(* health_client_evt_cb_t) (const health_client_t *p_client, const health_client_evt_t *p_event) |
Event callback function type.
This function is called when the health client receives a message from a health server.
- Parameters
-
[in] | p_client | Pointer to the health client instance structure. |
[in] | p_event | Pointer to a structure containing information about the received event. |
Definition at line 120 of file health_client.h.
◆ health_client_evt_type_t
Message types for messages received by the health client.
Enumerator |
---|
HEALTH_CLIENT_EVT_TYPE_CURRENT_STATUS_RECEIVED | A Health Current Status message was received.
|
HEALTH_CLIENT_EVT_TYPE_FAULT_STATUS_RECEIVED | A Health Fault Status message was received.
|
HEALTH_CLIENT_EVT_TYPE_PERIOD_STATUS_RECEIVED | A Health Period Status message was received.
|
HEALTH_CLIENT_EVT_TYPE_ATTENTION_STATUS_RECEIVED | A Health Attention Status message was received.
|
HEALTH_CLIENT_EVT_TYPE_TIMEOUT | A reliable transfer timed out.
|
HEALTH_CLIENT_EVT_TYPE_CANCELLED | A reliable transfer has been cancelled.
|
Definition at line 64 of file health_client.h.
◆ health_client_fault_get()
uint32_t health_client_fault_get |
( |
health_client_t * |
p_client, |
|
|
uint16_t |
company_id |
|
) |
| |
Requests the current fault status from a server.
- Note
- Response event: HEALTH_CLIENT_EVT_TYPE_FAULT_STATUS_RECEIVED
- Parameters
-
[in,out] | p_client | Pointer to the client instance structure. |
[in] | company_id | Company ID of of the server. |
- Return values
-
NRF_SUCCESS | The message was successfully sent to the server. |
NRF_ERROR_BUSY | The client is currently waiting for a reply from a server. |
◆ health_client_fault_clear()
uint32_t health_client_fault_clear |
( |
health_client_t * |
p_client, |
|
|
uint16_t |
company_id, |
|
|
bool |
acked |
|
) |
| |
Clears the fault array for a specified company ID.
- Note
- Response event if
acked
is true:
HEALTH_CLIENT_EVT_TYPE_FAULT_STATUS_RECEIVED
- Parameters
-
[in,out] | p_client | Pointer to the client instance structure. |
[in] | company_id | Company ID of of the server. |
[in] | acked | Whether to send the message as an acknowledged message or an unacknowledged message. |
- Return values
-
NRF_SUCCESS | The message was successfully sent to the server. |
NRF_ERROR_BUSY | The client is currently waiting for a reply from a server. |
◆ health_client_fault_test()
uint32_t health_client_fault_test |
( |
health_client_t * |
p_client, |
|
|
uint16_t |
company_id, |
|
|
uint8_t |
test_id, |
|
|
bool |
acked |
|
) |
| |
Requests a server to run a self-test.
- Note
- Response event if
acked
is true:
HEALTH_CLIENT_EVT_TYPE_FAULT_STATUS_RECEIVED
- Parameters
-
[in,out] | p_client | Pointer to the client instance structure. |
[in] | company_id | Company ID of of the server. |
[in] | test_id | ID of the self-test to run. |
[in] | acked | Whether to send the message as an acknowledged message or an unacknowledged message. |
- Return values
-
NRF_SUCCESS | The message was successfully sent to the server. |
NRF_ERROR_BUSY | The client is currently waiting for a reply from a server. |
◆ health_client_period_get()
uint32_t health_client_period_get |
( |
health_client_t * |
p_client | ) |
|
Gets the current health period state of an element.
- Note
- Response event: HEALTH_CLIENT_EVT_TYPE_PERIOD_STATUS_RECEIVED
- Parameters
-
[in,out] | p_client | Pointer to the client instance structure. |
- Return values
-
NRF_SUCCESS | The message was successfully sent to the server. |
NRF_ERROR_BUSY | The client is currently waiting for a reply from a server. |
◆ health_client_period_set()
uint32_t health_client_period_set |
( |
health_client_t * |
p_client, |
|
|
uint8_t |
fast_period_divisor, |
|
|
bool |
acked |
|
) |
| |
Sets the health period state of an element.
- Note
- Response event if
acked
is true:
HEALTH_CLIENT_EVT_TYPE_PERIOD_STATUS_RECEIVED
- Parameters
-
[in,out] | p_client | Pointer to the client instance structure. |
[in] | fast_period_divisor | Value of the fast period divisor. |
[in] | acked | Whether to send the message as an acknowledged message or an unacknowledged message. |
- Return values
-
NRF_SUCCESS | The message was successfully sent to the server. |
NRF_ERROR_BUSY | The client is currently waiting for a reply from a server. |
◆ health_client_attention_get()
uint32_t health_client_attention_get |
( |
health_client_t * |
p_client | ) |
|
Gets the attention timer from a server.
- Note
- Response event: HEALTH_CLIENT_EVT_TYPE_ATTENTION_STATUS_RECEIVED
- Parameters
-
[in,out] | p_client | Pointer to the client instance structure. |
- Return values
-
NRF_SUCCESS | The message was successfully sent to the server. |
NRF_ERROR_BUSY | The client is currently waiting for a reply from a server. |
◆ health_client_attention_set()
uint32_t health_client_attention_set |
( |
health_client_t * |
p_client, |
|
|
uint8_t |
attention_timer, |
|
|
bool |
acked |
|
) |
| |
Sets the attention timer on a server.
- Note
- Response event if
acked
is true:
HEALTH_CLIENT_EVT_TYPE_ATTENTION_STATUS_RECEIVED
- Parameters
-
[in,out] | p_client | Pointer to the client instance structure. |
[in] | attention_timer | How long the attention state should be active in the server in seconds. |
[in] | acked | Whether to send the message as an acknowledged message or an unacknowledged message. |
- Return values
-
NRF_SUCCESS | The message was successfully sent to the server. |
NRF_ERROR_BUSY | The client is currently waiting for a reply from a server. |
◆ health_client_init()
uint32_t health_client_init |
( |
health_client_t * |
p_client, |
|
|
uint16_t |
element_index, |
|
|
health_client_evt_cb_t |
evt_handler |
|
) |
| |
Initializes a health client instance.
- Parameters
-
[in,out] | p_client | Pointer to the client instance structure. |
[in] | element_index | Index of the element to register the model with. |
[in] | evt_handler | Event handler used to process incoming messages. |
- Return values
-
NRF_SUCCESS | The health client was successfully initialized. |
NRF_ERROR_NULL | The pointer passed as the evt_handler argument was NULL . |
NRF_ERROR_NO_MEM | There was not enough memory available to allocate a subscription list for the model. |
- See also
- access_model_add()
◆ health_client_pending_msg_cancel()
void health_client_pending_msg_cancel |
( |
health_client_t * |
p_client | ) |
|
Cancel any ongoing reliable message transfer.
- Parameters
-
[in,out] | p_client | Pointer to the client instance structure. |