summaryrefslogtreecommitdiff
path: root/android/tester-bluetooth.c
diff options
context:
space:
mode:
authorJakub Tyszkowski <jakub.tyszkowski@tieto.com>2014-07-21 09:40:27 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2014-07-21 11:44:13 +0300
commit45fe2fbf9840d7b0b9e9ba07d07774e3ab5aa347 (patch)
tree407f58e804ec27886e2f4042e8ccabbf73a6afbc /android/tester-bluetooth.c
parentf4a7d9784362c3b5a5a98290e0d96e7f8ba2fe58 (diff)
downloadbluez-45fe2fbf9840d7b0b9e9ba07d07774e3ab5aa347.tar.gz
android/tester-ng: Add ssp confirmation cases
Needed actions were added to properly execute spp procedure. Also callback data was extended to verify incomming ssp variant, and action data was extended to pass ssp accept parameters.
Diffstat (limited to 'android/tester-bluetooth.c')
-rw-r--r--android/tester-bluetooth.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/android/tester-bluetooth.c b/android/tester-bluetooth.c
index dbcd78271..830d939e0 100644
--- a/android/tester-bluetooth.c
+++ b/android/tester-bluetooth.c
@@ -425,6 +425,18 @@ static struct bt_action_data prop_test_remote_ble_timestamp_req = {
.prop = &prop_test_remote_ble_timestamp_prop,
};
+static struct bt_action_data ssp_confirm_accept_reply = {
+ .addr = &emu_remote_bdaddr_val,
+ .ssp_variant = BT_SSP_VARIANT_PASSKEY_CONFIRMATION,
+ .accept = TRUE,
+};
+
+static struct bt_action_data ssp_confirm_reject_reply = {
+ .addr = &emu_remote_bdaddr_val,
+ .ssp_variant = BT_SSP_VARIANT_PASSKEY_CONFIRMATION,
+ .accept = FALSE,
+};
+
static struct test_case test_cases[] = {
TEST_CASE_BREDRLE("Bt. Init",
ACTION_SUCCESS(dummy_action, NULL),
@@ -992,6 +1004,53 @@ static struct test_case test_cases[] = {
&prop_emu_remote_bdadr, 1,
BT_STATUS_AUTH_FAILURE),
),
+ TEST_CASE_BREDR("Bt. Create Bond SSP -Success",
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
+ ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
+ ACTION_SUCCESS(bt_start_discovery_action, NULL),
+ CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
+ BT_DISCOVERY_STARTED),
+ CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_set, 3),
+ ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
+ CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
+ BT_DISCOVERY_STOPPED),
+ ACTION_SUCCESS(bt_create_bond_action,
+ &prop_test_remote_ble_bdaddr_req),
+ CALLBACK_BOND_STATE(BT_BOND_STATE_BONDING,
+ &prop_emu_remote_bdadr, 1),
+ CALLBACK_SSP_REQ(BT_SSP_VARIANT_PASSKEY_CONFIRMATION,
+ prop_emu_remotes_pin_req_set, 2),
+ ACTION_SUCCESS(bt_ssp_reply_accept_action,
+ &ssp_confirm_accept_reply),
+ CALLBACK_BOND_STATE(BT_BOND_STATE_BONDED,
+ &prop_emu_remote_bdadr, 1),
+ ),
+ TEST_CASE_BREDR("Bt. Create Bond SSP - Negative reply",
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
+ ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
+ ACTION_SUCCESS(bt_start_discovery_action, NULL),
+ CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
+ BT_DISCOVERY_STARTED),
+ CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_set, 3),
+ ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
+ CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
+ BT_DISCOVERY_STOPPED),
+ ACTION_SUCCESS(bt_create_bond_action,
+ &prop_test_remote_ble_bdaddr_req),
+ CALLBACK_BOND_STATE(BT_BOND_STATE_BONDING,
+ &prop_emu_remote_bdadr, 1),
+ CALLBACK_SSP_REQ(BT_SSP_VARIANT_PASSKEY_CONFIRMATION,
+ prop_emu_remotes_pin_req_set, 2),
+ ACTION_SUCCESS(bt_ssp_reply_accept_action,
+ &ssp_confirm_reject_reply),
+ CALLBACK_BOND_STATE_FAILED(BT_BOND_STATE_NONE,
+ &prop_emu_remote_bdadr, 1,
+ BT_STATUS_AUTH_FAILURE),
+ ),
};
struct queue *get_bluetooth_tests(void)