btshell: Remove tracking adv instances
Nimbles does it for us, let's remove it from test app.
@@ -154,8 +154,6 @@ static struct kv_pair cmd_ext_adv_phy_opts[] = {
{ NULL }
};
-static bool adv_instances[BLE_ADV_INSTANCES];
-
static int
cmd_advertise_configure(int argc, char **argv)
{
@@ -175,11 +173,6 @@ cmd_advertise_configure(int argc, char **argv)
return rc;
}
- if (adv_instances[instance]) {
- console_printf("instance already configured\n");
- return rc;
- }
-
memset(&params, 0, sizeof(params));
params.legacy_pdu = parse_arg_bool_dflt("legacy", 0, &rc);
@@ -320,8 +313,6 @@ cmd_advertise_configure(int argc, char **argv)
console_printf("Instance %u configured (selected tx power: %d)\n",
instance, selected_tx_power);
- adv_instances[instance] = true;
-
return 0;
}
@@ -343,11 +334,6 @@ cmd_advertise_set_addr(int argc, char **argv)
return rc;
}
- if (!adv_instances[instance]) {
- console_printf("instance not configured\n");
- return rc;
- }
-
rc = parse_arg_mac("addr", addr.val);
if (rc != 0) {
console_printf("invalid 'addr' parameter\n");
@@ -385,11 +371,6 @@ cmd_advertise_start(int argc, char **argv)
return rc;
}
- if (!adv_instances[instance]) {
- console_printf("instance not configured\n");
- return rc;
- }
-
duration = parse_arg_uint16_dflt("duration", 0, &rc);
if (rc != 0) {
console_printf("invalid 'duration' parameter\n");
@@ -434,11 +415,6 @@ cmd_advertise_stop(int argc, char **argv)
return rc;
}
- if (!adv_instances[instance]) {
- console_printf("instance not configured\n");
- return rc;
- }
-
rc = btshell_ext_adv_stop(instance);
if (rc) {
console_printf("failed to stop advertising instance\n");
@@ -465,19 +441,12 @@ cmd_advertise_remove(int argc, char **argv)
return rc;
}
- if (!adv_instances[instance]) {
- console_printf("instance not configured\n");
- return rc;
- }
-
rc = ble_gap_ext_adv_remove(instance);
if (rc) {
console_printf("failed to remove advertising instance\n");
return rc;
}
- adv_instances[instance] = false;
-
return 0;
}
@@ -1575,11 +1544,6 @@ cmd_set_adv_data_or_scan_rsp(int argc, char **argv, bool scan_rsp,
console_printf("invalid instance\n");
return rc;
}
-
- if (!adv_instances[instance]) {
- console_printf("instance not configured\n");
- return rc;
- }
#endif
tmp = parse_arg_uint8("flags", &rc);
