diff options
author | Lukasz Rymanowski <lukasz.rymanowski@tieto.com> | 2014-09-02 15:55:03 +0200 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2014-09-02 18:00:06 +0200 |
commit | e32219b22de26dd83bc17cc193948312c806342a (patch) | |
tree | 3cbea9defc96d04a39a33a1d350d992041865ceb /android/tester-bluetooth.c | |
parent | a4083d62eaf4d20864f146cef3639e64f1076a09 (diff) | |
download | bluez-e32219b22de26dd83bc17cc193948312c806342a.tar.gz |
android/tester: Add test verifying correct bond state notification
Added test which verify that remote device which is paired and not
bonded has correct state in Android framework after ACL disconnection.
Diffstat (limited to 'android/tester-bluetooth.c')
-rw-r--r-- | android/tester-bluetooth.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/android/tester-bluetooth.c b/android/tester-bluetooth.c index 7ea068405..a97e28eec 100644 --- a/android/tester-bluetooth.c +++ b/android/tester-bluetooth.c @@ -448,6 +448,8 @@ static struct bt_action_data no_input_no_output_io_cap = { .io_cap = 0x03, }; +static uint16_t test_conn_handle = 0; + static void conn_cb(uint16_t handle, void *user_data) { struct test_data *data = tester_get_data(); @@ -455,6 +457,8 @@ static void conn_cb(uint16_t handle, void *user_data) tester_print("New connection with handle 0x%04x", handle); + test_conn_handle = handle; + bthost_request_auth(bthost, handle); } @@ -1178,6 +1182,30 @@ static struct test_case test_cases[] = { ACTION_SUCCESS(bluetooth_disable_action, NULL), CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF), ), + TEST_CASE_BREDR("Bluetooth Accept Bond - No Bond - Success", + ACTION_SUCCESS(bluetooth_enable_action, NULL), + CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON), + ACTION_SUCCESS(bt_set_property_action, + &prop_test_scanmode_conn_discov), + CALLBACK_ADAPTER_PROPS(&prop_test_scanmode_conn_discov, 1), + ACTION_SUCCESS(emu_setup_powered_remote_action, NULL), + ACTION_SUCCESS(emu_set_ssp_mode_action, NULL), + ACTION_SUCCESS(emu_set_io_cap, &no_input_no_output_io_cap), + ACTION_SUCCESS(emu_set_connect_cb_action, conn_cb), + ACTION_SUCCESS(emu_remote_connect_hci_action, NULL), + CALLBACK_BOND_STATE(BT_BOND_STATE_BONDING, + &prop_emu_remote_bdadr, 1), + CALLBACK_BOND_STATE(BT_BOND_STATE_BONDED, + &prop_emu_remote_bdadr, 1), + ACTION_SUCCESS(emu_remote_disconnect_hci_action, + &test_conn_handle), + ACTION_SUCCESS(bluetooth_disable_action, NULL), + CALLBACK_BOND_STATE(BT_BOND_STATE_BONDING, + &prop_emu_remote_bdadr, 1), + CALLBACK_BOND_STATE(BT_BOND_STATE_NONE, + &prop_emu_remote_bdadr, 1), + CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF), + ), }; struct queue *get_bluetooth_tests(void) |