From 286c7caf0e86801b80f062f783d3418c21f1238a Mon Sep 17 00:00:00 2001 From: JongChern Date: Wed, 22 Jan 2025 14:27:10 +0800 Subject: [PATCH] Update ShimmerBluetooth.cs --- ShimmerAPI/ShimmerAPI/ShimmerBluetooth.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ShimmerAPI/ShimmerAPI/ShimmerBluetooth.cs b/ShimmerAPI/ShimmerAPI/ShimmerBluetooth.cs index 4406174..aaa273e 100644 --- a/ShimmerAPI/ShimmerAPI/ShimmerBluetooth.cs +++ b/ShimmerAPI/ShimmerAPI/ShimmerBluetooth.cs @@ -1617,7 +1617,7 @@ public void ReadData() bufferbyte[p] = (byte)ReadByte(); } - RetrieveKinematicCalibrationParametersFromPacket(bufferbyte, (byte)PacketTypeShimmer3.ALT_MAG_CALIBRATION_RESPONSE); + RetrieveKinematicCalibrationParametersFromPacket(bufferbyte, (byte)PacketTypeShimmer3.ALT_ACCEL_CALIBRATION_RESPONSE); //Retrieve High G Accel Cal Paramters if Shimmer 3 bufferbyte = new byte[21]; @@ -1626,7 +1626,8 @@ public void ReadData() bufferbyte[p] = (byte)ReadByte(); } - RetrieveKinematicCalibrationParametersFromPacket(bufferbyte, (byte)PacketTypeShimmer3.ALT_ACCEL_CALIBRATION_RESPONSE); + RetrieveKinematicCalibrationParametersFromPacket(bufferbyte, (byte)PacketTypeShimmer3.ALT_MAG_CALIBRATION_RESPONSE); + } break; @@ -2551,6 +2552,7 @@ protected void RetrieveKinematicCalibrationParametersFromPacket(byte[] bufferCal OffsetVectorAltAccel = offsetVector; SensitivityMatrixAltAccel = sensitivityMatrix; DefaultHighGAccelParams = false; + } else if (packetType == (byte)PacketTypeShimmer3.ALT_ACCEL_CALIBRATION_RESPONSE && (sensitivityMatrix[0, 0] == -1 || UtilCalibration.AllElementsAre(sensitivityMatrix, 0)) && HardwareVersion == (int)ShimmerBluetooth.ShimmerVersion.SHIMMER3R)