Bluetooth: shell: Fix not reseting value_handle if subscription fails

If bt_gatt_subscirbe fails value_handle must be reset since otherwise it
will not possible to subscribe again as the parameters will be consider
in use.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2020-01-08 10:01:38 -08:00 committed by Johan Hedberg
commit aa7013b9bd

View file

@ -511,6 +511,7 @@ static int cmd_subscribe(const struct shell *shell, size_t argc, char *argv[])
err = bt_gatt_subscribe(default_conn, &subscribe_params);
if (err) {
subscribe_params.value_handle = 0U;
shell_error(shell, "Subscribe failed (err %d)", err);
} else {
shell_print(shell, "Subscribed");