|
|
@ -60,6 +60,10 @@ namespace SMX |
|
|
|
public Byte panelThreshold6Low, panelThreshold6High; |
|
|
|
public Byte panelThreshold6Low, panelThreshold6High; |
|
|
|
public Byte panelThreshold8Low, panelThreshold8High; |
|
|
|
public Byte panelThreshold8Low, panelThreshold8High; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Pad this struct to exactly 250 bytes. |
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 166)] |
|
|
|
|
|
|
|
public Byte[] padding; |
|
|
|
|
|
|
|
|
|
|
|
// enabledSensors is a mask of which panels are enabled. Return this as an array |
|
|
|
// enabledSensors is a mask of which panels are enabled. Return this as an array |
|
|
|
// for convenience. |
|
|
|
// for convenience. |
|
|
|
public bool[] GetEnabledPanels() |
|
|
|
public bool[] GetEnabledPanels() |
|
|
@ -291,6 +295,15 @@ namespace SMX |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(!DLLAvailable()) return; |
|
|
|
if(!DLLAvailable()) return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Sanity check SMXConfig, which should be 250 bytes. If this is incorrect, |
|
|
|
|
|
|
|
// check the padding array. |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
SMXConfig config = new SMXConfig(); |
|
|
|
|
|
|
|
int bytes = Marshal.SizeOf(config); |
|
|
|
|
|
|
|
if(bytes != 250) |
|
|
|
|
|
|
|
throw new Exception("SMXConfig is " + bytes + " bytes, but should be 250 bytes"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Make a wrapper to convert from the native enum to SMXUpdateCallbackReason. |
|
|
|
// Make a wrapper to convert from the native enum to SMXUpdateCallbackReason. |
|
|
|
InternalUpdateCallback NewCallback = delegate(int PadNumber, int reason, IntPtr user) { |
|
|
|
InternalUpdateCallback NewCallback = delegate(int PadNumber, int reason, IntPtr user) { |
|
|
|
SMXUpdateCallbackReason ReasonEnum = (SMXUpdateCallbackReason) Enum.ToObject(typeof(SMXUpdateCallbackReason), reason); |
|
|
|
SMXUpdateCallbackReason ReasonEnum = (SMXUpdateCallbackReason) Enum.ToObject(typeof(SMXUpdateCallbackReason), reason); |
|
|
|