Health Server
The Health Server model provides attention callbacks and node diagnostics for Health Client models. It is primarily used to report faults in the mesh node and map the mesh nodes to their physical location.
If it exists, the Health Server model must be instantiated on the primary element.
Faults
The Health Server model may report a list of faults that have occurred in the device’s lifetime. Typically, the faults are events or conditions that may alter the behavior of the node, like power outages or faulty peripherals. Faults are split into warnings and errors. Warnings indicate conditions that are close to the limits of what the node is designed to withstand, but not necessarily damaging to the device. Errors indicate conditions that are outside of the node’s design limits, and may have caused invalid behavior or permanent damage to the device.
Fault values 0x01
to 0x7f
are reserved for the Bluetooth Mesh
specification, and the full list of specification defined faults are available
in Health Faults. Fault values 0x80
to 0xff
are
vendor specific. The list of faults are always reported with a company ID to
help interpreting the vendor specific faults.
Attention State
The attention state is used to make the device call attention to itself through some physical behavior like blinking, playing a sound or vibrating. The attention state may be used during provisioning to let the user know which device they’re provisioning, as well as through the Health models at runtime.
The attention state is always assigned a timeout in the range of one to 255
seconds when enabled. The Health Server API provides two callbacks for the
application to run their attention calling behavior:
bt_mesh_health_srv_cb.attn_on
is called at the beginning of the
attention period, bt_mesh_health_srv_cb.attn_off
is called at
the end.
The remaining time for the attention period may be queried through
bt_mesh_health_srv.attn_timer
.
API Reference
- group bt_mesh_health_srv
Health Server Model.
Defines
-
BT_MESH_HEALTH_PUB_DEFINE(_name, _max_faults)
A helper to define a health publication context
- Parameters:
_name – Name given to the publication context variable.
_max_faults – Maximum number of faults the element can have.
-
BT_MESH_MODEL_HEALTH_SRV(srv, pub)
Define a new health server model. Note that this API needs to be repeated for each element that the application wants to have a health server model on. Each instance also needs a unique bt_mesh_health_srv and bt_mesh_model_pub context.
- Parameters:
srv – Pointer to a unique struct bt_mesh_health_srv.
pub – Pointer to a unique struct bt_mesh_model_pub.
- Returns:
New mesh model instance.
-
BT_MESH_HEALTH_TEST_INFO_METADATA_ID
Health Test Information Metadata ID.
-
BT_MESH_HEALTH_TEST_INFO_METADATA(tests)
-
BT_MESH_HEALTH_TEST_INFO(cid, tests...)
Define a Health Test Info Metadata array.
- Parameters:
cid – Company ID of the Health Test suite.
tests – A comma separated list of tests.
- Returns:
A comma separated list of values that make Health Test Info Metadata
Functions
-
int bt_mesh_health_srv_fault_update(struct bt_mesh_elem *elem)
Notify the stack that the fault array state of the given element has changed.
This prompts the Health server on this element to publish the current fault array if periodic publishing is disabled.
- Parameters:
elem – Element to update the fault state of.
- Returns:
0 on success, or (negative) error code otherwise.
-
struct bt_mesh_health_srv_cb
Callback function for the Health Server model
-
struct bt_mesh_health_srv
Mesh Health Server Model Context
-
BT_MESH_HEALTH_PUB_DEFINE(_name, _max_faults)
Health Faults
Fault values defined by the Bluetooth Mesh specification.
- group bt_mesh_health_faults
List of specification defined Health fault values.
Defines
-
BT_MESH_HEALTH_FAULT_NO_FAULT
No fault has occurred.
-
BT_MESH_HEALTH_FAULT_BATTERY_LOW_WARNING
-
BT_MESH_HEALTH_FAULT_BATTERY_LOW_ERROR
-
BT_MESH_HEALTH_FAULT_SUPPLY_VOLTAGE_TOO_LOW_WARNING
-
BT_MESH_HEALTH_FAULT_SUPPLY_VOLTAGE_TOO_LOW_ERROR
-
BT_MESH_HEALTH_FAULT_SUPPLY_VOLTAGE_TOO_HIGH_WARNING
-
BT_MESH_HEALTH_FAULT_SUPPLY_VOLTAGE_TOO_HIGH_ERROR
-
BT_MESH_HEALTH_FAULT_POWER_SUPPLY_INTERRUPTED_WARNING
-
BT_MESH_HEALTH_FAULT_POWER_SUPPLY_INTERRUPTED_ERROR
-
BT_MESH_HEALTH_FAULT_NO_LOAD_WARNING
-
BT_MESH_HEALTH_FAULT_NO_LOAD_ERROR
-
BT_MESH_HEALTH_FAULT_OVERLOAD_WARNING
-
BT_MESH_HEALTH_FAULT_OVERLOAD_ERROR
-
BT_MESH_HEALTH_FAULT_OVERHEAT_WARNING
-
BT_MESH_HEALTH_FAULT_OVERHEAT_ERROR
-
BT_MESH_HEALTH_FAULT_CONDENSATION_WARNING
-
BT_MESH_HEALTH_FAULT_CONDENSATION_ERROR
-
BT_MESH_HEALTH_FAULT_VIBRATION_WARNING
-
BT_MESH_HEALTH_FAULT_VIBRATION_ERROR
-
BT_MESH_HEALTH_FAULT_CONFIGURATION_WARNING
-
BT_MESH_HEALTH_FAULT_CONFIGURATION_ERROR
-
BT_MESH_HEALTH_FAULT_ELEMENT_NOT_CALIBRATED_WARNING
-
BT_MESH_HEALTH_FAULT_ELEMENT_NOT_CALIBRATED_ERROR
-
BT_MESH_HEALTH_FAULT_MEMORY_WARNING
-
BT_MESH_HEALTH_FAULT_MEMORY_ERROR
-
BT_MESH_HEALTH_FAULT_SELF_TEST_WARNING
-
BT_MESH_HEALTH_FAULT_SELF_TEST_ERROR
-
BT_MESH_HEALTH_FAULT_INPUT_TOO_LOW_WARNING
-
BT_MESH_HEALTH_FAULT_INPUT_TOO_LOW_ERROR
-
BT_MESH_HEALTH_FAULT_INPUT_TOO_HIGH_WARNING
-
BT_MESH_HEALTH_FAULT_INPUT_TOO_HIGH_ERROR
-
BT_MESH_HEALTH_FAULT_INPUT_NO_CHANGE_WARNING
-
BT_MESH_HEALTH_FAULT_INPUT_NO_CHANGE_ERROR
-
BT_MESH_HEALTH_FAULT_ACTUATOR_BLOCKED_WARNING
-
BT_MESH_HEALTH_FAULT_ACTUATOR_BLOCKED_ERROR
-
BT_MESH_HEALTH_FAULT_HOUSING_OPENED_WARNING
-
BT_MESH_HEALTH_FAULT_HOUSING_OPENED_ERROR
-
BT_MESH_HEALTH_FAULT_TAMPER_WARNING
-
BT_MESH_HEALTH_FAULT_TAMPER_ERROR
-
BT_MESH_HEALTH_FAULT_DEVICE_MOVED_WARNING
-
BT_MESH_HEALTH_FAULT_DEVICE_MOVED_ERROR
-
BT_MESH_HEALTH_FAULT_DEVICE_DROPPED_WARNING
-
BT_MESH_HEALTH_FAULT_DEVICE_DROPPED_ERROR
-
BT_MESH_HEALTH_FAULT_OVERFLOW_WARNING
-
BT_MESH_HEALTH_FAULT_OVERFLOW_ERROR
-
BT_MESH_HEALTH_FAULT_EMPTY_WARNING
-
BT_MESH_HEALTH_FAULT_EMPTY_ERROR
-
BT_MESH_HEALTH_FAULT_INTERNAL_BUS_WARNING
-
BT_MESH_HEALTH_FAULT_INTERNAL_BUS_ERROR
-
BT_MESH_HEALTH_FAULT_MECHANISM_JAMMED_WARNING
-
BT_MESH_HEALTH_FAULT_MECHANISM_JAMMED_ERROR
-
BT_MESH_HEALTH_FAULT_VENDOR_SPECIFIC_START
Start of the vendor specific fault values.
All values below this are reserved for the Bluetooth Specification.
-
BT_MESH_HEALTH_FAULT_NO_FAULT