Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: Szymon Janc <szymon.janc@tieto.com>
Subject: [PATCH 2/6] android: Add initial code for handling adapter set property command
Date: Fri, 25 Oct 2013 17:14:59 +0200	[thread overview]
Message-ID: <1382714103-27689-2-git-send-email-szymon.janc@tieto.com> (raw)
In-Reply-To: <1382714103-27689-1-git-send-email-szymon.janc@tieto.com>

No commands are handled yet.
---
 android/adapter.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/android/adapter.c b/android/adapter.c
index 685b00d..13cce8f 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -365,6 +365,20 @@ static bool get_property(void *buf, uint16_t len)
 	}
 }
 
+static uint8_t set_property(void *buf, uint16_t len)
+{
+	struct hal_cmd_set_adapter_prop *cmd = buf;
+
+	switch (cmd->type) {
+	case HAL_PROP_ADAPTER_NAME:
+	case HAL_PROP_ADAPTER_SCAN_MODE:
+	case HAL_PROP_ADAPTER_DISC_TIMEOUT:
+	default:
+		DBG("Unhandled property type 0x%x", cmd->type);
+		return HAL_STATUS_FAILED;
+	}
+}
+
 void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
 								uint16_t len)
 {
@@ -396,6 +410,12 @@ void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
 			goto error;
 
 		break;
+	case HAL_OP_SET_ADAPTER_PROP:
+		status = set_property(buf, len);
+		if (status != HAL_STATUS_SUCCESS)
+			goto error;
+
+		break;
 	default:
 		DBG("Unhandled command, opcode 0x%x", opcode);
 		goto error;
-- 
1.8.4.1


  reply	other threads:[~2013-10-25 15:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-25 15:14 [PATCH 1/6] android: Use common exit path for commands in bt_adapter_handle_cmd Szymon Janc
2013-10-25 15:14 ` Szymon Janc [this message]
2013-10-25 15:15 ` [PATCH 3/6] android: Add missing scan mode difinitions to IPC header Szymon Janc
2013-10-25 15:15 ` [PATCH 4/6] android: Add support for setting adapter scan mode Szymon Janc
2013-10-25 15:15 ` [PATCH 5/6] android: Always set adapter to pairable on init Szymon Janc
2013-10-25 15:15 ` [PATCH 6/6] android: Add support for notifying HAL about scan mode change Szymon Janc
2013-10-27 12:03 ` [PATCH 1/6] android: Use common exit path for commands in bt_adapter_handle_cmd Luiz Augusto von Dentz

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=1382714103-27689-2-git-send-email-szymon.janc@tieto.com \
    --to=szymon.janc@tieto.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