namespace Common.Hardware.SIRT.Parameters { public class SirtOperating { private readonly byte[] bits; public SirtOperating() => this.bits = new byte[8]; private SirtOperating(byte[] bits) => this.bits = bits; /// /// /// /// true /// Bluetooth is output for non-requested messages /// /// /// false /// USB port is output for non-requested messages /// /// /// non requested messages are received radio payloads if a radio module is switched on /// public bool DataBtOut { get => this.bits[0] == 1; set => this.bits[0] = (byte)(value ? 1 : 0); } /// /// /// /// true /// : if both RF-Modules are set to SensusRF Mode, both payloads of RF-Modules will be send out /// /// /// false /// if both RF-Modules are set to SensusRF Mode, the channel with higher RSSI Level will be send out /// /// /// for test purposes both receiver outputs can be shown - but remember double traffic rate on Bluetoothor USB-output /// public bool BothChsOut { get => this.bits[1] == 1; set => this.bits[1] = (byte)(value ? 1 : 0); } /// /// /// /// true /// also payloads with incorrect radio-CRC will send out! /// /// /// false /// normal operation /// /// /// may be only interesting for test purposes /// public bool IgnoreCRC { get => this.bits[2] == 1; set => this.bits[2] = (byte)(value ? 1 : 0); } /// /// /// /// true /// don't switch Power path off if going to USB Suspend and drawing more current as allowed /// /// /// false /// switch Power path off if going to USB Suspend /// /// /// New at Version 1.0.0.6 /// public bool IgnoreUSBrules { get => this.bits[3] == 1; set => this.bits[3] = (byte)(value ? 1 : 0); } /// /// /// /// true /// after "TIME_OFF" is elapsed without any command to SIRT, SIRT will be switched off /// /// /// false /// normal operation /// /// /// timeout starts at beginning, if any command or communication to and from SIRT is initiated /// public bool SirtPwrSave { get => this.bits[6] == 1; set => this.bits[6] = (byte)(value ? 1 : 0); } /// /// /// /// true /// SIRT will be switched off {like push off button} /// /// /// false /// normal operation /// /// /// /// SIRT can be switched off per command, but no answer will send if this bit was set.SIRT can not be switched /// on per command only by pushing green button for a second /// /// public bool SirtOff { get => this.bits[7] == 1; set => this.bits[7] = (byte)(value ? 1 : 0); } public static implicit operator byte(SirtOperating param) => param.bits.GetByte(); public static implicit operator SirtOperating(byte _byte) => new SirtOperating(_byte.GetBits()); } }