Re: BT Mesh Health Server Fault Register #zephyrbluetoothmesh #bluetoothmesh


Johan Hedberg
 

Hi,

On 3 Apr 2019, at 19.13, William Fish <@WilliamFish> wrote:
I am looking at the BT Mesh Health Server, and Client, so that i can report faults between nodes and ultimately to the central control application.

Unfortunately, i have run into a problem; How do I register a fault? Now the nice people over at Nordic have a few handy functions that allow me to add/set/clear faults but I'm at a loss with the Zephyr implementation.

Nordic SDK Functions
void health_server_fault_register(health_server_t * p_server, uint8_t fault_code);
void health_server_fault_clear(health_server_t * p_server, uint8_t fault_code);
bool health_server_fault_is_set(health_server_t * p_server, uint8_t fault_code);
The Zephyr mesh health server leaves fault registration up to the application, however you do need to register a bt_mesh_health_srv_cb struct which includes callbacks for retrieving the faults, clearing them, etc (these are called whenever the stack needs them). Take a look at e.g. how this is done in the mesh shell in subsys/bluetooth/host/mesh/shell.c.

Johan

Join devel@lists.zephyrproject.org to automatically receive all group messages.