namespace Common.Hardware.SIRT.Parameters { public class BluetoothOperating { private readonly byte[] bits; public BluetoothOperating() => this.bits = new byte[8]; private BluetoothOperating(byte[] bits) => this.bits = bits; /// /// 0 -> Transparent Mode at 115k2 Baud 8,n,1 /// public bool BtOpMode { get => this.bits[0] == 1; } /// /// /// /// true /// after "TIME_OFF" is elapsed without any command via Bluetooth, Bluetooth interface will be switched off /// /// /// false /// normal operation /// /// /// public bool BtPwrSave { get => this.bits[6] == 1; set => this.bits[6] = (byte)(value ? 1 : 0); } /// /// /// /// true /// BT module will be switched off /// /// /// false /// normal operation /// /// /// public bool BtOff { get => this.bits[7] == 1; set => this.bits[7] = (byte)(value ? 1 : 0); } public static implicit operator byte(BluetoothOperating param) => param.bits.GetByte(); public static implicit operator BluetoothOperating(byte _byte) => new BluetoothOperating(_byte.GetBits()); } }