Allow idle disconnect for sony dongle

This commit is contained in:
Travis Nickles 2017-04-06 20:24:16 -07:00
parent 1a39c00a01
commit 7ae8e0deb8

View File

@ -608,7 +608,7 @@ namespace DS4Windows
} */
bool ds4Idle = cState.FrameCounter == pState.FrameCounter;
if (conType != ConnectionType.BT)
if (conType == ConnectionType.USB)
{
lastActive = utcNow;
}
@ -635,9 +635,20 @@ namespace DS4Windows
lastActive = utcNow;
}
if (shouldDisconnect && DisconnectBT())
if (shouldDisconnect)
{
if (conType == ConnectionType.BT)
{
if (DisconnectBT())
return; // all done
}
else if (conType == ConnectionType.SONYWA)
{
if (DisconnectDongle())
return; // all done
}
}
}
// XXX fix initialization ordering so the null checks all go away
if (Report != null)