diff --git a/components/bt/esp_ble_mesh/mesh_core/access.c b/components/bt/esp_ble_mesh/mesh_core/access.c index b48266755..484e70aa4 100644 --- a/components/bt/esp_ble_mesh/mesh_core/access.c +++ b/components/bt/esp_ble_mesh/mesh_core/access.c @@ -627,7 +627,7 @@ void bt_mesh_comp_provision(u16_t addr) dev_primary_addr = addr; - BT_INFO("addr 0x%04x elem_count %u", addr, dev_comp->elem_count); + BT_INFO("Primary address 0x%04x, element count %u", addr, dev_comp->elem_count); for (i = 0; i < dev_comp->elem_count; i++) { struct bt_mesh_elem *elem = &dev_comp->elem[i]; @@ -842,7 +842,7 @@ void bt_mesh_model_recv(struct bt_mesh_net_rx *rx, struct net_buf_simple *buf) return; } - BT_INFO("OpCode 0x%08x", opcode); + BT_DBG("OpCode 0x%08x", opcode); for (i = 0; i < dev_comp->elem_count; i++) { struct bt_mesh_elem *elem = &dev_comp->elem[i]; @@ -967,8 +967,8 @@ static int model_send(struct bt_mesh_model *model, return -EINVAL; } - BT_INFO("net_idx 0x%04x app_idx 0x%04x dst 0x%04x", tx->ctx->net_idx, - tx->ctx->app_idx, tx->ctx->addr); + BT_INFO("app_idx 0x%04x src 0x%04x dst 0x%04x", + tx->ctx->app_idx, tx->src, tx->ctx->addr); BT_INFO("len %u: %s", msg->len, bt_hex(msg->data, msg->len)); if (!ready_to_send(role, tx->ctx->addr)) { diff --git a/components/bt/esp_ble_mesh/mesh_core/beacon.c b/components/bt/esp_ble_mesh/mesh_core/beacon.c index 0dd02a1ad..2f53aa49f 100644 --- a/components/bt/esp_ble_mesh/mesh_core/beacon.c +++ b/components/bt/esp_ble_mesh/mesh_core/beacon.c @@ -102,10 +102,10 @@ void bt_mesh_beacon_create(struct bt_mesh_subnet *sub, net_buf_simple_add_mem(buf, sub->auth, 8); - BT_INFO("net_idx 0x%04x flags 0x%02x NetID %s", sub->net_idx, - flags, bt_hex(keys->net_id, 8)); - BT_INFO("IV Index 0x%08x Auth %s", bt_mesh.iv_index, - bt_hex(sub->auth, 8)); + BT_INFO("net_idx 0x%03x iv_index 0x%08x flags 0x%02x", + sub->net_idx, bt_mesh.iv_index, flags); + BT_DBG("NetID %s Auth %s", bt_hex(keys->net_id, 8), + bt_hex(sub->auth, 8)); } /* If the interval has passed or is within 5 seconds from now send a beacon */ @@ -357,8 +357,8 @@ static void secure_beacon_recv(struct net_buf_simple *buf) goto update_stats; } - BT_INFO("net_idx 0x%04x iv_index 0x%08x, current iv_index 0x%08x", - sub->net_idx, iv_index, bt_mesh.iv_index); + BT_INFO("net_idx 0x%03x iv_index 0x%08x current iv_index 0x%08x", + sub->net_idx, iv_index, bt_mesh.iv_index); if (bt_mesh_atomic_test_bit(bt_mesh.flags, BLE_MESH_IVU_INITIATOR) && (bt_mesh_atomic_test_bit(bt_mesh.flags, BLE_MESH_IVU_IN_PROGRESS) == diff --git a/components/bt/esp_ble_mesh/mesh_core/provisioner_main.c b/components/bt/esp_ble_mesh/mesh_core/provisioner_main.c index 16450854d..feaf93a95 100644 --- a/components/bt/esp_ble_mesh/mesh_core/provisioner_main.c +++ b/components/bt/esp_ble_mesh/mesh_core/provisioner_main.c @@ -157,8 +157,8 @@ int bt_mesh_provisioner_net_create(void) } done: - BT_INFO("net_idx 0x%03x, netkey %s, nid 0x%02x", - sub->net_idx, bt_hex(sub->keys[0].net, 16), sub->keys[0].nid); + BT_INFO("NetKey Index 0x%03x, NID 0x%02x", sub->net_idx, sub->keys[0].nid); + BT_INFO("NetKey %s", bt_hex(sub->keys[0].net, 16)); return 0; } @@ -303,7 +303,7 @@ static int provisioner_store_node(struct bt_mesh_node *node, bool store, u16_t * } } - BT_ERR("%s, Node queue is full", __func__); + BT_ERR("Node is full!"); bt_mesh_provisioner_unlock(); return -ENOMEM; } @@ -355,7 +355,7 @@ static int provisioner_remove_node(u16_t index, bool erase) struct bt_mesh_node *node = NULL; int i; - BT_DBG("%s, reset node %d", __func__, index); + BT_DBG("Remove node %d", index); bt_mesh_provisioner_lock(); @@ -441,7 +441,7 @@ int bt_mesh_provisioner_remove_node(const u8_t uuid[16]) node = provisioner_find_node_with_uuid(uuid, &index); if (!node) { - BT_WARN("Node %s not exist", bt_hex(uuid, 16)); + BT_WARN("%s, Node not exists, uuid %s", __func__, bt_hex(uuid, 16)); return -ENODEV; } @@ -485,7 +485,7 @@ int bt_mesh_provisioner_restore_node_name(u16_t addr, const char *name) node = provisioner_find_node_with_addr(addr, NULL); if (node == NULL) { - BT_ERR("%s, Node 0x%04x not exist", __func__, addr); + BT_ERR("%s, Node not exists, addr 0x%04x", __func__, addr); return -ENODEV; } @@ -506,7 +506,7 @@ int bt_mesh_provisioner_restore_node_comp_data(u16_t addr, const u8_t *data, u16 node = provisioner_find_node_with_addr(addr, NULL); if (node == NULL) { - BT_ERR("%s, Node 0x%04x not exist", __func__, addr); + BT_ERR("%s, Node not exists, addr 0x%04x", __func__, addr); return -ENODEV; } @@ -539,7 +539,7 @@ int bt_mesh_provisioner_delete_node_with_uuid(const u8_t uuid[16]) node = provisioner_find_node_with_uuid(uuid, &index); if (!node) { - BT_WARN("Node %s not exist", bt_hex(uuid, 16)); + BT_WARN("%s, Node not exists, uuid %s", __func__, bt_hex(uuid, 16)); return -ENODEV; } @@ -554,7 +554,7 @@ int bt_mesh_provisioner_delete_node_with_node_addr(u16_t unicast_addr) node = provisioner_find_node_with_addr(unicast_addr, &index); if (!node) { - BT_WARN("Node 0x%04x not exist", unicast_addr); + BT_WARN("%s, Node not exists, addr 0x%04x", __func__, unicast_addr); return -ENODEV; } @@ -587,7 +587,7 @@ static int provisioner_check_node_index(u16_t index) } if (mesh_nodes[index] == NULL) { - BT_ERR("%s, Node %d is not found", __func__, index); + BT_ERR("%s, Node not exists, index %d", __func__, index); return -ENODEV; } @@ -607,11 +607,10 @@ int bt_mesh_provisioner_set_node_name(u16_t index, const char *name) } if (provisioner_check_node_index(index)) { - BT_ERR("%s, Failed to check node index", __func__); return -EINVAL; } - BT_DBG("name len is %d, name is %s", strlen(name), name); + BT_DBG("len %d, name %s", strlen(name), name); length = (strlen(name) <= BLE_MESH_NODE_NAME_SIZE) ? strlen(name) : BLE_MESH_NODE_NAME_SIZE; for (i = 0; i < ARRAY_SIZE(mesh_nodes); i++) { @@ -621,7 +620,7 @@ int bt_mesh_provisioner_set_node_name(u16_t index, const char *name) continue; } if (!strncmp(mesh_nodes[i]->name, name, length)) { - BT_WARN("Node name %s already exists", name); + BT_WARN("Node name %s exists", name); return -EEXIST; } } @@ -642,7 +641,6 @@ const char *bt_mesh_provisioner_get_node_name(u16_t index) BT_DBG("%s", __func__); if (provisioner_check_node_index(index)) { - BT_ERR("%s, Failed to check node index", __func__); return NULL; } @@ -674,7 +672,7 @@ u16_t bt_mesh_provisioner_get_node_index(const char *name) } } - BT_ERR("%s, Node name %s not exist", __func__, name); + BT_ERR("Node name %s not exists", name); return BLE_MESH_INVALID_NODE_INDEX; } @@ -691,7 +689,7 @@ int bt_mesh_provisioner_store_node_comp_data(u16_t addr, const u8_t *data, u16_t node = provisioner_find_node_with_addr(addr, &index); if (node == NULL) { - BT_ERR("%s, Node 0x%04x not exist", __func__, addr); + BT_ERR("%s, Node not exists, addr 0x%04x", __func__, addr); return -ENODEV; } @@ -701,7 +699,7 @@ int bt_mesh_provisioner_store_node_comp_data(u16_t addr, const u8_t *data, u16_t return -ENOMEM; } - BT_DBG("%s, index %d", __func__, index); + BT_DBG("node index %d", index); memcpy(node->comp_data, data, length); node->comp_length = length; @@ -955,7 +953,7 @@ int bt_mesh_provisioner_local_app_key_add(const u8_t app_key[16], u16_t net_idx, int add = -1; if (bt_mesh.p_app_idx_next >= 0x1000) { - BT_ERR("%s, No AppKey Index available", __func__); + BT_ERR("No AppKey Index available"); return -EIO; } @@ -966,31 +964,31 @@ int bt_mesh_provisioner_local_app_key_add(const u8_t app_key[16], u16_t net_idx, /* Check if the same application key already exists */ if (provisioner_check_app_key(app_key, app_idx)) { - BT_WARN("AppKey already exists, AppKey Index updated"); + BT_WARN("AppKey exists, AppKey Index updated"); return 0; } /* Check if the net_idx exists */ if (provisioner_check_net_idx(net_idx, false)) { - BT_ERR("%s, NetKey Index does not exist", __func__); + BT_ERR("%s, NetKey Index 0x%03x not exists", __func__, net_idx); return -ENODEV; } /* Check if the same app_idx already exists */ if (provisioner_check_app_idx(*app_idx, true)) { - BT_ERR("%s, AppKey Index already exists", __func__); + BT_ERR("%s, AppKey Index 0x%03x exists", __func__, *app_idx); return -EEXIST; } add = provisioner_check_app_key_full(); if (add < 0) { - BT_ERR("%s, AppKey queue is full", __func__); + BT_ERR("AppKey is full!"); return -ENOMEM; } if (!app_key) { if (bt_mesh_rand(p_key, 16)) { - BT_ERR("%s, Failed to generate AppKey", __func__); + BT_ERR("Failed to generate AppKey"); return -EIO; } } else { @@ -1020,7 +1018,7 @@ int bt_mesh_provisioner_local_app_key_add(const u8_t app_key[16], u16_t net_idx, if (provisioner_check_app_idx(key->app_idx, true)) { key->app_idx = (++bt_mesh.p_app_idx_next); if (key->app_idx >= 0x1000) { - BT_ERR("%s, No AppKey Index available", __func__); + BT_ERR("No AppKey Index available"); bt_mesh_free(key); return -EIO; } @@ -1056,13 +1054,13 @@ int bt_mesh_provisioner_local_app_key_update(const u8_t app_key[16], u16_t net_i /* Check if the net_idx exists */ if (provisioner_check_net_idx(net_idx, false)) { - BT_ERR("%s, NetKey Index 0x%03x not exist", __func__, net_idx); + BT_ERR("%s, NetKey Index 0x%03x not exists", __func__, net_idx); return -ENODEV; } key = bt_mesh_provisioner_app_key_find(app_idx); if (key == NULL) { - BT_ERR("%s, AppKey 0x%03x not exist", __func__, app_idx); + BT_ERR("%s, AppKey Index 0x%03x not exists", __func__, app_idx); return -ENODEV; } @@ -1093,12 +1091,12 @@ const u8_t *bt_mesh_provisioner_local_app_key_get(u16_t net_idx, u16_t app_idx) BT_DBG("%s", __func__); if (provisioner_check_net_idx(net_idx, false)) { - BT_ERR("%s, NetKey Index does not exist", __func__); + BT_ERR("%s, NetKey Index 0x%03x not exists", __func__, net_idx); return NULL; } if (provisioner_check_app_idx(app_idx, false)) { - BT_ERR("%s, AppKey Index does not exist", __func__); + BT_ERR("%s, AppKey Index 0x%03x not exists", __func__, app_idx); return NULL; } @@ -1149,7 +1147,7 @@ static void model_unbind(struct bt_mesh_model *model, u16_t app_idx) { int i; - BT_DBG("model %p key_idx 0x%03x", model, app_idx); + BT_DBG("model %p app_idx 0x%03x", model, app_idx); for (i = 0; i < ARRAY_SIZE(model->keys); i++) { if (model->keys[i] != app_idx) { @@ -1182,12 +1180,12 @@ int bt_mesh_provisioner_local_app_key_delete(u16_t net_idx, u16_t app_idx) BT_DBG("%s", __func__); if (provisioner_check_net_idx(net_idx, false)) { - BT_ERR("%s, NetKey Index does not exist", __func__); + BT_ERR("%s, NetKey Index 0x%03x not exists", __func__, net_idx); return -ENODEV; } if (provisioner_check_app_idx(app_idx, false)) { - BT_ERR("%s, AppKey Index does not exist", __func__); + BT_ERR("%s, AppKey Index 0x%03x not exists", __func__, app_idx); return -ENODEV; } @@ -1219,7 +1217,7 @@ int bt_mesh_provisioner_local_net_key_add(const u8_t net_key[16], u16_t *net_idx int add = -1; if (bt_mesh.p_net_idx_next >= 0x1000) { - BT_ERR("%s, No NetKey Index available", __func__); + BT_ERR("No NetKey Index available"); return -EIO; } @@ -1230,25 +1228,25 @@ int bt_mesh_provisioner_local_net_key_add(const u8_t net_key[16], u16_t *net_idx /* Check if the same network key already exists */ if (provisioner_check_net_key(net_key, net_idx)) { - BT_WARN("NetKey already exists, NetKey Index updated"); + BT_WARN("NetKey exists, NetKey Index updated"); return 0; } /* Check if the same net_idx already exists */ if (provisioner_check_net_idx(*net_idx, true)) { - BT_ERR("%s, NetKey Index already exists", __func__); + BT_ERR("%s, NetKey Index 0x%03x exists", __func__, *net_idx); return -EEXIST; } add = provisioner_check_net_key_full(); if (add < 0) { - BT_ERR("%s, NetKey queue is full", __func__); + BT_ERR("NetKey is full!"); return -ENOMEM; } if (!net_key) { if (bt_mesh_rand(p_key, 16)) { - BT_ERR("%s, Failed to generate NetKey", __func__); + BT_ERR("Failed to generate NetKey"); return -EIO; } } else { @@ -1275,7 +1273,7 @@ int bt_mesh_provisioner_local_net_key_add(const u8_t net_key[16], u16_t *net_idx if (provisioner_check_net_idx(sub->net_idx, true)) { sub->net_idx = (++bt_mesh.p_net_idx_next); if (sub->net_idx >= 0x1000) { - BT_ERR("%s, No NetKey Index available", __func__); + BT_ERR("No NetKey Index available"); bt_mesh_free(sub); return -EIO; } @@ -1313,7 +1311,7 @@ int bt_mesh_provisioner_local_net_key_update(const u8_t net_key[16], u16_t net_i sub = bt_mesh_provisioner_subnet_get(net_idx); if (sub == NULL) { - BT_ERR("%s, NetKey 0x%03x not exist", __func__, net_idx); + BT_ERR("%s, NetKey Index 0x%03x not exists", __func__, net_idx); return -ENODEV; } @@ -1351,7 +1349,7 @@ const u8_t *bt_mesh_provisioner_local_net_key_get(u16_t net_idx) BT_DBG("%s", __func__); if (provisioner_check_net_idx(net_idx, false)) { - BT_ERR("%s, NetKey Index does not exist", __func__); + BT_ERR("%s, NetKey Index 0x%03x not exists", __func__, net_idx); return NULL; } @@ -1376,7 +1374,7 @@ int bt_mesh_provisioner_local_net_key_delete(u16_t net_idx) BT_DBG("%s", __func__); if (provisioner_check_net_idx(net_idx, false)) { - BT_ERR("%s, NetKey Index does not exist", __func__); + BT_ERR("%s, NetKey Index 0x%03x not exists", __func__, net_idx); return -ENODEV; } @@ -1414,7 +1412,7 @@ int bt_mesh_provisioner_bind_local_model_app_idx(u16_t elem_addr, u16_t mod_id, elem = bt_mesh_elem_find(elem_addr); if (!elem) { - BT_ERR("%s, No element is found", __func__); + BT_ERR("%s, No element found, addr 0x%04x", __func__, elem_addr); return -ENODEV; } @@ -1429,13 +1427,13 @@ int bt_mesh_provisioner_bind_local_model_app_idx(u16_t elem_addr, u16_t mod_id, } if (provisioner_check_app_idx(app_idx, false)) { - BT_ERR("%s, AppKey Index does not exist", __func__); + BT_ERR("%s, AppKey Index 0x%03x not exists", __func__, app_idx); return -ENODEV; } for (i = 0; i < ARRAY_SIZE(model->keys); i++) { if (model->keys[i] == app_idx) { - BT_WARN("AppKey 0x%03x is already bound to model", app_idx); + BT_INFO("AppKey 0x%03x already bound to model", app_idx); return 0; } } @@ -1451,7 +1449,7 @@ int bt_mesh_provisioner_bind_local_model_app_idx(u16_t elem_addr, u16_t mod_id, } } - BT_ERR("%s, Model AppKey queue is full", __func__); + BT_ERR("Model bound is full!"); return -ENOMEM; } @@ -1663,7 +1661,7 @@ const u8_t *bt_mesh_get_fast_prov_net_key(u16_t net_idx) sub = bt_mesh_fast_prov_subnet_get(net_idx); if (!sub) { - BT_ERR("%s, Failed to get subnet", __func__); + BT_ERR("%s, NetKey Index 0x%03x not exists", __func__, net_idx); return NULL; } @@ -1676,7 +1674,7 @@ const u8_t *bt_mesh_get_fast_prov_app_key(u16_t net_idx, u16_t app_idx) key = bt_mesh_fast_prov_app_key_find(app_idx); if (!key) { - BT_ERR("%s, Failed to get AppKey", __func__); + BT_ERR("%s, AppKey Index 0x%03x not exists", __func__, app_idx); return NULL; } diff --git a/components/bt/esp_ble_mesh/mesh_core/settings.c b/components/bt/esp_ble_mesh/mesh_core/settings.c index f145b1d90..a7f564024 100644 --- a/components/bt/esp_ble_mesh/mesh_core/settings.c +++ b/components/bt/esp_ble_mesh/mesh_core/settings.c @@ -178,6 +178,7 @@ static int role_set(const char *name) err = bt_mesh_load_core_settings(name, (u8_t *)bt_mesh.flags, sizeof(bt_mesh.flags), &exist); if (err) { + BT_ERR("Failed to load mesh device role"); return err; } @@ -185,8 +186,6 @@ static int role_set(const char *name) return 0; } - BT_INFO("Restored mesh device role %lu", bt_mesh_atomic_get(bt_mesh.flags) & DEVICE_ROLE_BITS); - return 0; } @@ -200,7 +199,7 @@ static int net_set(const char *name) err = bt_mesh_load_core_settings(name, (u8_t *)&net, sizeof(net), &exist); if (err) { - BT_WARN("%s, Clear NET", __func__); + BT_ERR("Failed to load node net info"); memset(bt_mesh.dev_key, 0, sizeof(bt_mesh.dev_key)); bt_mesh_comp_unprovision(); return 0; @@ -213,7 +212,7 @@ static int net_set(const char *name) memcpy(bt_mesh.dev_key, net.dev_key, sizeof(bt_mesh.dev_key)); bt_mesh_comp_provision(net.primary_addr); - BT_INFO("Restored primary address 0x%04x", net.primary_addr); + BT_INFO("Restored Primary Address 0x%04x", net.primary_addr); BT_INFO("Restored DevKey %s", bt_hex(bt_mesh.dev_key, 16)); return 0; @@ -229,7 +228,7 @@ static int iv_set(const char *name) err = bt_mesh_load_core_settings(name, (u8_t *)&iv, sizeof(iv), &exist); if (err) { - BT_WARN("%s, Clear IV", __func__); + BT_ERR("Failed to load iv_index"); bt_mesh.iv_index = 0U; bt_mesh_atomic_clear_bit(bt_mesh.flags, BLE_MESH_IVU_IN_PROGRESS); return 0; @@ -259,7 +258,7 @@ static int seq_set(const char *name) err = bt_mesh_load_core_settings(name, (u8_t *)&seq, sizeof(seq), &exist); if (err) { - BT_WARN("%s, Clear SEQ", __func__); + BT_ERR("Failed to load sequence number"); bt_mesh.seq = 0U; return 0; } @@ -338,7 +337,7 @@ static int rpl_set(const char *name) err = bt_mesh_load_core_settings(get, (u8_t *)&rpl, sizeof(rpl), &exist); if (err) { - BT_ERR("%s, Failed to load RPL %s, reset RPL", __func__, get); + BT_ERR("Failed to load RPL entry 0x%04x", src); bt_mesh_rpl_reset(); goto free; } @@ -357,7 +356,7 @@ static int rpl_set(const char *name) } } - BT_INFO("Restored RPL 0x%04x: Seq 0x%06x, old_iv %u", src, rpl.seq, rpl.old_iv); + BT_INFO("Restored RPL entry 0x%04x: seq 0x%06x, old_iv %u", src, rpl.seq, rpl.old_iv); entry->src = src; entry->seq = rpl.seq; entry->old_iv = rpl.old_iv; @@ -408,7 +407,7 @@ static int net_key_set(const char *name) err = bt_mesh_load_core_settings(get, (u8_t *)&key, sizeof(key), &exist); if (err) { - BT_ERR("%s, Failed to load NetKey %s", __func__, get); + BT_ERR("%s, Failed to load NetKey 0x%03x", __func__, net_idx); goto free; } @@ -426,12 +425,14 @@ static int net_key_set(const char *name) } } - BT_INFO("Restored NetKey Index 0x%03x", net_idx); sub->net_idx = net_idx; sub->kr_flag = key.kr_flag; sub->kr_phase = key.kr_phase; memcpy(sub->keys[0].net, &key.val[0], 16); memcpy(sub->keys[1].net, &key.val[1], 16); + + BT_INFO("Restored NetKey Index 0x%03x", sub->net_idx); + BT_INFO("Restored NetKey %s", bt_hex(sub->keys[0].net, 16)); } free: @@ -466,7 +467,7 @@ static int app_key_set(const char *name) err = bt_mesh_load_core_settings(get, (u8_t *)&key, sizeof(key), &exist); if (err) { - BT_ERR("%s, Failed to load AppKey %s", __func__, get); + BT_ERR("%s, Failed to load AppKey 0x%03x", __func__, app_idx); goto free; } @@ -491,7 +492,6 @@ static int app_key_set(const char *name) } } - BT_INFO("Restored AppKey Index 0x%03x", app_idx); app->net_idx = key.net_idx; app->app_idx = app_idx; app->updated = key.updated; @@ -499,6 +499,10 @@ static int app_key_set(const char *name) memcpy(app->keys[1].val, key.val[1], 16); bt_mesh_app_id(app->keys[0].val, &app->keys[0].id); bt_mesh_app_id(app->keys[1].val, &app->keys[1].id); + + BT_INFO("Restored AppKey Index 0x%03x, NetKey Index 0x%03x", + app->app_idx, app->net_idx); + BT_INFO("Restored AppKey %s", bt_hex(app->keys[0].val, 16)); } free: @@ -522,7 +526,7 @@ static int hb_pub_set(const char *name) err = bt_mesh_load_core_settings(name, (u8_t *)&hb_val, sizeof(hb_val), &exist); if (err) { - BT_WARN("%s, Cleared heartbeat publication", __func__); + BT_ERR("Failed to load heartbeat publication"); hb_pub->dst = BLE_MESH_ADDR_UNASSIGNED; hb_pub->count = 0U; hb_pub->ttl = 0U; @@ -546,7 +550,7 @@ static int hb_pub_set(const char *name) hb_pub->count = 0U; } - BT_INFO("Restored heartbeat publication, dst 0x%04x", hb_pub->dst); + BT_INFO("Restored Heartbeat Publication, dst 0x%04x", hb_pub->dst); return 0; } @@ -568,7 +572,7 @@ static int cfg_set(const char *name) err = bt_mesh_load_core_settings(name, (u8_t *)&val, sizeof(val), &exist); if (err) { - BT_WARN("%s, Cleared configuration", __func__); + BT_ERR("Failed to load configuration state"); stored_cfg.valid = false; return 0; } @@ -579,7 +583,7 @@ static int cfg_set(const char *name) memcpy(&stored_cfg.cfg, &val, sizeof(val)); stored_cfg.valid = true; - BT_INFO("Restored configuration state"); + BT_INFO("Restored Configuration State"); return 0; } @@ -598,7 +602,7 @@ static int model_set_bind(bool vnd, struct bt_mesh_model *model, u16_t model_key sprintf(name, "mesh/%s/%04x/b", vnd ? "v" : "s", model_key); err = bt_mesh_load_core_settings(name, (u8_t *)model->keys, sizeof(model->keys), &exist); if (err) { - BT_ERR("%s, Failed to get model bind keys", __func__); + BT_ERR("Failed to load model bound keys"); return -EIO; } @@ -620,7 +624,7 @@ static int model_set_sub(bool vnd, struct bt_mesh_model *model, u16_t model_key) sprintf(name, "mesh/%s/%04x/s", vnd ? "v" : "s", model_key); err = bt_mesh_load_core_settings(name, (u8_t *)model->groups, sizeof(model->groups), &exist); if (err) { - BT_ERR("%s, Failed to get model subscriptions", __func__); + BT_ERR("Failed to load model subscriptions"); return -EIO; } @@ -635,14 +639,15 @@ static int model_set_pub(bool vnd, struct bt_mesh_model *model, u16_t model_key) int err = 0; if (!model->pub) { - BT_WARN("%s, Model has no publication context", __func__); + BT_INFO("Not support publication, model_id 0x%04x, cid 0x%04x", + vnd ? model->vnd.id : model->id, vnd ? model->vnd.company : 0xFFFF); return 0; } sprintf(name, "mesh/%s/%04x/p", vnd ? "v" : "s", model_key); err = bt_mesh_load_core_settings(name, (u8_t *)&pub, sizeof(pub), &exist); if (err) { - BT_WARN("%s, Cleared model publication", __func__); + BT_ERR("Failed to load model publication"); model->pub->addr = BLE_MESH_ADDR_UNASSIGNED; model->pub->key = 0U; model->pub->cred = 0U; @@ -665,7 +670,7 @@ static int model_set_pub(bool vnd, struct bt_mesh_model *model, u16_t model_key) model->pub->retransmit = pub.retransmit; model->pub->count = 0U; - BT_INFO("Restored model publication, pub_addr 0x%04x, app_idx 0x%03x", + BT_INFO("Restored Model Publication, address 0x%04x, app_idx 0x%03x", pub.addr, pub.key); return 0; @@ -696,27 +701,24 @@ static int model_set(bool vnd, const char *name) model = bt_mesh_model_get(vnd, elem_idx, model_idx); if (!model) { - BT_ERR("%s, Failed to get %s model, elem_idx %u model_idx %u", - __func__, vnd ? "vnd" : "sig", elem_idx, model_idx); + BT_ERR("%s model not found, elem_idx %u, model_idx %u", + vnd ? "vnd" : "sig", elem_idx, model_idx); err = -ENOENT; goto free; } err = model_set_bind(vnd, model, model_key); if (err) { - BT_ERR("%s, model_set_bind fail", __func__); goto free; } err = model_set_sub(vnd, model, model_key); if (err) { - BT_ERR("%s, model_set_sub fail", __func__); goto free; } err = model_set_pub(vnd, model, model_key); if (err) { - BT_ERR("%s, model_set_pub fail", __func__); goto free; } } @@ -763,7 +765,7 @@ static int va_set(const char *name) err = bt_mesh_load_core_settings(get, (u8_t *)&va, sizeof(va), &exist); if (err) { - BT_ERR("%s, Failed to load virtual address %s", __func__, get); + BT_ERR("Failed to load virtual address 0x%04x", index); goto free; } @@ -787,7 +789,7 @@ static int va_set(const char *name) lab->addr = va.addr; lab->ref = va.ref; - BT_INFO("Restored virtual address 0x%04x ref 0x%04x", index, lab->ref); + BT_INFO("Restored Virtual Address 0x%04x, ref 0x%04x", index, lab->ref); } free: @@ -807,7 +809,7 @@ static int p_prov_set(const char *name) err = bt_mesh_load_core_settings(name, (u8_t *)&val, sizeof(val), &exist); if (err) { - BT_ERR("%s, Failed to load Provisioner prov info", __func__); + BT_ERR("Failed to load next address allocation"); return 0; } @@ -817,7 +819,7 @@ static int p_prov_set(const char *name) bt_mesh_provisoner_restore_prov_info(val.primary_addr, val.alloc_addr); - BT_INFO("Restored primary_addr 0x%04x, alloc_addr 0x%04x", + BT_INFO("Restored Primary Address 0x%04x, next address allocation 0x%04x", val.primary_addr, val.alloc_addr); return 0; @@ -833,7 +835,7 @@ static int p_net_idx_set(const char *name) err = bt_mesh_load_core_settings(name, (u8_t *)&net_idx, sizeof(net_idx), &exist); if (err) { - BT_ERR("%s, Failed to load Provisioner keys", __func__); + BT_ERR("Failed to load next net_idx allocation"); return 0; } @@ -843,7 +845,7 @@ static int p_net_idx_set(const char *name) bt_mesh.p_net_idx_next = net_idx; - BT_INFO("Restored p_net_idx_next 0x%04x", bt_mesh.p_net_idx_next); + BT_INFO("Restored next NetKey Index allocation 0x%03x", bt_mesh.p_net_idx_next); return 0; } @@ -858,6 +860,7 @@ static int p_app_idx_set(const char *name) err = bt_mesh_load_core_settings(name, (u8_t *)&app_idx, sizeof(app_idx), &exist); if (err) { + BT_ERR("Failed to load next app_idx allocation"); return 0; } @@ -867,7 +870,7 @@ static int p_app_idx_set(const char *name) bt_mesh.p_app_idx_next = app_idx; - BT_INFO("Restored p_app_idx_next 0x%04x", bt_mesh.p_app_idx_next); + BT_INFO("Restored next AppKey Index allocation 0x%03x", bt_mesh.p_app_idx_next); return 0; } @@ -936,7 +939,7 @@ static int p_net_key_set(const char *name) err = bt_mesh_load_core_settings(get, (u8_t *)&key, sizeof(key), &exist); if (err) { - BT_ERR("%s, Failed to load Provisioner NetKey %s", __func__, get); + BT_ERR("%s, Failed to load NetKey 0x%03x", __func__, net_idx); goto free; } @@ -960,7 +963,7 @@ static int p_net_key_set(const char *name) memcpy(sub->keys[0].net, &key.val[0], 16); memcpy(sub->keys[1].net, &key.val[1], 16); - BT_INFO("Restored NetIdx 0x%03x", sub->net_idx); + BT_INFO("Restored NetKey Index 0x%03x", sub->net_idx); BT_INFO("Restored NetKey %s", bt_hex(sub->keys[0].net, 16)); } @@ -996,7 +999,7 @@ static int p_app_key_set(const char *name) err = bt_mesh_load_core_settings(get, (u8_t *)&key, sizeof(key), &exist); if (err) { - BT_ERR("%s, Failed to load Provisioner AppKey %s", __func__, get); + BT_ERR("%s, Failed to load AppKey 0x%03x", __func__, app_idx); goto free; } @@ -1029,7 +1032,8 @@ static int p_app_key_set(const char *name) bt_mesh_app_id(app->keys[0].val, &app->keys[0].id); bt_mesh_app_id(app->keys[1].val, &app->keys[1].id); - BT_INFO("Restored AppIdx %03x, NetIdx 0x%03x", app->app_idx, app->net_idx); + BT_INFO("Restored AppKey Index 0x%03x, NetKey Index 0x%03x", + app->app_idx, app->net_idx); BT_INFO("Restored AppKey %s", bt_hex(app->keys[0].val, 16)); } @@ -1048,7 +1052,7 @@ static int node_info_set(u16_t addr, bool *exist) sprintf(get, "mesh/pn/%04x/i", addr); err = bt_mesh_load_core_settings(get, (u8_t *)&info, sizeof(info), exist); if (err) { - BT_ERR("%s, Failed to load node %s", __func__, get); + BT_ERR("Failed to load node 0x%04x info", addr); return -EIO; } @@ -1069,11 +1073,11 @@ static int node_info_set(u16_t addr, bool *exist) err = bt_mesh_provisioner_restore_node_info(&node); if (err) { - BT_ERR("%s, Failed to restore node 0x%04x", __func__, addr); + BT_ERR("Failed to restore node 0x%04x info", addr); return -EIO; } - BT_INFO("Restored node 0x%04x, uuid %s", addr, bt_hex(node.dev_uuid, 16)); + BT_INFO("Restored Node 0x%04x, UUID %s", addr, bt_hex(node.dev_uuid, 16)); return 0; } @@ -1088,7 +1092,7 @@ static int node_name_set(u16_t addr) sprintf(get, "mesh/pn/%04x/n", addr); err = bt_mesh_load_core_settings(get, (u8_t *)name, BLE_MESH_NODE_NAME_SIZE, &exist); if (err) { - BT_ERR("%s, Failed to load node name %s", __func__, get); + BT_ERR("Failed to load node 0x%04x name", addr); return -EIO; } @@ -1098,11 +1102,11 @@ static int node_name_set(u16_t addr) err = bt_mesh_provisioner_restore_node_name(addr, name); if (err) { - BT_ERR("%s, Failed to restore node name 0x%04x", __func__, addr); + BT_ERR("Failed to restore node 0x%04x name", addr); return -EIO; } - BT_INFO("Restored node 0x%04x, name %s", addr, name); + BT_INFO("Restored Node 0x%04x, Name %s", addr, name); return 0; } @@ -1121,11 +1125,11 @@ static int node_comp_data_set(u16_t addr) err = bt_mesh_provisioner_restore_node_comp_data(addr, buf->data, buf->len); if (err) { - BT_ERR("%s, Failed to restore node comp data 0x%04x", __func__, addr); + BT_ERR("Failed to restore node 0x%04x comp data", addr); + } else { + BT_INFO("Restored Node 0x%04x, Composition Data %s", addr, bt_hex(buf->data, buf->len)); } - BT_INFO("Restored node 0x%04x, comp data %s", addr, bt_hex(buf->data, buf->len)); - bt_mesh_free_buf(buf); return err; } @@ -1135,7 +1139,6 @@ static int p_node_set(const char *name) struct net_buf_simple *buf = NULL; bool exist = false; size_t length = 0U; - int err = 0; int i; buf = bt_mesh_get_core_settings_item(name); @@ -1152,9 +1155,7 @@ static int p_node_set(const char *name) continue; } - err = node_info_set(addr, &exist); - if (err) { - BT_ERR("%s, Failed to load node 0x%04x info", __func__, addr); + if (node_info_set(addr, &exist)) { continue; } @@ -1162,21 +1163,17 @@ static int p_node_set(const char *name) continue; } - err = node_name_set(addr); - if (err) { - BT_ERR("%s, Failed to load node 0x%04x name", __func__, addr); + if (node_name_set(addr)) { continue; } - err = node_comp_data_set(addr); - if (err) { - BT_ERR("%s, Failed to load node 0x%04x comp data", __func__, addr); + if (node_comp_data_set(addr)) { continue; } } bt_mesh_free_buf(buf); - return err; + return 0; } #endif /* CONFIG_BLE_MESH_PROVISIONER */ @@ -1246,7 +1243,7 @@ int settings_core_load(void) !strcmp(settings[i].name, "mesh/p_appkey") || !strcmp(settings[i].name, "mesh/p_node")) && (!IS_ENABLED(CONFIG_BLE_MESH_PROVISIONER) || bt_mesh_is_node())) { - BT_DBG("Not restoring %s for node", settings[i].name); + BT_DBG("Not restoring %s for Node", settings[i].name); continue; } @@ -1254,12 +1251,18 @@ int settings_core_load(void) if (!strcmp(settings[i].name, "mesh/role")) { u8_t role = bt_mesh_atomic_get(bt_mesh.flags) & DEVICE_ROLE_BITS; - if (role == 0U) { - BT_INFO("Device just starts up, nothing restored"); + switch (role) { + case 0U: + BT_INFO("Mesh device just starts up, no restore"); return 0; - } - if (role != BIT(BLE_MESH_NODE) && role != BIT(BLE_MESH_PROVISIONER)) { - BT_ERR("Invalid restored device role %d", role); + case BIT(BLE_MESH_NODE): + BT_INFO("Restored mesh device role: Node"); + break; + case BIT(BLE_MESH_PROVISIONER): + BT_INFO("Restored mesh device role: Provisioner"); + break; + default: + BT_ERR("Restored mesh device role: Unknown"); return 0; } } @@ -1474,7 +1477,7 @@ static void store_pending_net(void) { struct net_val net = {0}; - BT_DBG("addr 0x%04x DevKey %s", bt_mesh_primary_addr(), + BT_DBG("Primary address 0x%04x DevKey %s", bt_mesh_primary_addr(), bt_hex(bt_mesh.dev_key, 16)); net.primary_addr = bt_mesh_primary_addr(); @@ -1559,13 +1562,13 @@ static void store_rpl(struct bt_mesh_rpl *entry) sprintf(name, "mesh/rpl/%04x", entry->src); err = bt_mesh_save_core_settings(name, (const u8_t *)&rpl, sizeof(rpl)); if (err) { - BT_ERR("%s, Failed to save RPL %s", __func__, name); + BT_ERR("Failed to store RPL entry 0x%04x", entry->src); return; } err = bt_mesh_add_core_settings_item("mesh/rpl", entry->src); if (err) { - BT_ERR("%s, Failed to add 0x%04x to mesh/rpl", __func__, entry->src); + BT_ERR("Failed to add 0x%04x to mesh/rpl", entry->src); } return; @@ -1585,7 +1588,6 @@ static void clear_rpl(void) buf = bt_mesh_get_core_settings_item("mesh/rpl"); if (!buf) { - BT_WARN("%s, Erase RPL", __func__); bt_mesh_save_core_settings("mesh/rpl", NULL, 0); return; } @@ -1626,7 +1628,7 @@ static void store_pending_hb_pub(void) struct hb_pub_val val = {0}; if (!hb_pub) { - BT_WARN("%s, NULL hb_pub", __func__); + BT_WARN("NULL heartbeat publication"); return; } @@ -1646,7 +1648,7 @@ static void store_pending_cfg(void) struct cfg_val val = {0}; if (!cfg) { - BT_WARN("%s, NULL cfg", __func__); + BT_WARN("NULL configuration state"); return; } @@ -1679,7 +1681,7 @@ static void clear_app_key(u16_t app_idx) err = bt_mesh_remove_core_settings_item("mesh/appkey", app_idx); if (err) { - BT_ERR("%s, Failed to remove 0x%04x from mesh/appkey", __func__, app_idx); + BT_ERR("%s, Failed to remove 0x%03x from mesh/appkey", __func__, app_idx); } return; @@ -1697,7 +1699,7 @@ static void clear_net_key(u16_t net_idx) err = bt_mesh_remove_core_settings_item("mesh/netkey", net_idx); if (err) { - BT_ERR("%s, Failed to remove 0x%04x from mesh/netkey", __func__, net_idx); + BT_ERR("%s, Failed to remove 0x%03x from mesh/netkey", __func__, net_idx); } return; @@ -1720,13 +1722,13 @@ static void store_net_key(struct bt_mesh_subnet *sub) sprintf(name, "mesh/nk/%04x", sub->net_idx); err = bt_mesh_save_core_settings(name, (const u8_t *)&key, sizeof(key)); if (err) { - BT_ERR("%s, Failed to save NetKey %s", __func__, name); + BT_ERR("%s, Failed to store NetKey 0x%03x", __func__, sub->net_idx); return; } err = bt_mesh_add_core_settings_item("mesh/netkey", sub->net_idx); if (err) { - BT_ERR("%s, Failed to add 0x%04x to mesh/netkey", __func__, sub->net_idx); + BT_ERR("Failed to add 0x%03x to mesh/netkey", sub->net_idx); } return; @@ -1746,13 +1748,13 @@ static void store_app_key(struct bt_mesh_app_key *app) sprintf(name, "mesh/ak/%04x", app->app_idx); err = bt_mesh_save_core_settings(name, (const u8_t *)&key, sizeof(key)); if (err) { - BT_ERR("%s, Failed to save AppKey %s", __func__, name); + BT_ERR("%s, Failed to store AppKey 0x%03x", __func__, app->app_idx); return; } err = bt_mesh_add_core_settings_item("mesh/appkey", app->app_idx); if (err) { - BT_ERR("%s, Failed to add 0x%04x to mesh/appkey", __func__, app->app_idx); + BT_ERR("Failed to add 0x%03x to mesh/appkey", app->app_idx); } return; @@ -1817,14 +1819,14 @@ static void store_pending_mod_bind(struct bt_mesh_model *model, bool vnd) err = bt_mesh_save_core_settings(name, (const u8_t *)model->keys, sizeof(model->keys)); if (err) { - BT_ERR("%s, Failed to save %s", __func__, name); + BT_ERR("Failed to store %s", name); return; } err = bt_mesh_add_core_settings_item(vnd ? "mesh/vnd" : "mesh/sig", model_key); if (err) { - BT_ERR("%s, Failed to add 0x%04x to %s", __func__, model_key, - vnd ? "mesh/vnd" : "mesh/sig"); + BT_ERR("Failed to add bound key to %s, model_key 0x%04x", + vnd ? "mesh/vnd" : "mesh/sig", model_key); } return; @@ -1848,14 +1850,14 @@ static void store_pending_mod_sub(struct bt_mesh_model *model, bool vnd) err = bt_mesh_save_core_settings(name, (const u8_t *)model->groups, sizeof(model->groups)); if (err) { - BT_ERR("%s, Failed to save %s", __func__, name); + BT_ERR("Failed to store %s", name); return; } err = bt_mesh_add_core_settings_item(vnd ? "mesh/vnd" : "mesh/sig", model_key); if (err) { - BT_ERR("%s, Failed to add 0x%04x to %s", __func__, model_key, - vnd ? "mesh/vnd" : "mesh/sig"); + BT_ERR("Failed to add subscription to %s, model_key 0x%04x", + vnd ? "mesh/vnd" : "mesh/sig", model_key); } return; @@ -1869,7 +1871,7 @@ static void store_pending_mod_pub(struct bt_mesh_model *model, bool vnd) int err = 0; if (!model->pub) { - BT_WARN("%s, No model publication to store", __func__); + BT_WARN("Model has no publication support"); return; } @@ -1893,14 +1895,14 @@ static void store_pending_mod_pub(struct bt_mesh_model *model, bool vnd) err = bt_mesh_save_core_settings(name, (const u8_t *)&pub, sizeof(pub)); if (err) { - BT_ERR("%s, Failed to save %s", __func__, name); + BT_ERR("Failed to store %s", name); return; } err = bt_mesh_add_core_settings_item(vnd ? "mesh/vnd" : "mesh/sig", model_key); if (err) { - BT_ERR("%s, Failed to add 0x%04x to %s", __func__, model_key, - vnd ? "mesh/vnd" : "mesh/sig"); + BT_ERR("Failed to add publication to %s, model_key 0x%04x", + vnd ? "mesh/vnd" : "mesh/sig", model_key); } return; @@ -1956,7 +1958,7 @@ static void store_pending_va(void) err = bt_mesh_save_core_settings(name, (const u8_t *)&va, sizeof(va)); } if (err) { - BT_ERR("%s, Failed to %s virtual address %s", __func__, + BT_ERR("Failed to %s virtual address %s", IS_VA_DEL(lab) ? "delete" : "store", name); return; } @@ -1967,7 +1969,7 @@ static void store_pending_va(void) err = bt_mesh_add_core_settings_item("mesh/vaddr", i); } if (err) { - BT_ERR("%s, Failed to %s 0x%04x in mesh/vaddr", __func__, + BT_ERR("Failed to %s 0x%04x in mesh/vaddr", IS_VA_DEL(lab) ? "delete" : "store", i); return; } @@ -2253,7 +2255,7 @@ void bt_mesh_store_prov_info(u16_t primary_addr, u16_t alloc_addr) { struct prov_info val = {0}; - BT_DBG("primary_addr 0x%04x, alloc_addr 0x%04x", primary_addr, alloc_addr); + BT_DBG("Primary address 0x%04x, next address allocation 0x%04x", primary_addr, alloc_addr); val.primary_addr = primary_addr; val.alloc_addr = alloc_addr; @@ -2276,7 +2278,7 @@ static void clear_p_net_key(u16_t net_idx) err = bt_mesh_remove_core_settings_item("mesh/p_netkey", net_idx); if (err) { - BT_ERR("%s, Failed to remove 0x%04x from mesh/p_netkey", __func__, net_idx); + BT_ERR("Failed to remove 0x%03x from mesh/p_netkey", net_idx); } } @@ -2290,7 +2292,7 @@ static void clear_p_app_key(u16_t app_idx) err = bt_mesh_remove_core_settings_item("mesh/p_appkey", app_idx); if (err) { - BT_ERR("%s, Failed to remove 0x%03x from mesh/p_appkey", __func__, app_idx); + BT_ERR("Failed to remove 0x%03x from mesh/p_appkey", app_idx); } } @@ -2308,13 +2310,13 @@ static void store_p_net_key(struct bt_mesh_subnet *sub) sprintf(name, "mesh/pnk/%04x", sub->net_idx); err = bt_mesh_save_core_settings(name, (const u8_t *)&key, sizeof(key)); if (err) { - BT_ERR("%s, Failed to save NetKey %s", __func__, name); + BT_ERR("%s, Failed to store NetKey 0x%03x", __func__, sub->net_idx); return; } err = bt_mesh_add_core_settings_item("mesh/p_netkey", sub->net_idx); if (err) { - BT_ERR("%s, Failed to add 0x%04x to mesh/p_netkey", __func__, sub->net_idx); + BT_ERR("Failed to add 0x%03x to mesh/p_netkey", sub->net_idx); } } @@ -2332,13 +2334,13 @@ static void store_p_app_key(struct bt_mesh_app_key *app) sprintf(name, "mesh/pak/%04x", app->app_idx); err = bt_mesh_save_core_settings(name, (const u8_t *)&key, sizeof(key)); if (err) { - BT_ERR("%s, Failed to save AppKey %s", __func__, name); + BT_ERR("%s, Failed to store AppKey 0x%03x", __func__, app->app_idx); return; } err = bt_mesh_add_core_settings_item("mesh/p_appkey", app->app_idx); if (err) { - BT_ERR("%s, Failed to add 0x%04x to mesh/p_appkey", __func__, app->app_idx); + BT_ERR("Failed to add 0x%03x to mesh/p_appkey", app->app_idx); } } @@ -2433,7 +2435,7 @@ void bt_mesh_clear_rpl_single(u16_t src) err = bt_mesh_remove_core_settings_item("mesh/rpl", src); if (err) { - BT_ERR("%s, Failed to remove 0x%04x from mesh/rpl", __func__, src); + BT_ERR("Failed to remove 0x%04x from mesh/rpl", src); } } @@ -2462,13 +2464,13 @@ void bt_mesh_store_node_info(struct bt_mesh_node *node) sprintf(name, "mesh/pn/%04x/i", node->unicast_addr); err = bt_mesh_save_core_settings(name, (const u8_t *)&val, sizeof(val)); if (err) { - BT_ERR("%s, Failed to save node %s", __func__, name); + BT_ERR("Failed to store node 0x%04x info", node->unicast_addr); return; } err = bt_mesh_add_core_settings_item("mesh/p_node", node->unicast_addr); if (err) { - BT_ERR("%s, Failed to add node 0x%04x", __func__, node->unicast_addr); + BT_ERR("Failed to add node 0x%04x info", node->unicast_addr); } } @@ -2491,7 +2493,7 @@ static void clear_node(u16_t addr) err = bt_mesh_remove_core_settings_item("mesh/p_node", addr); if (err) { - BT_ERR("%s, Failed to remove node 0x%04x", __func__, addr); + BT_ERR("Failed to remove node 0x%04x", addr); } } @@ -2523,7 +2525,7 @@ void bt_mesh_store_node_name(struct bt_mesh_node *node) sprintf(name, "mesh/pn/%04x/n", node->unicast_addr); err = bt_mesh_save_core_settings(name, (const u8_t *)node_name, BLE_MESH_NODE_NAME_SIZE); if (err) { - BT_ERR("%s, Failed to save node name %s", __func__, name); + BT_ERR("Failed to store node 0x%04x name", node->unicast_addr); } } @@ -2540,7 +2542,7 @@ void bt_mesh_store_node_comp_data(struct bt_mesh_node *node) sprintf(name, "mesh/pn/%04x/c", node->unicast_addr); err = bt_mesh_save_core_settings(name, (const u8_t *)node->comp_data, node->comp_length); if (err) { - BT_ERR("%s, Failed to save node comp data %s", __func__, name); + BT_ERR("Failed to store node 0x%04x comp data", node->unicast_addr); } } #endif /* CONFIG_BLE_MESH_PROVISIONER */