diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index 8cd04d8..19631d5 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -58,6 +58,12 @@ namespace DS4Windows } private X360Data[] processingData = new X360Data[4]; + private byte[][] udpOutBuffers = new byte[4][] + { + new byte[100], new byte[100], + new byte[100], new byte[100] + }; + void GetPadDetailForIdx(int padIdx, ref DualShockPadMeta meta) { @@ -474,7 +480,7 @@ namespace DS4Windows { DualShockPadMeta padDetail = new DualShockPadMeta(); GetPadDetailForIdx(tempIdx, ref padDetail); - _udpServer.NewReportIncoming(ref padDetail, CurrentState[tempIdx]); + _udpServer.NewReportIncoming(ref padDetail, CurrentState[tempIdx], udpOutBuffers[tempIdx]); }; device.MotionEvent = tempEvnt; @@ -696,7 +702,7 @@ namespace DS4Windows { DualShockPadMeta padDetail = new DualShockPadMeta(); GetPadDetailForIdx(tempIdx, ref padDetail); - _udpServer.NewReportIncoming(ref padDetail, CurrentState[tempIdx]); + _udpServer.NewReportIncoming(ref padDetail, CurrentState[tempIdx], udpOutBuffers[tempIdx]); }; device.MotionEvent = tempEvnt; diff --git a/DS4Windows/DS4Control/UdpServer.cs b/DS4Windows/DS4Control/UdpServer.cs index 90a4fa4..f1b56a0 100644 --- a/DS4Windows/DS4Control/UdpServer.cs +++ b/DS4Windows/DS4Control/UdpServer.cs @@ -581,7 +581,7 @@ namespace DS4Windows return true; } - public void NewReportIncoming(ref DualShockPadMeta padMeta, DS4State hidReport) + public void NewReportIncoming(ref DualShockPadMeta padMeta, DS4State hidReport, byte[] outputData) { if (!running) return; @@ -647,7 +647,7 @@ namespace DS4Windows unchecked { - byte[] outputData = new byte[100]; + //byte[] outputData = new byte[100]; int outIdx = BeginPacket(outputData, 1001); Array.Copy(BitConverter.GetBytes((uint)MessageType.DSUS_PadDataRsp), 0, outputData, outIdx, 4); outIdx += 4;