--- android/tester-pan.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/android/tester-pan.c b/android/tester-pan.c index 5048a43..1db4a85 100644 --- a/android/tester-pan.c +++ b/android/tester-pan.c @@ -92,6 +92,25 @@ static void pan_disconnect_action(void) schedule_action_verification(step); } +static void pan_get_local_role_action(void) +{ + struct test_data *data = tester_get_data(); + const uint8_t *pan_addr = hciemu_get_client_bdaddr(data->hciemu); + struct step *step = g_new0(struct step, 1); + bt_bdaddr_t bdaddr; + int role; + + bdaddr2android((const bdaddr_t *) pan_addr, &bdaddr); + + role = data->if_pan->get_local_role(); + if (role == BTPAN_ROLE_PANU) + step->action_status = BT_STATUS_SUCCESS; + else + step->action_status = BT_STATUS_FAIL; + + schedule_action_verification(step); +} + static struct test_case test_cases[] = { TEST_CASE_BREDRLE("PAN Init", ACTION_SUCCESS(dummy_action, NULL), @@ -125,6 +144,21 @@ 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("PAN GetLocalRole - 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, &l2cap_setup_data), + ACTION_SUCCESS(pan_connect_action, NULL), + CALLBACK_STATE(CB_PAN_CONNECTION_STATE, + BTPAN_STATE_CONNECTED), + ACTION_SUCCESS(pan_get_local_role_action, NULL), + ACTION_SUCCESS(bluetooth_disable_action, NULL), + CALLBACK_STATE(CB_PAN_CONNECTION_STATE, + BTPAN_STATE_DISCONNECTED), + CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF), + ), }; struct queue *get_pan_tests(void) -- 1.9.1 -- 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