From 27be716768cc3a33c371023c45684cb24abe4965 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 23 Apr 2019 21:50:32 -0500 Subject: [PATCH] Add disabled combined thresholds. --- sdk/SMX.h | 9 ++++++--- smx-config/SMX.cs | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sdk/SMX.h b/sdk/SMX.h index 44d8d0d..f7af771 100644 --- a/sdk/SMX.h +++ b/sdk/SMX.h @@ -163,11 +163,14 @@ struct packed_sensor_settings_t { uint8_t fsrLowThreshold[4]; uint8_t fsrHighThreshold[4]; + uint16_t combinedLowThreshold; + uint16_t combinedHighThreshold; + // This must be left unchanged. uint16_t reserved; }; -static_assert(sizeof(packed_sensor_settings_t) == 12, "Incorrect packed_sensor_settings_t size"); +static_assert(sizeof(packed_sensor_settings_t) == 16, "Incorrect packed_sensor_settings_t size"); // The configuration for a connected controller. This can be retrieved with SMX_GetConfig // and modified with SMX_SetConfig. @@ -258,11 +261,11 @@ struct SMXConfig // Pad the struct to 250 bytes. This keeps this struct size from changing // as we add fields, so the ABI doesn't change. Applications should leave // any data in here unchanged when calling SMX_SetConfig. - uint8_t padding[85]; + uint8_t padding[49]; }; #pragma pack(pop) -static_assert(offsetof(SMXConfig, padding) == 165, "Incorrect padding alignment"); +static_assert(offsetof(SMXConfig, padding) == 201, "Incorrect padding alignment"); static_assert(sizeof(SMXConfig) == 250, "Expected 250 bytes"); // The values (except for Off) correspond with the protocol and must not be changed. diff --git a/smx-config/SMX.cs b/smx-config/SMX.cs index 7d58867..ea03b05 100644 --- a/smx-config/SMX.cs +++ b/smx-config/SMX.cs @@ -39,6 +39,9 @@ namespace SMX [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public Byte[] fsrHighThreshold; + public UInt16 combinedLowThreshold; + public UInt16 combinedHighThreshold; + // This must be left unchanged. public UInt16 reserved; }; @@ -88,7 +91,7 @@ namespace SMX public Byte preDetailsDelayMilliseconds; // Pad this struct to exactly 250 bytes. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 85)] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 49)] public Byte[] padding; // It would be simpler to set flags to [MarshalAs(UnmanagedType.U8)], but