mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-06 22:57:22 +00:00
mesh: set company id field in health status message
X-Original-Commit: c72a57836bfe4b20c864854a1fb50002c902b33e
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user