diff --git a/android/android-tester.c b/android/android-tester.c
index 50ae957..1e2f376 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
#define HID_GET_REPORT_PROTOCOL 0x60
#define HID_GET_BOOT_PROTOCOL 0x61
+#define HID_SET_REPORT_PROTOCOL 0x70
+#define HID_SET_BOOT_PROTOCOL 0x71
static void hid_prepare_reply_protocol_mode(const void *data, uint16_t len)
{
switch (header) {
case HID_GET_REPORT_PROTOCOL:
case HID_GET_BOOT_PROTOCOL:
+ case HID_SET_REPORT_PROTOCOL:
+ case HID_SET_BOOT_PROTOCOL:
hid_prepare_reply_protocol_mode(data, len);
break;
}
tester_test_failed();
}
+static void test_hidhost_set_protocol(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu);
+ bt_bdaddr_t bdaddr;
+ bt_status_t bt_status;
+
+ data->cb_count = 0;
+ bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr);
+ bt_status = data->if_hid->set_protocol(&bdaddr, BTHH_REPORT_MODE);
+ if (bt_status != BT_STATUS_SUCCESS)
+ tester_test_failed();
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
&hidhost_test_get_protocol, setup_hidhost_connect,
test_hidhost_get_protocol, teardown);
+ test_bredrle("HIDHost SetProtocol Success",
+ &hidhost_test_get_protocol, setup_hidhost_connect,
+ test_hidhost_set_protocol, teardown);
+
return tester_run();
}