Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/2] android/hidhost: Fix not unregistering HID
@ 2013-10-31 14:45 Andrei Emeltchenko
  2013-10-31 14:45 ` [PATCH 2/2] android/hid: Add error message to error print Andrei Emeltchenko
  2013-10-31 14:58 ` [PATCH 1/2] android/hidhost: Fix not unregistering HID Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Andrei Emeltchenko @ 2013-10-31 14:45 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

If HID is not unregistered it cannot be registered again and we get
following error:
...
E/BluetoothHidServiceJni( 2849): Failed to initialize Bluetooth HID, status: 1
...
---
 android/hal-hidhost.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index a72410b..e148dc2 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -301,12 +301,19 @@ static bt_status_t hh_init(bthh_callbacks_t *callbacks)
 
 static void hh_cleanup(void)
 {
+	struct hal_cmd_unregister_module cmd;
+
 	DBG("");
 
 	if (!interface_ready())
 		return;
 
 	bt_hh_cbacks = NULL;
+
+	cmd.service_id = HAL_SERVICE_ID_HIDHOST;
+
+	hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bthh_interface_t hh_if = {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] android/hid: Add error message to error print
  2013-10-31 14:45 [PATCH 1/2] android/hidhost: Fix not unregistering HID Andrei Emeltchenko
@ 2013-10-31 14:45 ` Andrei Emeltchenko
  2013-10-31 14:58 ` [PATCH 1/2] android/hidhost: Fix not unregistering HID Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Andrei Emeltchenko @ 2013-10-31 14:45 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

---
 android/hid.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/hid.c b/android/hid.c
index 5caa25b..4075ecb 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -419,7 +419,7 @@ bool bt_hid_register(GIOChannel *io, const bdaddr_t *addr)
 				BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW,
 				BT_IO_OPT_INVALID);
 	if (!ctrl_io) {
-		error("Failed to listen on control channel");
+		error("Failed to listen on ctrl channel: %s", err->message);
 		g_error_free(err);
 		return false;
 	}
@@ -429,7 +429,7 @@ bool bt_hid_register(GIOChannel *io, const bdaddr_t *addr)
 				BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW,
 				BT_IO_OPT_INVALID);
 	if (!intr_io) {
-		error("Failed to listen on interrupt channel");
+		error("Failed to listen on intr channel: %s", err->message);
 		g_io_channel_unref(ctrl_io);
 		g_error_free(err);
 		return false;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] android/hidhost: Fix not unregistering HID
  2013-10-31 14:45 [PATCH 1/2] android/hidhost: Fix not unregistering HID Andrei Emeltchenko
  2013-10-31 14:45 ` [PATCH 2/2] android/hid: Add error message to error print Andrei Emeltchenko
@ 2013-10-31 14:58 ` Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2013-10-31 14:58 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

On Thu, Oct 31, 2013, Andrei Emeltchenko wrote:
> If HID is not unregistered it cannot be registered again and we get
> following error:
> ...
> E/BluetoothHidServiceJni( 2849): Failed to initialize Bluetooth HID, status: 1
> ...
> ---
>  android/hal-hidhost.c |    7 +++++++
>  1 file changed, 7 insertions(+)

Both patches have been applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-31 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-31 14:45 [PATCH 1/2] android/hidhost: Fix not unregistering HID Andrei Emeltchenko
2013-10-31 14:45 ` [PATCH 2/2] android/hid: Add error message to error print Andrei Emeltchenko
2013-10-31 14:58 ` [PATCH 1/2] android/hidhost: Fix not unregistering HID Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox