ble_mesh: Optimize some send & recv logs

This commit is contained in:
lly 2020-05-29 15:12:02 +08:00
parent 1ab23bfd3d
commit 268f5ad6c6
2 changed files with 11 additions and 10 deletions

View File

@ -398,13 +398,13 @@ static int publish_retransmit(struct bt_mesh_model *mod)
key = bt_mesh_tx_appkey_get(pub->dev_role, pub->key);
if (!key) {
BT_ERR("%s, Failed to find AppKey", __func__);
BT_ERR("%s, AppKey 0x%03x not exists", __func__, pub->key);
return -EADDRNOTAVAIL;
}
tx.sub = bt_mesh_tx_netkey_get(pub->dev_role, key->net_idx);
if (!tx.sub) {
BT_ERR("%s, Failed to get subnet", __func__);
BT_ERR("%s, Subnet 0x%04x not exists", __func__, key->net_idx);
return -EADDRNOTAVAIL;
}
@ -833,9 +833,9 @@ void bt_mesh_model_recv(struct bt_mesh_net_rx *rx, struct net_buf_simple *buf)
u8_t count = 0U;
int i;
BT_INFO("app_idx 0x%04x src 0x%04x dst 0x%04x", rx->ctx.app_idx,
BT_INFO("recv, app_idx 0x%04x src 0x%04x dst 0x%04x", rx->ctx.app_idx,
rx->ctx.addr, rx->ctx.recv_dst);
BT_INFO("len %u: %s", buf->len, bt_hex(buf->data, buf->len));
BT_INFO("recv, len %u: %s", buf->len, bt_hex(buf->data, buf->len));
if (get_opcode(buf, &opcode) < 0) {
BT_WARN("%s, Unable to decode OpCode", __func__);
@ -967,12 +967,12 @@ static int model_send(struct bt_mesh_model *model,
return -EINVAL;
}
BT_INFO("app_idx 0x%04x src 0x%04x dst 0x%04x",
BT_INFO("send, 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));
BT_INFO("send, len %u: %s", msg->len, bt_hex(msg->data, msg->len));
if (!ready_to_send(role, tx->ctx->addr)) {
BT_ERR("%s, fail", __func__);
BT_ERR("%s, Not ready", __func__);
return -EINVAL;
}
@ -1057,7 +1057,7 @@ int bt_mesh_model_publish(struct bt_mesh_model *model)
key = bt_mesh_tx_appkey_get(pub->dev_role, pub->key);
if (!key) {
BT_ERR("%s, Failed to get AppKey", __func__);
BT_ERR("%s, AppKey 0x%03x not exists", __func__, pub->key);
return -EADDRNOTAVAIL;
}
@ -1082,7 +1082,7 @@ int bt_mesh_model_publish(struct bt_mesh_model *model)
tx.sub = bt_mesh_tx_netkey_get(pub->dev_role, ctx.net_idx);
if (!tx.sub) {
BT_ERR("%s, Failed to get subnet", __func__);
BT_ERR("%s, Subnet 0x%04x not exists", __func__, ctx.net_idx);
return -EADDRNOTAVAIL;
}

View File

@ -636,6 +636,7 @@ int bt_mesh_trans_send(struct bt_mesh_net_tx *tx, struct net_buf_simple *msg,
tx->ctx->addr, bt_mesh.seq,
BLE_MESH_NET_IVI_TX);
if (err) {
BT_ERR("%s, Encrypt failed", __func__);
return err;
}
@ -1967,7 +1968,7 @@ int bt_mesh_app_key_get(const struct bt_mesh_subnet *subnet, u16_t app_idx,
app_key = bt_mesh_tx_appkey_get(role, app_idx);
if (!app_key) {
BT_ERR("%s, Failed to get AppKey", __func__);
BT_ERR("%s, AppKey 0x%04x not exists", __func__, app_idx);
return -ENOENT;
}