shell: Fix faulty error check in bt shell
bt_addr_le_to_str returns a length of bytes needed for string conversion, not an error code. Signed-off-by: Lars Knudsen <lakd@demant.com>
This commit is contained in:
parent
a7cf7eb393
commit
96bc04f7ac
1 changed files with 1 additions and 6 deletions
|
@ -361,13 +361,8 @@ bool passes_scan_filter(const struct bt_le_scan_recv_info *info, const struct ne
|
|||
|
||||
if (scan_filter.addr_set) {
|
||||
char le_addr[BT_ADDR_LE_STR_LEN] = {0};
|
||||
int err;
|
||||
|
||||
err = bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr));
|
||||
if (err != 0) {
|
||||
shell_error(ctx_shell, "Failed to convert addr to string: %d", err);
|
||||
return false;
|
||||
}
|
||||
bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr));
|
||||
|
||||
if (!is_substring(scan_filter.addr, le_addr)) {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue