From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> --- android/tester-avrcp.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/android/tester-avrcp.c b/android/tester-avrcp.c index 35e9773..337a621 100644 --- a/android/tester-avrcp.c +++ b/android/tester-avrcp.c @@ -218,6 +218,20 @@ static void avrcp_connect_action(void) schedule_action_verification(step); } +static void avrcp_disconnect_action(void) +{ + struct test_data *data = tester_get_data(); + const uint8_t *addr = hciemu_get_client_bdaddr(data->hciemu); + struct step *step = g_new0(struct step, 1); + bt_bdaddr_t bdaddr; + + bdaddr2android((const bdaddr_t *) addr, &bdaddr); + + step->action_status = data->if_a2dp->disconnect(&bdaddr); + + schedule_action_verification(step); +} + static struct test_case test_cases[] = { TEST_CASE_BREDRLE("AVRCP Init", ACTION_SUCCESS(dummy_action, NULL), @@ -238,6 +252,27 @@ static struct test_case test_cases[] = { ACTION_SUCCESS(bluetooth_disable_action, NULL), CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF), ), + TEST_CASE_BREDRLE("AVRCP Disconnect - 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(emu_add_l2cap_server_action, &sdp_setup_data), + ACTION_SUCCESS(emu_add_l2cap_server_action, &a2dp_setup_data), + ACTION_SUCCESS(emu_add_l2cap_server_action, &avrcp_setup_data), + ACTION_SUCCESS(avrcp_connect_action, NULL), + CALLBACK_AV_CONN_STATE(CB_A2DP_CONN_STATE, + BTAV_CONNECTION_STATE_CONNECTING), + CALLBACK_AV_CONN_STATE(CB_A2DP_CONN_STATE, + BTAV_CONNECTION_STATE_CONNECTED), + ACTION_SUCCESS(avrcp_disconnect_action, NULL), + CALLBACK_AV_CONN_STATE(CB_A2DP_CONN_STATE, + BTAV_CONNECTION_STATE_DISCONNECTING), + CALLBACK_AV_CONN_STATE(CB_A2DP_CONN_STATE, + BTAV_CONNECTION_STATE_DISCONNECTED), + ACTION_SUCCESS(bluetooth_disable_action, NULL), + CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF), + ), }; struct queue *get_avrcp_tests(void) -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html