There is no reason to not allow connect when there is cached hid device --- android/hidhost.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/android/hidhost.c b/android/hidhost.c index 652baa0..3dc3c25 100644 --- a/android/hidhost.c +++ b/android/hidhost.c @@ -867,12 +867,13 @@ static void bt_hid_connect(const void *buf, uint16_t len) android2bdaddr(&cmd->bdaddr, &dst); l = g_slist_find_custom(devices, &dst, device_cmp); - if (l) { - status = HAL_STATUS_FAILED; - goto failed; - } + if (l) + dev = l->data; + else + dev = hid_device_new(&dst); - dev = hid_device_new(&dst); + if (dev->state != HAL_HIDHOST_STATE_DISCONNECTED) + goto done; ba2str(&dev->dst, addr); DBG("connecting to %s", addr); -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html