Diff between a0b987a0d9fcd08feb3054a92c424187fa3e9978 and 7ee158fbe1ff4e842e607cc5dfc951f4fc158b54

Changed Files

File Additions Deletions Status
tools/mgmt-tester.c +35 -0 modified

Full Patch

diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 93d166f..b9f5de1 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -1015,6 +1015,34 @@ static const struct generic_data set_le_on_invalid_index_test = {
 	.expect_status = MGMT_STATUS_INVALID_INDEX,
 };
 
+static const char set_adv_on_param[] = { 0x01 };
+static const char set_adv_settings_param_1[] = { 0x80, 0x06, 0x00, 0x00 };
+static const char set_adv_settings_param_2[] = { 0x81, 0x06, 0x00, 0x00 };
+static const char set_adv_on_set_adv_enable_param[] = { 0x01 };
+
+static const struct generic_data set_adv_on_success_test_1 = {
+	.send_opcode = MGMT_OP_SET_ADVERTISING,
+	.send_param = set_adv_on_param,
+	.send_len = sizeof(set_adv_on_param),
+	.expect_status = MGMT_STATUS_SUCCESS,
+	.expect_param = set_adv_settings_param_1,
+	.expect_len = sizeof(set_adv_settings_param_1),
+	.expect_settings_set = MGMT_SETTING_ADVERTISING,
+};
+
+static const struct generic_data set_adv_on_success_test_2 = {
+	.send_opcode = MGMT_OP_SET_ADVERTISING,
+	.send_param = set_adv_on_param,
+	.send_len = sizeof(set_adv_on_param),
+	.expect_status = MGMT_STATUS_SUCCESS,
+	.expect_param = set_adv_settings_param_2,
+	.expect_len = sizeof(set_adv_settings_param_2),
+	.expect_settings_set = MGMT_SETTING_ADVERTISING,
+	.expect_hci_command = BT_HCI_CMD_LE_SET_ADV_ENABLE,
+	.expect_hci_param = set_adv_on_set_adv_enable_param,
+	.expect_hci_len = sizeof(set_adv_on_set_adv_enable_param),
+};
+
 static const char set_local_name_param[260] = { 'T', 'e', 's', 't', ' ',
 						'n', 'a', 'm', 'e' };
 static const char write_local_name_hci[248] = { 'T', 'e', 's', 't', ' ',
@@ -2692,6 +2720,13 @@ int main(int argc, char *argv[])
 					&set_le_on_invalid_index_test,
 					NULL, test_command_generic);
 
+	test_bredrle("Set Advertising on - Success 1",
+			&set_adv_on_success_test_1, setup_le,
+			test_command_generic);
+	test_bredrle("Set Advertising on - Success 2",
+			&set_adv_on_success_test_2, setup_le_powered,
+			test_command_generic);
+
 	test_bredr("Set Local Name - Success 1", &set_local_name_test_1,
 						NULL, test_command_generic);
 	test_bredr("Set Local Name - Success 2", &set_local_name_test_2,