From 0df84e1fbac2dbdfaa8f5d3da6ed7d3ff33ccb87 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Wed, 11 Oct 2017 18:55:15 -0500 Subject: [PATCH] Refresh calibration data when pairing to or disconnecting a device from the Sony dongle --- DS4Windows/DS4Library/DS4Device.cs | 8 ++++++++ DS4Windows/DS4Library/DS4Devices.cs | 2 ++ 2 files changed, 10 insertions(+) diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index 44a07e2..adbdd4e 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -472,6 +472,14 @@ namespace DS4Windows } } + public void refreshCalibration() + { + byte[] calibration = new byte[41]; + calibration[0] = conType == ConnectionType.BT ? (byte)0x05 : (byte)0x02; + hDevice.readFeatureData(calibration); + sixAxis.setCalibrationData(ref calibration, conType == ConnectionType.USB); + } + public void StartUpdate() { if (ds4Input == null) diff --git a/DS4Windows/DS4Library/DS4Devices.cs b/DS4Windows/DS4Library/DS4Devices.cs index d8e4810..0a1ced6 100644 --- a/DS4Windows/DS4Library/DS4Devices.cs +++ b/DS4Windows/DS4Library/DS4Devices.cs @@ -197,6 +197,8 @@ namespace DS4Windows { deviceSerials.Add(serial); } + + device.refreshCalibration(); } } }