namespace OmniPlus.Features { using System; public class ChamberCalibrationResponse : FeatureRequest { public const byte TEST_ACTIVATED = 0x00; public const byte TEST_FAILED = 0x01; public const byte TEST_COMPLETED = 0x02; const int LENGTH = 7; public ChamberCalibrationResponse() : base(LENGTH) { } public ChamberCalibrationResponse(byte[] response) : base(response, LENGTH) { } /// /// 0 Test Activation Successful /// 1 Test Failed (Timeout) /// 2 Test Successfully Completed /// public byte Control { get => this.bytes[0]; set => this.bytes[0] = value; } /// /// Response: Number of rotations collected /// On Test Activation, this field echoes the number of rotations requested. /// On Test Failed and Test Successfully Completed, returns the number of rotations collected. /// public ushort Rotations { get => BitConverter.ToUInt16(this.bytes, 1); set => BitConverter.GetBytes(value).CopyTo(this.bytes, 1); } /// /// Response: Total Time it took to collect the indicated rotations. Each count is equal to 30.5176us. /// On Test Activation Successful, returns number of seconds test is allowed to take. /// On Test Failed, this field will show 0 indicating that the tested failed. /// public uint Duration { get => BitConverter.ToUInt32(this.bytes, 3); set => BitConverter.GetBytes(value).CopyTo(this.bytes, 3); } public double DurationSec => this.Duration * (1D / 32768); } }