android/hidhost: Allow to use cached dev when connecting

There is no reason to not allow connect when there is cached hid device
This commit is contained in:
Lukasz Rymanowski 2014-09-02 12:09:48 +02:00 committed by Szymon Janc
parent bdf0701768
commit 04d98fe2a9

View File

@ -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);