Bluetooth: Mesh: Don't send health status messages if a test fails

The test failure may be e.g. because of an unknown company id, and in
that case the spec expects us to ignore the message.

With this patch it should be possible to pass MESH/SR/HM/RFS/BI-01-C.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-09-28 23:21:53 +03:00 committed by Johan Hedberg
commit a576c4a73b

View file

@ -216,7 +216,13 @@ static void health_fault_test(struct bt_mesh_model *model,
BT_DBG("test 0x%02x company 0x%04x", test_id, company_id);
if (srv->fault_test) {
srv->fault_test(model, test_id, company_id);
int err;
err = srv->fault_test(model, test_id, company_id);
if (err) {
BT_WARN("Running fault test failed with err %d", err);
return;
}
}
health_get_registered(model, company_id, msg);