Bluetooth: Shell: Fix the command bt adv-data
The command did no longer set the user specified data if the user specified more than 1 AD field. We were using the return value of ad_init() to set the number of AD fields. This did not take into account the number of existing data fields. By chance this usually returned 1. Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
This commit is contained in:
parent
6a7656ba48
commit
e9d0340a99
1 changed files with 2 additions and 0 deletions
|
@ -1962,6 +1962,8 @@ static int cmd_adv_data(const struct shell *sh, size_t argc, char *argv[])
|
|||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
ad_len += *data_len;
|
||||
|
||||
err = bt_le_ext_adv_set_data(adv, ad_len > 0 ? ad : NULL, ad_len,
|
||||
sd_len > 0 ? sd : NULL, sd_len);
|
||||
if (err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue