shell: Bluetooth: Fix auto-connect

The logic was still trying to parse the address even though one was already
stored.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This commit is contained in:
Jonathan Rico 2022-08-03 08:22:19 +02:00 committed by Carles Cufí
parent a24007c35e
commit 975fd4787b

View file

@ -2045,12 +2045,12 @@ static int cmd_connect_le(const struct shell *sh, size_t argc, char *argv[])
return SHELL_CMD_HELP_PRINTED;
}
}
err = bt_addr_le_from_str(argv[1], argv[2], &addr);
if (err) {
shell_error(sh, "Invalid peer address (err %d)", err);
return err;
} else {
err = bt_addr_le_from_str(argv[1], argv[2], &addr);
if (err) {
shell_error(sh, "Invalid peer address (err %d)", err);
return err;
}
}
#if defined(CONFIG_BT_EXT_ADV)