// Created with MonoDevelop
//
//    Copyright (C) 2023 Hiperscan GmbH Dresden, Germany
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.



using System;
using System.Runtime.InteropServices;

using Hiperscan.SGS.SerialInterface;

namespace Hiperscan.SGS.SgsNt
{
    //Finder X
    internal partial class DeviceNt1_2
    {
        protected new class Protocol : Hiperscan.SGS.SgsNt.DeviceNt1_1.Protocol
        {
            internal Protocol() : base()
            {
            }

            public static readonly new Command ReadIntensity =                      new Command(AddressType.Master, 'R', 'I', typeof(byte), sizeof(byte), typeof(IntensityReadDataExtended));
            public static readonly new Command ReadFinderStatus =                   new Command(AddressType.Master, 'F', 'Q', null, 0, typeof(FinderReadDataStatus));
            public static readonly Command WriteMotorStepperSpeed =                 new Command(AddressType.Master, 'S', 'S', typeof(StepperSpeedWriteData), (UInt16)Marshal.SizeOf(typeof(StepperSpeedWriteData)), null);

            public static readonly Command WriteLightSourceConfig =                 new Command(AddressType.Master, 'L', 'S', typeof(LightSourceConfigWriteData), (UInt16)Marshal.SizeOf(typeof(LightSourceConfigWriteData)), null); // Angepasst an das Struct
            public static readonly Command ReadLightSourceState =                   new Command(AddressType.Master, 'L', 'Q', null, 0, typeof(LightSourceStateReadData));

            public static readonly Command FanControl =                             new Command(AddressType.Master, 'F', 'F', typeof(Byte), sizeof(Byte), null);
            public static readonly Command WriteParkState =                         new Command(AddressType.Master, 'P', 'W', typeof(Byte), sizeof(Byte), null);
            public static readonly Command ReadParkState =                          new Command(AddressType.Master, 'P', 'R', null, 0, typeof(Byte));

            public static readonly Command ReadTouchButton =                        new Command(AddressType.Master, 'T', 'B', null, 0, typeof(Byte));
            public static readonly Command SetTouchButtonLight =                    new Command(AddressType.Master, 'T', 'L', typeof(Byte), sizeof(Byte), null);
            public static readonly Command SetTouchButtonPmwMode =                  new Command(AddressType.Master, 'M', 'L', typeof(Byte), sizeof(Byte), null);
            public static readonly Command ReadTouchButtonLightState =              new Command(AddressType.Master, 'Q', 'L', null, 0, typeof(Byte));
            public static readonly Command WriteHwLinkedLED =                       new Command(AddressType.Master, 'H', 'L', typeof(Byte), sizeof(Byte), null);

            public static readonly Command WriteCapsuleHeaterState =                new Command(AddressType.Master, 'C', 'C', typeof(CapsuleHeaterWriteData), (UInt16)Marshal.SizeOf(typeof(CapsuleHeaterWriteData)), null); // Anpassungen der Benennung
            public static readonly Command ReadCapsuleHeaterState =                 new Command(AddressType.Master, 'C', 'Q', null, 0, typeof(CapsuleHeaterReadData));

            public static readonly Command WriteDetectorHeaterPid =                 new Command(AddressType.Master, 'H', 'P', typeof(DetectorPIDWriteData), (UInt16)Marshal.SizeOf(typeof(DetectorPIDWriteData)), null);
            public static readonly Command WriteDetectorHeaterParams =              new Command(AddressType.Master, 'H', 'E', typeof(DetectorHeaterWriteData), (UInt16)Marshal.SizeOf(typeof(DetectorHeaterWriteData)), null); // Anpassungen der Benennung
            public static readonly Command SetDetectorHeaterSensor =                new Command(AddressType.Master, 'H', 'T', typeof(DetectorSensorWriteData), (UInt16)Marshal.SizeOf(typeof(DetectorSensorWriteData)), null);
            public static readonly Command ReadDetectorHeaterState =                new Command(AddressType.Master, 'H', 'S', null, 0, typeof(DetectorStateReadData));
            public static readonly Command ReadDetectorHeaterParams =               new Command(AddressType.Master, 'H', 'Q', null, 0, typeof(DetectorHeaterReadData));

            public static readonly Command ReadEnvironmentParams =                  new Command(AddressType.Master, 'E', 'Q', null, 0, typeof(EnvironmentReadData));
            public static readonly Command ReadLightSourceVoltage =                 new Command(AddressType.Master, 'U', 'R', null, 0, typeof(LightSourceVoltage));
            public static readonly Command WriteLightSourceVoltage =                new Command(AddressType.Master, 'U', 'W', typeof(LightSourceVoltage), (UInt16)Marshal.SizeOf(typeof(LightSourceVoltage)), null);

            public static readonly Command ReadLightSourceOperatingTimeCounter =    new Command(AddressType.Master, 'R', 'O', null, 0, typeof(LightSourceOperatingTimeCounter));
            public static readonly Command ResetLightSourceOperatingTimeCounter =   new Command(AddressType.Master, 'O', 'R', null, 0, null);

            public static readonly Command StartTestMode =                          new Command(AddressType.Master, 'E', 'M', typeof(byte), sizeof(byte), null);
            public static readonly Command ReadSamplePositionDetectionSensors =     new Command(AddressType.Master, 'P', 'P', null, 0, typeof(PositionDetectionSensorReadData));
        }
    }
}
