From 02b43a9eb385019a042b303b64ba365966113831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Narajowski?= Date: Wed, 20 Sep 2017 11:11:00 +0200 Subject: [PATCH] mesh: set company id field in health status message X-Original-Commit: c72a57836bfe4b20c864854a1fb50002c902b33e --- nimble/host/mesh/src/health.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nimble/host/mesh/src/health.c b/nimble/host/mesh/src/health.c index 64f8813ad..3098f7093 100644 --- a/nimble/host/mesh/src/health.c +++ b/nimble/host/mesh/src/health.c @@ -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; }