From 1c1a3f747c97f116ffc39166b36c2a3047bc5cea Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sun, 6 May 2018 01:59:45 -0500 Subject: [PATCH] Fixed timeout disconnect --- DS4Windows/DS4Library/DS4Device.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index e9358c0..9ebf68d 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -456,7 +456,7 @@ namespace DS4Windows hDevice.OpenFileStream(inputReport.Length); } - sendOutputReport(true); // initialize the output report + sendOutputReport(true, true); // initialize the output report } private void timeoutTestThread() @@ -466,7 +466,7 @@ namespace DS4Windows if (timeoutEvent) { timeoutExecuted = true; - this.sendOutputReport(true); // Kick Windows into noticing the disconnection. + this.sendOutputReport(true, true); // Kick Windows into noticing the disconnection. } else { @@ -791,7 +791,7 @@ namespace DS4Windows //Log.LogToGui(Mac.ToString() + " disconnected due to read failure: " + winError, true); } - sendOutputReport(true); // Kick Windows into noticing the disconnection. + sendOutputReport(true, true); // Kick Windows into noticing the disconnection. StopOutputUpdate(); isDisconnecting = true; uiContext.Send(new SendOrPostCallback(delegate (object state4) @@ -994,7 +994,7 @@ namespace DS4Windows { synced = controllerSynced; SyncChange?.Invoke(this, EventArgs.Empty); - sendOutputReport(true); + sendOutputReport(true, true); } } @@ -1101,7 +1101,7 @@ namespace DS4Windows hDevice.flush_Queue(); } - private unsafe void sendOutputReport(bool synchronous) + private unsafe void sendOutputReport(bool synchronous, bool force = false) { setTestRumble(); setHapticState(); @@ -1111,7 +1111,7 @@ namespace DS4Windows lock (outReportBuffer) { - bool output = outputPendCount > 0, change = false; + bool output = outputPendCount > 0, change = force; if (usingBT) {