Bluetooth: Mesh: shell: Fix sending health publication
We need to send out a Health Fault Current Status (the Health Model's publication message) when all faults are cleared. The logic for calculating number of faults was also wrong after the updated model publication API. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
aa930f3f94
commit
c2fd67699d
2 changed files with 3 additions and 4 deletions
|
@ -81,9 +81,8 @@ static size_t health_get_current(struct bt_mesh_model *mod,
|
|||
company_ptr = net_buf_simple_add(msg, sizeof(company_id));
|
||||
comp = bt_mesh_comp_get();
|
||||
|
||||
fault_count = net_buf_simple_tailroom(msg) - 4;
|
||||
|
||||
if (srv->cb && srv->cb->fault_get_cur) {
|
||||
fault_count = net_buf_simple_tailroom(msg);
|
||||
err = srv->cb->fault_get_cur(mod, test_id, &company_id,
|
||||
net_buf_simple_tail(msg),
|
||||
&fault_count);
|
||||
|
@ -358,8 +357,7 @@ int bt_mesh_fault_update(struct bt_mesh_elem *elem)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
k_delayed_work_submit(&mod->pub->timer, K_NO_WAIT);
|
||||
return 0;
|
||||
return bt_mesh_model_publish(mod);
|
||||
}
|
||||
|
||||
static void attention_off(struct k_work *work)
|
||||
|
|
|
@ -1750,6 +1750,7 @@ static int cmd_del_fault(int argc, char *argv[])
|
|||
if (argc < 2) {
|
||||
memset(cur_faults, 0, sizeof(cur_faults));
|
||||
printk("All current faults cleared\n");
|
||||
bt_mesh_fault_update(&elements[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue