Linux bluetooth development
 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 5/5] android: Add initial code for hidhost set hid information
Date: Tue, 22 Oct 2013 11:49:53 -0700	[thread overview]
Message-ID: <1382467793-4709-5-git-send-email-ravikumar.veeramally@linux.intel.com> (raw)
In-Reply-To: <1382467793-4709-1-git-send-email-ravikumar.veeramally@linux.intel.com>

This adds the initial code for hidhost .set_info interface
---
 android/hal-hidhost.c |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index a0349b2..aeebc6c 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -100,6 +100,8 @@ static bt_status_t hh_virtual_unplug(bt_bdaddr_t *bd_addr)
 
 static bt_status_t hh_set_info(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info)
 {
+	struct hal_msg_cmd_bt_hid_set_info cmd;
+
 	DBG("");
 
 	if (!interface_ready())
@@ -108,7 +110,23 @@ static bt_status_t hh_set_info(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info)
 	if (!bd_addr)
 		return BT_STATUS_PARM_INVALID;
 
-	return BT_STATUS_UNSUPPORTED;
+	memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
+	cmd.attr = hid_info.attr_mask;
+	cmd.subclass = hid_info.sub_class;
+	cmd.app_id = hid_info.app_id;
+	cmd.vendor = hid_info.vendor_id;
+	cmd.product = hid_info.product_id;
+	cmd.country = hid_info.ctry_code;
+	cmd.descr_len = hid_info.dl_len;
+	memcpy(cmd.descr, hid_info.dsc_list, cmd.descr_len);
+
+	if (hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_MSG_OP_BT_HID_SET_INFO,
+			sizeof(cmd), &cmd, 0, NULL, NULL) < 0) {
+		error("Failed to set hid info on device");
+		return BT_STATUS_FAIL;
+	}
+
+	return BT_STATUS_SUCCESS;
 }
 
 static bt_status_t hh_get_protocol(bt_bdaddr_t *bd_addr,
-- 
1.7.9.5


  parent reply	other threads:[~2013-10-22 18:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-22 18:49 [PATCH 1/5] android: Add initial code for hidhost virtual unplug Ravi kumar Veeramally
2013-10-22 18:49 ` [PATCH 2/5] android: Add initial code for hidhost get and set protocol Ravi kumar Veeramally
2013-10-22 18:49 ` [PATCH 3/5] android: Add initial code for hidhost get and set report Ravi kumar Veeramally
2013-10-22 18:49 ` [PATCH 4/5] android: Add initial code for hidhost send data Ravi kumar Veeramally
2013-10-22 18:49 ` Ravi kumar Veeramally [this message]
2013-10-22 20:16 ` [PATCH 1/5] android: Add initial code for hidhost virtual unplug Johan Hedberg

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=1382467793-4709-5-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox