/// <summary> /// Compares this object to another to see if they have the same values. /// </summary> public override bool Equals(object x) { SmcSettings s = x as SmcSettings; if (s == null) { return(false); } return(this.convertToStruct().Equals(s.convertToStruct())); }
/// <summary> /// Sends a new set of settings to the device, to be written to flash. /// This takes about 26 ms. /// </summary> public unsafe void setSmcSettings(SmcSettings settings) { SmcSettingsStruct settingsStruct = settings.convertToStruct(); try { controlTransfer(0x40, (byte)SmcRequest.SetSettings, 0, 0, &settingsStruct, (UInt16)sizeof(SmcSettingsStruct)); } catch (Exception exception) { throw new Exception("There was an error writing settings to the device.", exception); } }