static const struct generic_data set_bredr_on_success_test_1 = {
.setup_settings = settings_le,
+ .setup_nobredr = true,
.send_opcode = MGMT_OP_SET_BREDR,
.send_param = set_bredr_on_param,
.send_len = sizeof(set_bredr_on_param),
};
static const struct generic_data set_bredr_on_success_test_2 = {
- .setup_settings = settings_le,
+ .setup_settings = settings_powered_le,
+ .setup_nobredr = true,
.send_opcode = MGMT_OP_SET_BREDR,
.send_param = set_bredr_on_param,
.send_len = sizeof(set_bredr_on_param),
setup_powered_callback, NULL, NULL);
}
-static void setup_nobr_powered(const void *test_data)
-{
- struct test_data *data = tester_get_data();
- unsigned char on[] = { 0x01 };
- unsigned char off[] = { 0x00 };
-
- tester_print("Powering on controller (with LE enabled)");
-
- mgmt_send(data->mgmt, MGMT_OP_SET_BREDR, data->mgmt_index,
- sizeof(off), off, NULL, NULL, NULL);
-
- mgmt_send(data->mgmt, MGMT_OP_SET_POWERED, data->mgmt_index,
- sizeof(on), on,
- setup_powered_callback, NULL, NULL);
-}
-
static void setup_discovery_callback(uint8_t status, uint16_t length,
const void *param, void *user_data)
{
}
}
-static void setup_nobr_callback(uint8_t status, uint16_t length,
- const void *param, void *user_data)
-{
- if (status != MGMT_STATUS_SUCCESS) {
- tester_setup_failed();
- return;
- }
-
- tester_print("BR/EDR disabled");
-
- tester_setup_complete();
-}
-
-static void setup_nobr(const void *test_data)
-{
- struct test_data *data = tester_get_data();
- unsigned char off[] = { 0x00 };
-
- tester_print("Disabling BR/EDR");
-
- mgmt_send(data->mgmt, MGMT_OP_SET_BREDR, data->mgmt_index,
- sizeof(off), off, setup_nobr_callback,
- NULL, NULL);
-}
-
static void setup_multi_uuid32(const void *test_data)
{
struct test_data *data = tester_get_data();
NULL, test_command_generic);
test_bredrle("Set BR/EDR on - Success 1",
&set_bredr_on_success_test_1,
- setup_nobr, test_command_generic);
+ NULL, test_command_generic);
test_bredrle("Set BR/EDR on - Success 2",
&set_bredr_on_success_test_2,
- setup_nobr_powered, test_command_generic);
+ NULL, test_command_generic);
test_bredr("Set BR/EDR off - Not Supported 1",
&set_bredr_off_notsupp_test,
NULL, test_command_generic);