From 09f71b25b43434d635953d9c3e3c8666a68701e6 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Fri, 9 Jan 2015 22:28:46 -0800 Subject: [PATCH] WiimoteReal: retry failed connections quickly Retry a failed connection after a short delay -- hardware sometimes needs some time to settle, or other Bluetooth programs are attempting to query the device as well (e.g. blueman-manager). --- Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp index 36b797f697..dfa201dced 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp @@ -530,6 +530,13 @@ void Wiimote::ThreadFunc() bool ok = ConnectInternal(); + if (!ok) + { + // try again, it might take a moment to settle + Common::SleepCurrentThread(100); + ok = ConnectInternal(); + } + SetReady(); if (!ok)