using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace UnifiedPOS.Keylock.V1_4
{
    [ServiceContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public interface Keylock
    {
        #region Version 1.1

        //
        // Common Properties
        //

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetAutoDisable", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetAutoDisableResponse")]
        //[FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        //bool GetAutoDisable(string ConsumerID);

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/SetAutoDisable", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/SetAutoDisableResponse")]
        //[FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        //void SetAutoDisable(string ConsumerID, bool AutoDisable);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCapCompareFirmwareVersion", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCapCompareFirmwareVersionResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        bool GetCapCompareFirmwareVersion(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCapPowerReporting", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCapPowerReportingResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        PowerReporting GetCapPowerReporting(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCapStatisticsReporting", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCapStatisticsReportingResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        bool GetCapStatisticsReporting(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCapUpdateFirmware", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCapUpdateFirmwareResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        bool GetCapUpdateFirmware(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCapUpdateStatistics", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCapUpdateStatisticsResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        bool GetCapUpdateStatistics(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCheckHealthText", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCheckHealthTextResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        string GetCheckHealthText(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetClaimed", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetClaimedResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        bool GetClaimed(string ConsumerID);

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDataCount", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDataCountResponse")]
        //[FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        //int GetDataCount(string ConsumerID);

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDataEventEnabled", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDataEventEnabledResponse")]
        //[FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        //bool GetDataEventEnabled(string ConsumerID);

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/SetDataEventEnabled", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/SetDataEventEnabledResponse")]
        //[FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        //void SetDataEventEnabled(string ConsumerID, bool DataEventEnabled);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDeviceEnabled", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDeviceEnabledResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        bool GetDeviceEnabled(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/SetDeviceEnabled", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/SetDeviceEnabledResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void SetDeviceEnabled(string ConsumerID, bool DeviceEnabled);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetFreezeEvents", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetFreezeEventsResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        bool GetFreezeEvents(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/SetFreezeEvents", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/SetFreezeEventsResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void SetFreezeEvents(string ConsumerID, bool FreezeEvents);

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetOutputID", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetOutputIDResponse")]
        //[FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        //int GetOutputID(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetPowerNotify", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetPowerNotifyResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        PowerNotification GetPowerNotify(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/SetPowerNotify", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/SetPowerNotifyResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void SetPowerNotify(string ConsumerID, PowerNotification PowerNotify);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetPowerState", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetPowerStateResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        PowerState GetPowerState(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetState", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetStateResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        ControlState GetState(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDeviceControlDescription", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDeviceControlDescriptionResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        string GetDeviceControlDescription(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDeviceControlVersion", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDeviceControlVersionResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        UposVersion GetDeviceControlVersion(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDeviceServiceDescription", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDeviceServiceDescriptionResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        string GetDeviceServiceDescription(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDeviceServiceVersion", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetDeviceServiceVersionResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        UposVersion GetDeviceServiceVersion(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetPhysicalDeviceDescription", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetPhysicalDeviceDescriptionResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        string GetPhysicalDeviceDescription(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetPhysicalDeviceName", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetPhysicalDeviceNameResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        string GetPhysicalDeviceName(string ConsumerID);

        //
        // Specific Properties
        //

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCapKeylockType", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetCapKeylockTypeResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        KeylockType GetCapKeylockType(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetElectronicKeyValue", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetElectronicKeyValueResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        byte[] GetElectronicKeyValue(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetKeyPosition", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetKeyPositionResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        int GetKeyPosition(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetPositionCount", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetPositionCountResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        int GetPositionCount(string ConsumerID);

        //
        // Common Methods
        //

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/Open", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/OpenResponse")]
        //[FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        //void Open(string ConsumerID, string EndpointAddress);

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/Close", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/CloseResponse")]
        //[FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        //void Close(string ConsumerID, string EndpointAddress);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/Claim", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/ClaimResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void Claim(string ConsumerID, int Timeout);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/Release", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/ReleaseResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void Release(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/CheckHealth", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/CheckHealthResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void CheckHealth(string ConsumerID, HealthCheckLevel Level);

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/ClearInput", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/ClearInputResponse")]
        //[FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        //void ClearInput(string ConsumerID);

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/ClearInputProperties", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/ClearInputPropertiesResponse")]
        //[FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        //void ClearInputProperties(string ConsumerID);

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/ClearOutput", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/ClearOutputResponse")]
        //[FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        //void ClearOutput(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/DirectIO", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/DirectIOResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        DirectIOData DirectIO(string ConsumerID, int Command, int Data, object Obj);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/CompareFirmwareVersion", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/CompareFirmwareVersionResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        CompareFirmwareResult CompareFirmwareVersion(string ConsumerID, string FirmwareFileName);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/ResetStatistics", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/ResetStatisticsResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void ResetStatistics(string ConsumerID, StatisticList StatisticsBuffer);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/RetrieveStatistics", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/RetrieveStatisticsResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        string RetrieveStatistics(string ConsumerID, StatisticList StatisticsBuffer);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UpdateFirmware", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UpdateFirmwareResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void UpdateFirmware(string ConsumerID, string FirmwareFileName);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UpdateStatistics", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UpdateStatisticsResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void UpdateStatistics(string ConsumerID, StatisticList StatisticsBuffer);

        //
        // Specific Methods
        //

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/WaitForKeylockChange", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/WaitForKeylockChangeResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void WaitForKeylockChange(string ConsumerID, int KeyPosition, int Timeout);

        #endregion

        #region Version 1.2

        //
        // Session Management
        //

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetWSPOSVersion", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetWSPOSVersionResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        UposVersion GetWSPOSVersion();

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GenerateConsumerID", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GenerateConsumerIDResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        string GenerateConsumerID();

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/OpenSession", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/OpenSessionResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void OpenSession(string ConsumerID, string EndpointAddress);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/CloseSession", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/CloseSessionResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void CloseSession(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetProviderSessionTimeout", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetProviderSessionTimeoutResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        int GetProviderSessionTimeout(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/KeepAlive", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/KeepAliveResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void KeepAlive(string ConsumerID);

        //
        // Device Control
        // 

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/OpenDevice", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/OpenDeviceResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void OpenDevice(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/CloseDevice", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/CloseDeviceResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void CloseDevice(string ConsumerID);

        //
        // Event Polling
        //

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/PollForUPOSEvent", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/PollForUPOSEventResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        KeylockEvent PollForUPOSEvent(string ConsumerID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/SetEventResponse", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/SetEventResponseResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        void SetEventResponse(string ConsumerID, KeylockEventResponse EventResponse);

        #endregion

        #region Version 1.3

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetEncryptedClaimedConsumerID", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/Keylock/GetEncryptedClaimedConsumerIDResponse")]
        [FaultContract(typeof(UposException), Action = "http://www.nrf-arts.org/UnifiedPOS/Keylock/UposException", Name = "UposException")]
        string GetEncryptedClaimedConsumerID();

        #endregion
    }

    #region Version 1.1

    //
    // Common Data Types
    //

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class DirectIOData
    {
        [DataMember]
        public int Data { get; set; }
        [DataMember]
        public object Obj { get; set; }
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class UposException
    {
        [DataMember]
        public ErrorCode ErrorCode { get; set; }
        [DataMember]
        public int ErrorCodeExtended { get; set; }
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class UposVersion
    {
        [DataMember]
        public int Major { get; set; }
        [DataMember]
        public int Minor { get; set; }
        [DataMember]
        public int Build { get; set; }
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class Statistic
    {
        [DataMember]
        public string Name { get; set; }
        [DataMember]
        public string Value { get; set; }
    }

    [CollectionDataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/", ItemName = "Statistic")]
    public class StatisticList : List<Statistic>
    {
    }

    //
    // Common Enumerations
    //

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public enum CompareFirmwareResult
    {
        [EnumMember]
        CFV_FIRMWARE_OLDER,
        [EnumMember]
        CFV_FIRMWARE_SAME,
        [EnumMember]
        CFV_FIRMWARE_NEWER,
        [EnumMember]
        CFV_FIRMWARE_DIFFERENT,
        [EnumMember]
        CFV_FIRMWARE_UNKNOWN,
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public enum ControlState
    {
        [EnumMember]
        S_CLOSED,
        [EnumMember]
        S_IDLE,
        [EnumMember]
        S_BUSY,
        [EnumMember]
        S_ERROR,
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public enum ErrorCode
    {
        [EnumMember]
        E_CLOSED,
        [EnumMember]
        E_CLAIMED,
        [EnumMember]
        E_NOTCLAIMED,
        [EnumMember]
        E_NOSERVICE,
        [EnumMember]
        E_DISABLED,
        [EnumMember]
        E_ILLEGAL,
        [EnumMember]
        E_NOHARDWARE,
        [EnumMember]
        E_OFFLINE,
        [EnumMember]
        E_NOEXIST,
        [EnumMember]
        E_EXISTS,
        [EnumMember]
        E_FAILURE,
        [EnumMember]
        E_TIMEOUT,
        [EnumMember]
        E_BUSY,
        [EnumMember]
        E_EXTENDED,
        [EnumMember]
        E_DEPRECATED,
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public enum HealthCheckLevel
    {
        [EnumMember]
        CH_INTERNAL,
        [EnumMember]
        CH_EXTERNAL,
        [EnumMember]
        CH_INTERACTIVE,
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public enum PowerNotification
    {
        [EnumMember]
        PN_DISABLED,
        [EnumMember]
        PN_ENABLED,
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public enum PowerReporting
    {
        [EnumMember]
        PR_NONE,
        [EnumMember]
        PR_STANDARD,
        [EnumMember]
        PR_ADVANCED,
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public enum PowerState
    {
        [EnumMember]
        PS_UNKNOWN,
        [EnumMember]
        PS_ONLINE,
        [EnumMember]
        PS_OFF,
        [EnumMember]
        PS_OFFLINE,
        [EnumMember]
        PS_OFF_OFFLINE,
    }

    /*
    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public enum StatisticCategories
    {
        [EnumMember]
        All,
        [EnumMember]
        Manufacturer,
        [EnumMember]
        Upos,
    }
    */
    public class StatisticCategories
    {
        public const string All = "";
        public const string Manufacturer = "M_";
        public const string Upos = "U_";
    }

    //
    // Specific Data Types
    //

    //
    // Specific Enumerations
    //

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public enum KeylockType
    {
        [EnumMember]
        LOCK_KT_STANDARD,
        [EnumMember]
        LOCK_KT_ELECTRONIC,
    }

    //
    // Constants
    //

    public class ExtendedError
    {
        public const int EFIRMWARE_BAD_FILE = 281;
        public const int ESTATS_ERROR = 280;
        public const int ESTATS_DEPENDENCY = 282;
    }

    public class StatisticProperties
    {
        public const string CommunicationErrorCount = "CommunicationErrorCount";
        public const string DeviceCategory = "DeviceCategory";
        public const string FirmwareRevision = "FirmwareRevision";
        public const string HoursPoweredCount = "HoursPoweredCount";
        public const string InstallationDate = "InstallationDate";
        public const string Interface = "Interface";
        public const string ManufactureDate = "ManufactureDate";
        public const string ManufacturerName = "ManufacturerName";
        public const string MechanicalRevision = "MechanicalRevision";
        public const string ModelName = "ModelName";
        public const string SerialNumber = "SerialNumber";
        public const string UnifiedPOSVersion = "UnifiedPOSVersion";
        public const string LockPositionChangeCount = "LockPositionChangeCount";

    }

    public class Wait
    {
        public const int FOREVER = -1;
    }

    public class Position
    {
        public const int LOCK_KP_ANY = 0;
        public const int LOCK_KP_LOCK = 1;
        public const int LOCK_KP_NORM = 2;
        public const int LOCK_KP_SUPR = 3;
    }

    #endregion

    #region Version 1.2

    //
    // Event Polling
    //

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class KeylockEvent
    {
        //[DataMember]
        //public DataEvent DataEvent { get; set; }
        [DataMember]
        public DirectIOEvent DirectIOEvent { get; set; }
        //[DataMember]
        //public ErrorEvent ErrorEvent { get; set; }
        //[DataMember]
        //public OutputCompleteEvent OutputCompleteEvent { get; set; }
        [DataMember]
        public StatusUpdateEvent StatusUpdateEvent { get; set; }
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class KeylockEventResponse
    {
        //[DataMember]
        //public DataEventResponse DataEventResponse { get; set; }
        [DataMember]
        public DirectIOEventResponse DirectIOEventResponse { get; set; }
        //[DataMember]
        //public ErrorEventResponse ErrorEventResponse { get; set; }
        //[DataMember]
        //public OutputCompleteEventResponse OutputCompleteEventResponse { get; set; }
        [DataMember]
        public StatusUpdateEventResponse StatusUpdateEventResponse { get; set; }
    }
    /*
    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class DataEvent
    {
        [DataMember]
        public string Source { get; set; }
        [DataMember]
        public int EventID { get; set; }
        [DataMember]
        public DateTime TimeStamp { get; set; }
        [DataMember]
        public int Status { get; set; }
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class DataEventResponse
    {
        [DataMember]
        public int EventID { get; set; }
    }
    */
    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class DirectIOEvent
    {
        [DataMember]
        public string Source { get; set; }
        [DataMember]
        public int EventID { get; set; }
        [DataMember]
        public DateTime TimeStamp { get; set; }
        [DataMember]
        public int EventNumber { get; set; }
        [DataMember]
        public int Data { get; set; }
        [DataMember]
        public object Obj { get; set; }
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class DirectIOEventResponse
    {
        [DataMember]
        public int EventID { get; set; }
        [DataMember]
        public DirectIOData DirectIOData { get; set; }
    }
    /*
    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class ErrorEvent
    {
        [DataMember]
        public string Source { get; set; }
        [DataMember]
        public int EventID { get; set; }
        [DataMember]
        public DateTime TimeStamp { get; set; }
        [DataMember]
        public ErrorCode ErrorCode { get; set; }
        [DataMember]
        public int ErrorCodeExtended { get; set; }
        [DataMember]
        public ErrorLocus ErrorLocus { get; set; }
        [DataMember]
        public ErrorResponse ErrorResponse { get; set; }
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class ErrorEventResponse
    {
        [DataMember]
        public int EventID { get; set; }
        [DataMember]
        public ErrorResponse ErrorResponse { get; set; }
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class OutputCompleteEvent
    {
        [DataMember]
        public string Source { get; set; }
        [DataMember]
        public int EventID { get; set; }
        [DataMember]
        public DateTime TimeStamp { get; set; }
        [DataMember]
        int OutputID { get; set; }
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class OutputCompleteEventResponse
    {
        [DataMember]
        public int EventID { get; set; }
    }
    */
    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class StatusUpdateEvent
    {
        [DataMember]
        public string Source { get; set; }
        [DataMember]
        public int EventID { get; set; }
        [DataMember]
        public DateTime TimeStamp { get; set; }
        [DataMember]
        public int Status { get; set; }
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public class StatusUpdateEventResponse
    {
        [DataMember]
        public int EventID { get; set; }
    }
    /*
    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public enum ErrorLocus
    {
        [EnumMember]
        EL_INPUT,
        [EnumMember]
        EL_INPUT_DATA,
        [EnumMember]
        EL_OUTPUT,
    }

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/Keylock/")]
    public enum ErrorResponse
    {
        [EnumMember]
        ER_CLEAR,
        [EnumMember]
        ER_CONTINUEINPUT,
        [EnumMember]
        ER_RETRY,
    }
    */
    #endregion
}
