mesh: set company id field in health status message

X-Original-Commit: c72a57836bfe4b20c864854a1fb50002c902b33e
This commit is contained in:
Michał Narajowski
2017-09-21 15:01:18 +02:00
parent 810eb2e03a
commit 02b43a9eb3
+4 -2
View File
@@ -74,6 +74,7 @@ static size_t health_get_current(struct bt_mesh_model *mod,
struct os_mbuf *msg)
{
struct bt_mesh_health *srv = mod->user_data;
const struct bt_mesh_comp *comp;
u8_t *test_id, *company_ptr;
u16_t company_id;
u8_t fault_count;
@@ -83,6 +84,7 @@ static size_t health_get_current(struct bt_mesh_model *mod,
test_id = net_buf_simple_add(msg, 1);
company_ptr = net_buf_simple_add(msg, sizeof(company_id));
comp = bt_mesh_comp_get();
fault_count = net_buf_simple_tailroom(msg) - 4;
@@ -92,7 +94,7 @@ static size_t health_get_current(struct bt_mesh_model *mod,
&fault_count);
if (err) {
BT_ERR("Failed to get faults (err %d)", err);
sys_put_le16(0, company_ptr);
sys_put_le16(comp->cid, company_ptr);
*test_id = HEALTH_TEST_STANDARD;
fault_count = 0;
} else {
@@ -100,7 +102,7 @@ static size_t health_get_current(struct bt_mesh_model *mod,
}
} else {
BT_WARN("No callback for getting faults");
sys_put_le16(0, company_ptr);
sys_put_le16(comp->cid, company_ptr);
*test_id = HEALTH_TEST_STANDARD;
fault_count = 0;
}