Bluetooth: Mesh: Change log lvl for element_model_recv

Changes the log level from ERR to DBG for element_model_recv for the
following cases:
- Element does not have the appkey for incoming message.
- Element does not have destination address for incoming meesage.

When the received message is for a group address, element_model_recv
is called for all elements on the device. One or more elements may contain
a model that is subscribing to this address. If more than one element
contains the same model. but they do not all share the same application
key as the incoming message is encrypted with, or they do not all
subscribe to the same group address, then the log will show error
message for these elements, which is misleading.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
This commit is contained in:
Anders Storrø 2024-05-16 13:29:13 +02:00 committed by Johan Hedberg
commit f8bbf753fc

View file

@ -1487,12 +1487,13 @@ static int element_model_recv(struct bt_mesh_msg_ctx *ctx, struct net_buf_simple
}
if (!bt_mesh_model_has_key(model, ctx->app_idx)) {
LOG_ERR("Wrong key");
LOG_DBG("Model at 0x%04x is not bound to app idx %d", elem->rt->addr, ctx->app_idx);
return ACCESS_STATUS_WRONG_KEY;
}
if (!model_has_dst(model, ctx->recv_dst, ctx->uuid)) {
LOG_ERR("Invalid address 0x%02x", ctx->recv_dst);
LOG_DBG("Dst addr 0x%02x is invalid for model at 0x%04x", ctx->recv_dst,
elem->rt->addr);
return ACCESS_STATUS_INVALID_ADDRESS;
}