All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Subject: [PATCH 08/11] android/tester: Add HIDhost SetProtocol test
Date: Fri, 17 Jan 2014 01:25:48 +0200	[thread overview]
Message-ID: <1389914751-18545-9-git-send-email-ravikumar.veeramally@linux.intel.com> (raw)
In-Reply-To: <1389914751-18545-1-git-send-email-ravikumar.veeramally@linux.intel.com>

---
 android/android-tester.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/android/android-tester.c b/android/android-tester.c
index 56be850..da1fc28 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -3197,6 +3197,8 @@ static void setup_hidhost_interface(const void *test_data)
 
 #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)
 {
@@ -3237,6 +3239,8 @@ static void hid_ctrl_cid_hook_cb(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;
 	}
@@ -3447,6 +3451,20 @@ static void test_hidhost_get_protocol(const void *test_data)
 		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; \
@@ -3808,5 +3826,9 @@ int main(int argc, char *argv[])
 			&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();
 }
-- 
1.8.3.2


  parent reply	other threads:[~2014-01-16 23:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-16 23:25 [PATCH 00/11] HIDHost E2E tests and fixes Ravi kumar Veeramally
2014-01-16 23:25 ` [PATCH 01/11] android/hidhost: Fix connection state notification on profile unregister Ravi kumar Veeramally
2014-01-16 23:25 ` [PATCH 02/11] android/hidhost: Fix miscalculation of get report event struct length Ravi kumar Veeramally
2014-01-20 15:22   ` Szymon Janc
2014-01-16 23:25 ` [PATCH 03/11] android/hidhost: Remove unnecessary check Ravi kumar Veeramally
2014-01-16 23:25 ` [PATCH 04/11] android/tester: Add HIDhost Connect test Ravi kumar Veeramally
2014-01-16 23:25 ` [PATCH 05/11] android/tester: Add HIDhost Disconnect test Ravi kumar Veeramally
2014-01-16 23:25 ` [PATCH 06/11] android/tester: Add HIDhost VirtualUnplug test Ravi kumar Veeramally
2014-01-16 23:25 ` [PATCH 07/11] android/tester: Add HIDhost GetProtocol test Ravi kumar Veeramally
2014-01-16 23:25 ` Ravi kumar Veeramally [this message]
2014-01-16 23:25 ` [PATCH 09/11] android/tester: Add HIDhost GetReport test Ravi kumar Veeramally
2014-01-16 23:25 ` [PATCH 10/11] android/tester: Add HIDhost SetReport test Ravi kumar Veeramally
2014-01-16 23:25 ` [PATCH 11/11] android/tester: Add HIDhost SendData test Ravi kumar Veeramally
2014-01-20 15:30 ` [PATCH 00/11] HIDHost E2E tests and fixes Szymon Janc
2014-01-20 18:08   ` Ravi kumar Veeramally

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1389914751-18545-9-git-send-email-ravikumar.veeramally@linux.intel.com \
    --to=ravikumar.veeramally@linux.intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.