When sending a ping request right after a device got paired, the ping
message gets lost (there is no response). Work around that by delaying
the initial packet exchange. 10 milliseconds seems to work, but let's
choose 30 ms to be fully safe.

Signed-off-by: Peter Wu <lekenst...@gmail.com>
---
 src/linux/up-device-unifying.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/linux/up-device-unifying.c b/src/linux/up-device-unifying.c
index 119c517..b07d515 100644
--- a/src/linux/up-device-unifying.c
+++ b/src/linux/up-device-unifying.c
@@ -235,6 +235,9 @@ up_device_unifying_coldplug (UpDevice *device)
        hidpp_device_set_hidraw_device (unifying->priv->hidpp_device,
                                        device_file);
 
+       /* give newly paired devices a chance to complete pairing */
+       g_usleep(30000);
+
        /* coldplug initial parameters */
        ret = hidpp_device_refresh (unifying->priv->hidpp_device,
                                    HIDPP_REFRESH_FLAGS_VERSION |
-- 
1.8.3.4

_______________________________________________
devkit-devel mailing list
devkit-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/devkit-devel

Reply via email to