Diff between 0f6fb5c0decf2e485efc9119c416ff5ad82988d8 and a54f12fd1529b586cc6e86c5ceedc894ad5d5e23

Changed Files

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

Full Patch

diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 34c8e1b..836df2c 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -2179,6 +2179,24 @@ static const struct generic_data pair_device_success_test_1 = {
 	.pin_len = sizeof(pair_device_pin),
 };
 
+static uint16_t settings_powered_pairable_linksec[] = { MGMT_OP_SET_PAIRABLE,
+							MGMT_OP_SET_POWERED,
+							MGMT_OP_SET_LINK_SECURITY,
+							0 };
+
+static const struct generic_data pair_device_success_test_2 = {
+	.setup_settings = settings_powered_pairable_linksec,
+	.send_opcode = MGMT_OP_PAIR_DEVICE,
+	.send_func = pair_device_send_param_func,
+	.expect_status = MGMT_STATUS_SUCCESS,
+	.expect_func = pair_device_expect_param_func,
+	.expect_hci_command = BT_HCI_CMD_AUTH_REQUESTED,
+	.expect_hci_param = auth_req_param,
+	.expect_hci_len = sizeof(auth_req_param),
+	.pin = pair_device_pin,
+	.pin_len = sizeof(pair_device_pin),
+};
+
 static const char unpair_device_param[] = {
 			0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00, 0x00 };
 static const char unpair_device_rsp[] = {
@@ -3332,6 +3350,9 @@ int main(int argc, char *argv[])
 	test_bredrle("Pair Device - Success 1",
 				&pair_device_success_test_1,
 				NULL, test_command_generic);
+	test_bredrle("Pair Device - Success 2",
+				&pair_device_success_test_2,
+				NULL, test_command_generic);
 
 	test_bredrle("Unpair Device - Not Powered 1",
 				&unpair_device_not_powered_test_1,