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:
parent
3be9980bd6
commit
aa7013b9bd
1 changed files with 1 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue