summaryrefslogtreecommitdiff
path: root/android/tester-hidhost.c
diff options
context:
space:
mode:
authorJakub Tyszkowski <jakub.tyszkowski@tieto.com>2014-07-29 09:18:26 +0200
committerSzymon Janc <szymon.janc@tieto.com>2014-07-30 11:27:22 +0200
commit4f017e1bce940884f4cde8dec9555199bf0c1785 (patch)
tree0b9f961a1f73e6506129ca3a0fd28037c0ef879d /android/tester-hidhost.c
parent37556c986b56bb821a0144a7e5084e6c9f7ba051 (diff)
downloadbluez-4f017e1bce940884f4cde8dec9555199bf0c1785.tar.gz
android/tester-ng: Add HIDHost get protocol mode case
Diffstat (limited to 'android/tester-hidhost.c')
-rw-r--r--android/tester-hidhost.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/android/tester-hidhost.c b/android/tester-hidhost.c
index f77d5c075..070646e7e 100644
--- a/android/tester-hidhost.c
+++ b/android/tester-hidhost.c
@@ -37,6 +37,10 @@
#define HID_GET_OUTPUT_REPORT 0x4a
#define HID_GET_FEATURE_REPORT 0x4b
+#define HID_MODE_DEFAULT 0x00
+#define HID_MODE_BREDR 0x01
+#define HID_MODE_LE 0x02
+
static struct queue *list; /* List of hidhost test cases */
struct emu_cid_data {
@@ -308,6 +312,21 @@ static void hidhost_virtual_unplug_action(void)
schedule_action_verification(step);
}
+static void hidhost_get_protocol_action(void)
+{
+ struct test_data *data = tester_get_data();
+ const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu);
+ struct step *step = g_new0(struct step, 1);
+ bt_bdaddr_t bdaddr;
+
+ bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr);
+
+ step->action_status = data->if_hid->get_protocol(&bdaddr,
+ BTHH_REPORT_MODE);
+
+ schedule_action_verification(step);
+}
+
static struct test_case test_cases[] = {
TEST_CASE_BREDRLE("HidHost Init",
ACTION_SUCCESS(dummy_action, NULL),
@@ -367,6 +386,23 @@ static struct test_case test_cases[] = {
CALLBACK_STATE(CB_HH_CONNECTION_STATE,
BTHH_CONN_STATE_DISCONNECTED),
),
+ TEST_CASE_BREDRLE("HidHost GetProtocol 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_sdp_data),
+ ACTION_SUCCESS(emu_add_l2cap_server_action,
+ &l2cap_setup_cc_data),
+ ACTION_SUCCESS(emu_add_l2cap_server_action,
+ &l2cap_setup_ic_data),
+ ACTION_SUCCESS(hidhost_connect_action, NULL),
+ CALLBACK_STATE(CB_HH_CONNECTION_STATE,
+ BTHH_CONN_STATE_CONNECTED),
+ ACTION_SUCCESS(hidhost_get_protocol_action, NULL),
+ CALLBACK_HH_MODE(CB_HH_PROTOCOL_MODE, BTHH_OK, HID_MODE_BREDR),
+ ),
};
struct queue *get_hidhost_tests(void)