<?xml version="1.0"?>
<Domain xmlns:xi="http://www.w3.org/2001/XInclude"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns="http://www.soti.net/connect-definitions">

    <Imports>
        <xi:include href="./base-rest-protocol.xml" parse="xml" />
    </Imports>

    <Messages>
        <!-- BASIC DEVICE SETTINGS-->
        <Message id="GetDeviceState" />
        <Message id="DeviceState">
            <Object id="Resource">
                <Object id="DeviceInfo">
                    <DataPointReference id="deviceName"            path="base-module#device-name" />
                    <DataPointReference id="deviceID"              path="base-module#device-id" />
                    <DataPointReference id="deviceDescription"     path="HikvisionCameraInfo#deviceDescription" />
                    <DataPointReference id="deviceLocation"        path="HikvisionCameraInfo#deviceLocation" />
                    <DataPointReference id="systemContact"         path="HikvisionCameraInfo#systemContact" />
                    <DataPointReference id="model"                 path="base-module#model-id" />
                    <DataPointReference id="serialNumber"          path="GenericDeviceState#serial-number" />
                    <DataPointReference id="macAddress"            path="NetworkInfo#mac" />
                    <DataPointReference id="firmwareVersion"       path="base-module#version" />
                    <DataPointReference id="firmwareReleasedDate"  path="HikvisionCameraInfo#firmwareReleasedDate" />
                    <DataPointReference id="encoderVersion"        path="HikvisionCameraInfo#encoderVersion" />
                    <DataPointReference id="encoderReleasedDate"   path="HikvisionCameraInfo#encoderReleasedDate" />
                    <DataPointReference id="bootVersion"           path="HikvisionCameraInfo#bootVersion" />
                    <DataPointReference id="bootReleasedDate"      path="HikvisionCameraInfo#bootReleasedDate" />
                    <DataPointReference id="hardwareVersion"       path="HikvisionCameraInfo#hardwareVersion" />
                    <DataPointReference id="deviceType"            path="HikvisionCameraInfo#deviceType" />
                    <DataPointReference id="telecontrolID"         path="HikvisionCameraInfo#telecontrolID" />
                    <DataPointReference id="supportBeep"           path="HikvisionCameraInfo#supportBeep" />
                    <DataPointReference id="supportVideoLoss"      path="HikvisionCameraInfo#supportVideoLoss" />
                    <DataPointReference id="firmwareVersionInfo"   path="HikvisionCameraInfo#firmwareVersionInfo" />
                    <DataPointReference id="subSerialNumber"       path="HikvisionCameraInfo#subSerialNumber" />
                    <DataPointReference id="OEMCode"               path="HikvisionCameraInfo#OEMCode" />
                    <DataPointReference id="customizedInfo"        path="HikvisionCameraInfo#customizedInfo" />
                </Object>
            </Object>
        </Message>

        <Message id="HikUploadFirmware">
            <Object id="Resource">
                <Segment id="File" type="filestore" />
            </Object>
        </Message>

        <Message id="Reboot" />

        <Message id="ChangeDeviceSettings">
            <Object id="Resource">
                <Object id="DeviceInfo">
                    <Segment id="deviceName" type="string" />
                </Object>
            </Object>
        </Message>

        <Message id="HikAlert">
            <Object id="Resource">
                <DataPointReference id="event_id" path="HikAlert#Id" />
                <DataPointReference id="event_description" path="HikAlert#Description" />
                <DataPointReference id="event_type" path="HikAlert#Type" />
                <DataPointReference id="timestamp" path="HikAlert#Timestamp" />
                <DataPointReference id="notification_state" path="HikAlert#NotificationState" />
                <DataPointReference id="notification_type" path="HikAlert#NotificationType" />
            </Object>
        </Message>

        <!-- TIME SETTINGS -->
        <Message id="GetTimeSettings" />

        <Message id="TimeSettings">
            <Object id="Resource">
                <Object id="Time">
                    <DataPointReference id="timeMode"   path="HikvisionCameraTime#timeMode" />
                    <DataPointReference id="localTime"  path="HikvisionCameraTime#localTime" />
                    <DataPointReference id="timeZone"   path="HikvisionCameraTime#timeZone" />
                </Object>
            </Object>
        </Message>

        <Message id="ChangeTimeSettings">
            <Object id="Resource">
                <Object id="Time">
                    <Segment id="timeMode"   type="string"   />
                    <Segment id="localTime"  type="datetime" />
                    <Segment id="timeZone"   type="string"   />
                </Object>
            </Object>
        </Message>

        <!-- NTP SETTINGS -->
        <Message id="GetNTPSettings" />

        <Message id="NTPSettings">
            <Object id="Resource">
                <Object id="NTPServer">
                    <DataPointReference id="addressingFormatType" path="HikvisionCameraTime#ntpAddressingFormatType" />
                    <DataPointReference id="hostName"            path="HikvisionCameraTime#ntpHostName"            />
                    <DataPointReference id="ipAddress"            path="HikvisionCameraTime#ntpHostName"            />
                    <DataPointReference id="portNo"              path="HikvisionCameraTime#ntpPortNo"              />
                    <DataPointReference id="synchronizeInterval" path="HikvisionCameraTime#ntpSynchronizeInterval" />
                </Object>
            </Object>
        </Message>

        <Message id="ChangeNTPSettings">
            <Object id="Resource">
                <Object id="NTPServer">
                    <Segment id="id" type="integer" />
                    <Segment id="addressingFormatType" type="string" />
                    <Segment id="hostName"            type="string" />
                    <Segment id="ipAddress" type="string" />
                    <Segment id="portNo"              type="integer" />
                    <Segment id="synchronizeInterval" type="integer" />
                </Object>
            </Object>
        </Message>
        
        <!-- SERIAL PORTS-->
        
        <Message id="GetSerialPort" />

        <Message id="SerialPort">
            <Object id="Resource">
                <Object id="SerialPort">
                    <DataPointReference id="id"          path="HikvisionCameraSerialPorts#portId" />
                    <DataPointReference id="enabled"         path="HikvisionCameraSerialPorts#enabled" />
                    <DataPointReference id="serialPortType"  path="HikvisionCameraSerialPorts#serialPortType" />
                    <DataPointReference id="duplexMode"      path="HikvisionCameraSerialPorts#duplexMode" />
                    <DataPointReference id="baudRate"        path="HikvisionCameraSerialPorts#baudRate" />
                    <DataPointReference id="dataBits"        path="HikvisionCameraSerialPorts#dataBits" />
                    <DataPointReference id="parityType"      path="HikvisionCameraSerialPorts#parityType" />
                    <DataPointReference id="stopBits"        path="HikvisionCameraSerialPorts#stopBits" />
                    <DataPointReference id="flowCtrl"        path="HikvisionCameraSerialPorts#flowCtrl" />
                    <DataPointReference id="workMode"        path="HikvisionCameraSerialPorts#workMode" />
                </Object>
            </Object>
        </Message>

        <Message id="ChangeSerialPort">
            <Object id="Resource">
                <Object id="SerialPort">
                    <Segment id="portId"          type="string"  />
                    <Segment id="enabled"         type="boolean" />
                    <Segment id="serialPortType"  type="string"  />
                    <Segment id="duplexMode"      type="string"  />
                    <Segment id="baudRate"        type="integer" />
                    <Segment id="dataBits"        type="integer" />
                    <Segment id="parityType"      type="string"  />
                    <Segment id="stopBits"        type="integer" />
                    <Segment id="flowCtrl"        type="string"  />
                    <Segment id="workMode"        type="string"  />
                </Object>
            </Object>
        </Message>
        
        <!-- TCP/IP Settings-->

        <Message id="GetNetworkSettings" />

        <Message id="NetworkSettings">
            <Object id="Resource">
                <Object id="NetworkInterface">
                    <Object id="IPAddress">
                        <DataPointReference id="ipVersion"        path="HikvisionCameraNetwork#ipVersion" />
                        <DataPointReference id="addressingType"    path="HikvisionCameraNetwork#addressingType" />
                        <DataPointReference id="ipAddress"         path="NetworkInfo#ipaddress" />
                        <DataPointReference id="subnetMask"        path="NetworkInfo#subnet-mask" />
                        <DataPointReference id="ipv6Address"       path="GenericNetworkIP6WLan#generic-network-ipv6-ipaddress" />
                        <DataPointReference id="bitMask"           path="HikvisionCameraNetwork#bitMask" />
                        <Object id="DefaultGateway">
                            <DataPointReference id="ipAddress"      path="NetworkInfo#gateway" />
                            <DataPointReference id="ipv6Address"    path="HikvisionCameraNetwork#defaultGatewayIpv6" />
                        </Object>
                        <Object id="PrimaryDNS">
                            <DataPointReference id="ipAddress"      path="NetworkInfo#dns-server" />
                            <DataPointReference id="ipv6Address"    path="HikvisionCameraNetwork#primaryDnsIpv6" />
                        </Object>
                        <Object id="SecondaryDNS">
                            <DataPointReference id="ipAddress"      path="HikvisionCameraNetwork#secondaryDnsIp" />
                            <DataPointReference id="ipv6Address"    path="HikvisionCameraNetwork#secondaryDnsIpv6" />
                        </Object>
                        <Object id="Ipv6Mode">
                            <DataPointReference id="ipV6AddressingType" path="HikvisionCameraNetwork#ipV6AddressingType" />
                        </Object>
                    </Object>

                    <Object id="Discovery">
                        <Object id="UPnP">
                            <DataPointReference id="enabled"   path="HikvisionCameraNetwork#upnpEnabled" />
                        </Object>
                        <Object id="Zeroconf">
                            <DataPointReference id="enabled"   path="HikvisionCameraNetwork#zeroconfEnabled" />
                        </Object>
                    </Object>

                    <Object id="Link">
                        <DataPointReference id="MACAddress"       path="HikvisionCameraNetwork#MACAddress" />
                        <DataPointReference id="autoNegotiation"  path="HikvisionCameraNetwork#autoNegotiation" />
                        <DataPointReference id="speed"            path="HikvisionCameraNetwork#linkSpeed" />
                        <DataPointReference id="duplex"           path="HikvisionCameraNetwork#linkDuplex" />
                        <DataPointReference id="MTU"              path="HikvisionCameraNetwork#MTU" />
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeNetworkSettings">
            <Object id="Resource">
                <Object id="NetworkInterface">
                    <Object id="IPAddress">
                        <Segment id="ipVersion"        type="string"  />
                        <Segment id="addressingType"    type="string"  />
                        <Segment id="ipAddress"         type="ipv4"  />
                        <Segment id="subnetMask"        type="ipv4"  />
                        <Segment id="ipv6Address"       type="ipv6"  />
                        <Segment id="bitMask"           type="integer" />
                        <Segment id="ipV6AddressingType" type="string" />

                        <Object id="DefaultGateway">
                            <Segment id="ipAddress"      type="ipv4"  />
                            <Segment id="ipv6Address"    type="string"  />
                        </Object>

                        <Object id="PrimaryDNS">
                            <Segment id="ipAddress"      type="string"  />
                            <Segment id="ipv6Address"    type="string"  />
                        </Object>
                        <Object id="SecondaryDNS">
                            <Segment id="ipAddress"      type="string"  />
                            <Segment id="ipv6Address"    type="string"  />
                        </Object>
                    </Object>

                    <Object id="Discovery">
                        <Object id="Zeroconf">
                            <Segment id="enabled" type="boolean" />
                        </Object>
                    </Object>

                    <Object id="Link">
                        <Segment id="MACAddress"      type="string"  />
                        <Segment id="autoNegotiation" type="boolean" />
                        <Segment id="speed"           type="integer" />
                        <Segment id="duplex"          type="string"  />
                        <Segment id="MTU"             type="integer" />
                    </Object>
                </Object>
            </Object>
        </Message>
        
        <!--UPnP Settings-->
        <Message id="GetUPnPSettings" />

        <Message id="UPnPSettings">
            <Object id="Resource">
                <Object id="UPnP">
                    <DataPointReference id="enabled"   path="HikvisionCameraNetwork#upnpEnabled" />
                </Object>
            </Object>
        </Message>

        <Message id="ChangeUPnPSettings">
            <Object id="Resource">
                <Object id="UPnP">
                    <Segment id="enabled" type="string" />
                </Object>
            </Object>
        </Message>

        <!-- DDNS SETTINGS-->
        <Message id="GetDDNSSettings" />

        <Message id="DDNSSettings">
            <Object id="Resource">
                <Object id="DDNS">
                    <DataPointReference id="enabled"               path="DDNS#enabled" />
                    <DataPointReference id="provider"              path="DDNS#provider" />
                    <Object id="serverAddress">
                        <DataPointReference id="addressingFormatType" path="DDNS#addressingFormatType" />
                        <DataPointReference id="hostName"             path="DDNS#hostName" />
                        <DataPointReference id="ipAddress"             path="DDNS#hostName" />
                    </Object>
                    <DataPointReference id="portNo"            path="DDNS#portNo" /> 
                    <DataPointReference id="deviceDomainName"      path="DDNS#deviceDomainName" />
                </Object>
            </Object>
        </Message>

        <Message id="ChangeDDNSSettings">
            <Object id="Resource">
                <Object id="DDNS">
                    <Segment id="id"                type="integer" />
                    <Segment id="enabled"           type="boolean" />
                    <Segment id="provider"          type="string" />
                    <Object id="serverAddress">
                        <Segment id="addressingFormatType" type="string" />
                        <Segment id="hostName"             type="string" />
                        <Segment id="ipAddress"             type="string" />
                    </Object>
                    <Segment id="portNo"            type="integer" />
                    <Segment id="deviceDomainName"   type="string" />
                    <Segment id="userName"           type="string" />
                    <Segment id="password"           type="string" />
                </Object>
            </Object>
        </Message>

        <!-- PORTS -->
        <Message id="GetPorts" />

        <Message id="Ports">
            <Object id="Resource">
                <Object id="AdminAccessProtocolList">
                    <DataPointReference id="AdminAccessProtocol" path="Ports#adminAccessProtocols"/>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeHTTPPort">
            <Object id="Resource">
                <Object id="AdminAccessProtocol">
                    <Segment id="id"      type="integer"/>
                    <Segment id="enabled" type="boolean"/>
                    <Segment id="protocol" type="string" />
                    <Segment id="portNo"  type="integer"/>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeHTTPSPort">
            <Object id="Resource">
                <Object id="AdminAccessProtocol">
                    <Segment id="id"      type="integer"/>
                    <Segment id="enabled" type="boolean"/>
                    <Segment id="protocol" type="string" />
                    <Segment id="portNo"  type="integer"/>
                    <Segment id="TLS1_1Enable" type="boolean" />
                    <Segment id="TLS1_2Enable" type="boolean" />
                    <Segment id="TLS1_3Enable" type="boolean" />
                </Object>
            </Object>
        </Message>

        <Message id="ChangeServerPort">
            <Object id="Resource">
                <Object id="AdminAccessProtocol">
                    <Segment id="id"      type="integer"/>
                    <Segment id="enabled" type="boolean"/>
                    <Segment id="protocol" type="string" />
                    <Segment id="portNo"  type="integer"/>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeRTSPPort">
            <Object id="Resource">
                <Object id="AdminAccessProtocol">
                    <Segment id="id"      type="integer"/>
                    <Segment id="enabled" type="boolean"/>
                    <Segment id="protocol" type="string" />
                    <Segment id="portNo"  type="integer"/>
                </Object>
            </Object>
        </Message>
        
        <!-- SNMP SETTINGS -->

        <Message id="GetSNMPSettings" />

        <Message id="SNMPSettings">
            <Object id="Resource">
                <Object id="SNMP">
                    <Object id="SNMPv1c">
                        <DataPointReference id="notificationEnabled" path="SNMP#snmpV1Enabled"/>
                        <Object     id="SNMPTrapReceiverList">
                            <Object   id="SNMPTrapReceiver">
                                <Object   id="ReceiverAddress">
                                    <DataPointReference id="addressingFormatType" path="SNMP#trapReceiverFormat"/>
                                    <DataPointReference id="ipAddress"            path="SNMP#trapReceiverIp"/>
                                    <DataPointReference id="portNo"               path="SNMP#trapReceiverPort"/>
                                </Object>
                                <DataPointReference id="communityString"       path="SNMP#trapCommunityString"/>
                            </Object>
                        </Object>

                        <DataPointReference id="enabled"        path="SNMP#snmpV1Enabled"/>
                        <DataPointReference id="writeCommunity" path="SNMP#snmpWriteCommunity"/>
                        <DataPointReference id="readCommunity"  path="SNMP#snmpReadCommunity"/>
                    </Object>

                    <Object id="SNMPv2c">
                        <DataPointReference id="notificationEnabled" path="SNMP#snmpV2cEnabled"/>
                        <Object     id="SNMPTrapReceiverList">
                            <Object   id="SNMPTrapReceiver">
                                <Object   id="ReceiverAddress">
                                    <DataPointReference id="addressingFormatType" path="SNMP#trapReceiverFormat"/>
                                    <DataPointReference id="ipAddress"            path="SNMP#trapReceiverIp"/>
                                    <DataPointReference id="portNo"               path="SNMP#trapReceiverPort"/>
                                </Object>
                                <DataPointReference id="communityString"       path="SNMP#trapCommunityString"/>
                            </Object>
                        </Object>

                        <DataPointReference id="enabled"        path="SNMP#snmpV2cEnabled"/>
                        <DataPointReference id="writeCommunity" path="SNMP#snmpWriteCommunity"/>
                        <DataPointReference id="readCommunity"  path="SNMP#snmpReadCommunity"/>
                    </Object>

                    <Object id="SNMPAdvanced">
                        <Object id="SNMPUserList">
                            <DataPointReference id="SNMPUser" path="SNMP#SNMPUserList" />
                        </Object>
                        <DataPointReference id="enabled"        path="SNMP#snmpV3Enabled" />
                    </Object>

                    <DataPointReference id="listenPort"       path="SNMP#snmpPort" />
                </Object>
            </Object>
        </Message>


        <Message id="ChangeSNMPSettings">
            <Object id="Resource">
                <!-- v1/v2c -->
                <Segment id="snmpV1Enabled"       type="string"/>
                <Segment id="snmpV2cEnabled"      type="string"/>
                <Segment id="snmpReadCommunity"   type="string"/>
                <Segment id="snmpWriteCommunity"  type="string"/>

                <!-- Trap -->
                <Object id="Trap">
                    <Object id="SNMPTrapReceiver">
                        <Segment id="id" type="integer" />
                        <Object id="ReceiverAddress">
                            <Segment id="addressingFormatType" type="string" />
                            <Segment id="ipAddress"             type="string"/>
                            <Segment id="portNo"                type="integer"/>
                        </Object>
                        <Segment id="notificationType"                      type="string"/>
                        <Segment id="communityString"                       type="string"/>
                    </Object>
                </Object>

                <!-- v3 -->
                <Segment id="snmpV3Enabled"               type="string"/>
                <Object id="ReadUser">
                    <Object id="SNMPUser">
                        <Segment id="id" type="integer" />
                        <Segment id="userName"          type="string"/>
                        <Segment id="securityLevel"     type="string"/>
                        <Segment id="snmpAuthenticationMethod"      type="string"/>
                        <Segment id="snmpAuthenticationPassword"      type="string"/>
                        <Segment id="snmpPrivacyMethod"      type="string"/>
                        <Segment id="snmpPrivacyPassword"      type="string"/>
                    </Object>
                </Object>
                <Object id="WriteUser">
                    <Object id="SNMPUser">
                        <Segment id="id" type="integer" />
                        <Segment id="userName"          type="string"/>
                        <Segment id="securityLevel" type="string"/>
                        <Segment id="snmpAuthenticationMethod"      type="string"/>
                        <Segment id="snmpAuthenticationPassword"      type="string"/>
                        <Segment id="snmpPrivacyMethod"      type="string"/>
                        <Segment id="snmpPrivacyPassword"      type="string"/>
                    </Object>
                </Object>
                    
                <!-- common -->
                <Segment id="snmpPort"                    type="integer"/>
            </Object>
        </Message>
        
        <!-- FTP SETTINGS -->
        <Message id="GetFTPNotificationSettings" />

        <Message id="FTPNotificationSettings">
            <Object id="Resource">
                <Object id="FTPNotification">
                    <DataPointReference id="enabled"               path="FTPNotification#enabled" />
                    <DataPointReference id="addressingFormatType"   path="FTPNotification#addressingFormatType" />
                    <DataPointReference id="annoyftp"   path="FTPNotification#annoyftp" />
                    <DataPointReference id="ipAddress"              path="FTPNotification#ipAddress" />
                    <DataPointReference id="hostName"              path="FTPNotification#ipAddress" />
                    <DataPointReference id="portNo"                 path="FTPNotification#portNo" />
                    <DataPointReference id="userName"               path="FTPNotification#userName" />
                    <DataPointReference id="password"               path="FTPNotification#password" />
                    <DataPointReference id="uploadPicture"          path="FTPNotification#uploadPicture" />
                    <Object id="uploadPath">
                        <DataPointReference id="pathDepth"              path="FTPNotification#pathDepth" />
                        <DataPointReference id="topDirNameRule"         path="FTPNotification#topDirNameRule" />
                        <DataPointReference id="subDirNameRule"         path="FTPNotification#subDirNameRule" />
                    </Object>
                    <DataPointReference id="picArchivingInterval"   path="FTPNotification#picArchivingInterval" />
                </Object>
            </Object>
        </Message>

        <Message id="ChangeFTPNotificationSettings">
            <Object id="Resource">
                <Object id="FTPNotification">
                    <Segment id="id"                     type="integer" />
                    <Segment id="annoyftp" type="boolean" />
                    <Segment id="enabled"                type="boolean" />
                    <Segment id="addressingFormatType"   type="string" />
                    <Segment id="ipAddress"              type="string" />
                    <Segment id="hostName"              type="string" />
                    <Segment id="portNo"                 type="integer" />
                    <Segment id="userName"               type="string" />
                    <Segment id="password"               type="string" />
                    <Segment id="uploadPicture"          type="boolean" />
                    <Object  id="uploadPath">
                        <Segment id="pathDepth"          type="integer" />
                        <Segment id="topDirNameRule"     type="string" />
                        <Segment id="subDirNameRule"     type="string" />
                    </Object>
                    <Segment id="picArchivingInterval"   type="integer" />
                </Object>
            </Object>
        </Message>
        
        <!-- EMAIL SETTINGS-->

        <Message id="GetMailingListSettings"/>

        <Message id="MailingListSettings">
            <Object id="Resource">
                    <Object id="mailing">
                        <Object id="sender">
                            <DataPointReference id="name"               path="MailingList#senderName"/>
                            <DataPointReference id="emailAddress"       path="MailingList#senderEmailAddress"/>
                            <Object id="smtp">
                                <DataPointReference id="enableAuthorization" path="MailingList#enableAuthorization"/>
                                <DataPointReference id="enableTLS" path="MailingList#enableTLS"/>
                                <DataPointReference id="addressingFormatType" path="MailingList#smtpAddressingFormatType"/>
                                <DataPointReference id="hostName"           path="MailingList#smtpHostName"/>
                                <DataPointReference id="ipAddress"           path="MailingList#smtpHostName"/>
                                <DataPointReference id="portNo"             path="MailingList#smtpPortNo"/>
                                <DataPointReference id="accountName"           path="MailingList#smtpUsername"/>
                                <DataPointReference id="password"           path="MailingList#smtpPassword"/>
                            </Object>
                        </Object>
                        <Object id="receiverList">
                            <DataPointReference id="receiver" path="MailingList#receiverList" />
                        </Object>
                        <Object id="attachment">
                            <Object id="snapshot">
                                <DataPointReference id="enabled"          path="MailingList#snapshotEnabled"/>
                                <DataPointReference id="interval"         path="MailingList#snapshotInterval"/>
                            </Object>
                        </Object>
                    </Object>
                </Object>
        </Message>

        <Message id="ChangeMailingListSettings">
            <Object id="Resource">
                <Object id="mailing">
                    <Segment id="id"                   type="integer"/>
                    <Object id="sender">
                        <Segment id="name"               type="string"/>
                        <Segment id="emailAddress"       type="string"/>
                        <Object id="smtp">
                            <Segment id="enableAuthorization" type="boolean"/>
                            <Segment id="enableTLS" type="boolean"/>
                            <Segment id="addressingFormatType" type="string"/>
                            <Segment id="hostName"          type="string"/>
                            <Segment id="ipAddress"          type="string"/>
                            <Segment id="portNo"            type="integer"/>
                            <Segment id="accountName"       type="string"/>
                            <Segment id="password"          type="string"/>
                        </Object>
                    </Object>
                    <Object id="receiverList">
                        <Segment id="receiver" type="integer" /> <!-- PLACEHOLDER -->
                    </Object>
                    <Object id="attachment">
                        <Object id="snapshot">
                            <Segment id="enabled"          type="boolean"/>
                            <Segment id="interval"         type="integer"/>
                        </Object>
                    </Object>
                </Object>
            </Object>
        </Message>

        <!-- EHOME SETTINGS -->
        <Message id="GetEhomeSettings"/>

        <Message id="EhomeSettings">
            <Object id="Resource">
                <Object id="Ehome">
                    <DataPointReference id="enabled"             path="Ehome#enabled"             />
                    <DataPointReference id="addressingFormatType" path="Ehome#addressingFormatType"/>
                    <DataPointReference id="ipAddress"           path="Ehome#ipAddress_hostname"           />
                    <DataPointReference id="hostName"           path="Ehome#ipAddress_hostname"           />
                    <DataPointReference id="portNo"              path="Ehome#portNo"              />
                    <DataPointReference id="deviceID"            path="Ehome#deviceID"            />
                    <DataPointReference id="protocolVersion"     path="Ehome#protocolVersion"     />
                </Object>
            </Object>
        </Message>

        <Message id="ChangeEhomeSettings">
            <Object id="Resource">
                <Object id="Ehome">
                    <Segment id="enabled"             type="boolean"/>
                    <Segment id="addressingFormatType" type="string"/>
                    <Segment id="ipAddress"           type="string"/>
                    <Segment id="hostName"           type="string"/>
                    <Segment id="portNo"              type="integer"/>
                    <Segment id="deviceID"            type="string"/>
                    <Segment id="protocolVersion"     type="string"/>
                    <Segment id="key"                 type="string"/>
                </Object>
            </Object>
        </Message>

        <!-- QoS / DSCP  -->

        <Message id="GetQoSSettings"/>

        <Message id="QoSSettings">
            <Object id="Resource">
                <Object id="DSCPList">
                    <DataPointReference id="DSCP" path="QoS#dscpRules"/>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeQoSSettings">
            <Object id="Resource">
                <Object id="DSCPList">
                    <Object id="DSCP">
                        <Segment id="id"            type="integer"/>
                        <Segment id="enabled"       type="boolean"/>
                        <Segment id="priorityValue" type="integer"/>
                        <Segment id="trafficType"   type="string"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <!-- 802.1x SETTINGS -->
        <Message id="GetIEEE8021xSettings"/>

        <Message id="IEEE8021xSettings">
            <Object id="Resource">
                <Object id="IEEE802_1x">
                    <DataPointReference id="enabled"                    path="IEEE8021x#enabled"/>
                    <DataPointReference id="authenticationProtocolType" path="IEEE8021x#authenticationProtocolType"/>
                    <DataPointReference id="validateServerEnabled"      path="IEEE8021x#validateServerEnabled"/>
                    <DataPointReference id="userName"                   path="IEEE8021x#userName"/>
                    <DataPointReference id="password"                   path="IEEE8021x#password"/>
                    <DataPointReference id="autoPACProvisioningEnabled" path="IEEE8021x#autoPACProvisioningEnabled"/>
                    <Object id="Extensions">
                        <DataPointReference id="EAPOLVersion"               path="IEEE8021x#EAPOLVersion"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeIEEE8021xSettings">
            <Object id="Resource">
                <Object id="IEEE802_1x">
                    <Segment id="enabled"                    type="boolean"/>
                    <Segment id="authenticationProtocolType" type="string"/>
                    <Segment id="userName"                   type="string"/>
                    <Segment id="password"                   type="string"/>
                    <Segment id="EAPOLVersion"               type="integer"/>
                </Object>
            </Object>
        </Message>

        <!-- INTEGRATE (ONVIF / ISAPI) -->
        <Message id="GetIntegrateSettings"/>

        <Message id="IntegrateSettings">
            <Object id="Resource">
                <Object id="Integrate">
                    <Object id="ONVIF">
                        <DataPointReference id="enable" path="Integrate#onvifEnabled"/>
                    </Object>
                    <Object id="ISAPI">
                        <DataPointReference id="enable" path="Integrate#isapiEnabled"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeIntegrateSettings">
            <Object id="Resource">
                <Object id="Integrate">
                    <Object id="ONVIF">
                        <Segment id="enable" type="boolean"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <!-- COMMON -->
        
        <Message id="FactoryReset">
            <Object id="Resource">
                <Segment id="mode" type="string" />
            </Object>
        </Message>

        <!-- ───────── MAIN-STREAM VIDEO SETTINGS (channel-101) ───────── -->

        <Message id="GetStreamingMainSettings"/>

        <Message id="StreamingMainSettings">
            <Object id="Resource">
                <Object id="StreamingChannel">
                    <Object id="Audio">
                        <DataPointReference id="enabled" path="StreamingMain-Data#audioEnabled"/>
                    </Object>

                    <Object id="Video">
                        <DataPointReference id="enabled" path="StreamingMain-Data#videoEnabled" />
                        <DataPointReference id="videoResolutionWidth"
                                            path="StreamingMain-Data#videoResolutionWidth"/>
                        <DataPointReference id="videoResolutionHeight"
                                            path="StreamingMain-Data#videoResolutionHeight"/>
                        <DataPointReference id="videoQualityControlType"
                                            path="StreamingMain-Data#videoQualityControlType"/>
                        <DataPointReference id="constantBitRate"
                                            path="StreamingMain-Data#constantBitRate"/>
                        <DataPointReference id="vbrUpperCap"
                                            path="StreamingMain-Data#constantBitRate"/>
                        <DataPointReference id="fixedQuality"
                                            path="StreamingMain-Data#fixedQuality"/>
                        <DataPointReference id="maxFrameRate"
                                            path="StreamingMain-Data#maxFrameRate"/>
                        <DataPointReference id="GovLength"
                                            path="StreamingMain-Data#govLength"/>
                        <DataPointReference id="videoCodecType"
                                            path="StreamingMain-Data#videoCodecType"/>
                        <DataPointReference id="H264Profile"
                                            path="StreamingMain-Data#H264Profile"/>
                        <DataPointReference id="smoothing"
                                            path="StreamingMain-Data#smoothing"/>
                        <DataPointReference id="vbrAverageCap"
                                            path="StreamingMain-Data#vbrAverageCap"/>
                        <Object id="SVC">
                            <DataPointReference id="enabled"
                                                path="StreamingMain-Data#svcEnabled"/>
                            <DataPointReference id="SVCMode"
                                                path="StreamingMain-Data#svcMode"/>
                        </Object>
                        <Object id="SmartCodec">
                            <DataPointReference id="enabled"
                                                path="StreamingMain-Data#smartCodecEnabled"/>
                        </Object>
                    </Object>
                    <Object id="Transport">
                        <Object id="Security">
                            <DataPointReference id="certificateType" path="StreamingMain-Data#transportCertificateType"/>
                            <Object id="SecurityAlgorithm">
                                <DataPointReference id="algorithmType" path="StreamingMain-Data#algorithmType"/>
                            </Object>
                        </Object>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeStreamingMainSettings">
            <Object id="Resource">
                <Object id="StreamingChannel">
                    <Object id="Audio">
                        <Segment id="enabled" type="boolean"/>
                    </Object>
                    <Object id="Video">
                        <Segment id="enabled" type="boolean" />
                        <Segment id="videoResolutionWidth"    type="integer"/>
                        <Segment id="videoResolutionHeight"   type="integer"/>
                        <Segment id="videoQualityControlType" type="string"/>
                        <Segment id="constantBitRate"         type="integer"/>
                        <Segment id="vbrUpperCap"         type="integer"/>
                        <Segment id="fixedQuality"            type="integer"/>
                        <Segment id="maxFrameRate"            type="integer"/>
                        <Segment id="GovLength"               type="integer"/>
                        <Segment id="videoCodecType"          type="string"/>
                        <Segment id="H264Profile"             type="string"/>
                        <Segment id="smoothing"               type="integer"/>
                        <Segment id="vbrAverageCap"       type="integer"/>
                        <Object id="SVC">
                            <Segment id="enabled" type="boolean"/>
                            <Segment id="SVCMode" type="string" />
                        </Object>
                        <Object id="SmartCodec">
                            <Segment id="enabled" type="boolean"/>
                        </Object>
                    </Object>
                    <Object id="Transport">
                        <Object id="Security">
                            <Segment id="certificateType" type="string"/>
                            <Object id="SecurityAlgorithm">
                                <Segment id="algorithmType" type="string"/>
                            </Object>
                        </Object>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="GetStreamingSubSettings"/>

        <Message id="StreamingSubSettings">
            <Object id="Resource">
                <Object id="StreamingChannel">
                    <Object id="Audio">
                        <DataPointReference id="enabled"            path="StreamingSub-Data#audioEnabled"/>
                    </Object>
                    <Object id="Video">
                        <DataPointReference id="enabled"            path="StreamingSub-Data#videoEnabled"/>
                        <DataPointReference id="videoResolutionWidth"  path="StreamingSub-Data#videoResolutionWidth"/>
                        <DataPointReference id="videoResolutionHeight" path="StreamingSub-Data#videoResolutionHeight"/>
                        <DataPointReference id="videoQualityControlType" path="StreamingSub-Data#videoQualityControlType"/>
                        <DataPointReference id="constantBitRate"        path="StreamingSub-Data#constantBitRate"/>
                        <DataPointReference id="fixedQuality"           path="StreamingSub-Data#fixedQuality"/>
                        <DataPointReference id="maxFrameRate"           path="StreamingSub-Data#maxFrameRate"/>
                        <DataPointReference id="GovLength"              path="StreamingSub-Data#govLength"/>
                        <DataPointReference id="videoCodecType"         path="StreamingSub-Data#videoCodecType"/>
                        <DataPointReference id="H264Profile"            path="StreamingSub-Data#H264Profile"/>
                        <DataPointReference id="smoothing"              path="StreamingSub-Data#smoothing"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeStreamingSubSettings">
            <Object id="Resource">
                <Object id="StreamingChannel">
                    <Object id="Audio">
                        <Segment id="enabled" type="boolean"/>
                    </Object>
                    <Object id="Video">
                        <Segment id="enabled" type="boolean" />
                        <Segment id="videoResolutionWidth"    type="integer"/>
                        <Segment id="videoResolutionHeight"   type="integer"/>
                        <Segment id="videoQualityControlType" type="string"/>
                        <Segment id="constantBitRate"         type="integer"/>
                        <Segment id="vbrUpperCap"         type="integer"/>
                        <Segment id="fixedQuality"            type="integer"/>
                        <Segment id="maxFrameRate"            type="integer"/>
                        <Segment id="GovLength"               type="integer"/>
                        <Segment id="videoCodecType"          type="string"/>
                        <Segment id="H264Profile"             type="string"/>
                        <Segment id="smoothing"               type="integer"/>
                        <Object id="SVC">
                            <Segment id="enabled" type="boolean"/>
                            <Segment id="SVCMode" type="string" />
                        </Object>
                        <Object id="SmartCodec">
                            <Segment id="enabled" type="boolean"/>
                        </Object>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="GetStreamingThirdSettings"/>

        <Message id="StreamingThirdSettings">
            <Object id="Resource">
                <Object id="StreamingChannel">
                    <Object id="Audio">
                        <DataPointReference id="enabled"            path="StreamingThird-Data#audioEnabled"/>
                    </Object>
                    <Object id="Video">
                        <DataPointReference id="enabled"            path="StreamingThird-Data#videoEnabled"/>
                        <DataPointReference id="videoResolutionWidth"  path="StreamingThird-Data#videoResolutionWidth"/>
                        <DataPointReference id="videoResolutionHeight" path="StreamingThird-Data#videoResolutionHeight"/>
                        <DataPointReference id="videoQualityControlType" path="StreamingThird-Data#videoQualityControlType"/>
                        <DataPointReference id="constantBitRate"        path="StreamingThird-Data#constantBitRate"/>
                        <DataPointReference id="fixedQuality"           path="StreamingThird-Data#fixedQuality"/>
                        <DataPointReference id="maxFrameRate"           path="StreamingThird-Data#maxFrameRate"/>
                        <DataPointReference id="GovLength"              path="StreamingThird-Data#govLength"/>
                        <DataPointReference id="videoCodecType"         path="StreamingThird-Data#videoCodecType"/>
                        <DataPointReference id="H264Profile"            path="StreamingThird-Data#H264Profile"/>
                        <DataPointReference id="smoothing"              path="StreamingThird-Data#smoothing"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeStreamingThirdSettings">
            <Object id="Resource">
                <Object id="StreamingChannel">
                    <Object id="Audio">
                        <Segment id="enabled" type="boolean"/>
                    </Object>
                    <Object id="Video">
                        <Segment id="enabled" type="boolean" />
                        <Segment id="videoResolutionWidth"    type="integer"/>
                        <Segment id="videoResolutionHeight"   type="integer"/>
                        <Segment id="videoQualityControlType" type="string"/>
                        <Segment id="constantBitRate"         type="integer"/>
                        <Segment id="vbrUpperCap"         type="integer"/>
                        <Segment id="fixedQuality"            type="integer"/>
                        <Segment id="maxFrameRate"            type="integer"/>
                        <Segment id="GovLength"               type="integer"/>
                        <Segment id="videoCodecType"          type="string"/>
                        <Segment id="H264Profile"             type="string"/>
                        <Segment id="smoothing"               type="integer"/>
                        <Object id="SVC">
                            <Segment id="enabled" type="boolean"/>
                            <Segment id="SVCMode" type="string" />
                        </Object>
                        <Object id="SmartCodec">
                            <Segment id="enabled" type="boolean"/>
                        </Object>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="GetAudioSettings"/>
        <Message id="AudioSettings">
            <Object id="Resource">
                <Object id="AudioChannel">
                    <DataPointReference id="enabled"        path="TwoWayAudioChannel#audioEnabled"/>
                </Object>
            </Object>
        </Message>
        
        <Message id="GetTwoWayAudioSettings"/>
        <Message id="TwoWayAudioSettings">
            <Object id="Resource">
                <Object id="TwoWayAudioChannel">
                    <DataPointReference id="enabled"                   path="TwoWayAudioChannel#twoWayAudioEnabled"/>
                    <DataPointReference id="audioCompressionType"      path="TwoWayAudioChannel#audioCompressionType"/>
                    <DataPointReference id="audioInputType"            path="TwoWayAudioChannel#audioInputType"/>
                    <DataPointReference id="speakerVolume"             path="TwoWayAudioChannel#speakerVolume"/>
                    <DataPointReference id="noisereduce"               path="TwoWayAudioChannel#noisereduce"/>
                    <DataPointReference id="audioSamplingRate"         path="TwoWayAudioChannel#audioSamplingRate"/>
                    <DataPointReference id="audioBitRate"              path="TwoWayAudioChannel#audioBitRate"/>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeTwoWayAudioSettings">
            <Object id="Resource">
                <Object id="TwoWayAudioChannel">
                    <Segment id="id" type="integer" />
                    <Segment id="enabled"                   type="boolean"/>
                    <Segment id="audioCompressionType"      type="string"/>
                    <Segment id="audioInputType"            type="string"/>
                    <Segment id="speakerVolume"             type="integer"/>
                    <Segment id="noisereduce"               type="boolean"/>
                    <Segment id="audioSamplingRate"         type="integer"/>
                    <Segment id="audioBitRate"              type="integer"/>
                </Object>
            </Object>
        </Message>

        <!-- USER PERMISSIONS -->
        <Message id="GetUserPermissions" />

        <Message id="UserPermissions">
            <Object id="Resource">
                <Object id="UserList">
                    <DataPointReference
                            id="User"
                            path="UserPermissions#userPermissionList" />
                </Object>
            </Object>
        </Message>

        <!-- USER MANAGEMENT -->
        <Message id="AddOrModifyUser">
            <Object id="Resource">
                <Segment id="userName" type="string" />
                <Segment id="userLevel" type="string" />
                <Segment id="newPassword" type="string" />
                <Segment id="confirmNewPassword" type="string" />
            </Object>
        </Message>
        <Message id="DeleteUser">
            <Object id="Resource">
                <Segment id="userName" type="string" />
            </Object>
        </Message>

        <!-- ONLINE USERS -->
        <Message id="GetOnlineUsers" />

        <Message id="OnlineUsers">
            <Object id="Resource">
                <Object id="OnlineUserList">
                    <DataPointReference
                            id="OnlineUser"
                            path="OnlineUsers-Data#onlineUserList" />
                </Object>
            </Object>
        </Message>
        <!-- VCA Resource-->

        <Message id="GetVCAResourceSettings">
            <Segment id="ChannelId" type="integer" />
        </Message>
        <Message id="VCAResourceSettings">
            <Object id="Resource">
                <Object id="VCAResource">
                    <DataPointReference id="type" path="HikvisionCameraVCA#vcaType" />
                </Object>
            </Object>
        </Message>

        <Message id="ChangeVCAResourceSettings">
            <Segment id="ChannelId" type="integer" />
            <Object id="Resource">
                <Object id="VCAResource">
                    <Segment id="type" type="string" />
                </Object>
            </Object>
        </Message>

        <!-- IMAGE SETTINGS -->
        <Message id="GetImageSettings">
            <Segment id="ChannelId" type="integer" />
        </Message>
        <Message id="ImageSettings">
            <Object id="Resource">
                <Object id="ISPMode">
                    <DataPointReference id="mode" path="HikvisionCameraDayNightISPMode#ispMode"/>
                    <Object id="Schedule">
                        <DataPointReference id="scheduleType" path="HikvisionCameraDayNightISPMode#ispScheduleType"/>
                        <Object id="TimeRange">
                            <DataPointReference id="beginTime" path="HikvisionCameraDayNightISPMode#ispScheduleBegin"/>
                            <DataPointReference id="endTime" path="HikvisionCameraDayNightISPMode#ispScheduleEnd"/>
                        </Object>
                    </Object>
                </Object>
                <Object id="ImageChannel">
                    <Object id="Color">
                        <DataPointReference id="brightnessLevel" path="HikvisionCameraImageAdjustment#brightnessLevel"/>
                        <DataPointReference id="contrastLevel" path="HikvisionCameraImageAdjustment#contrastLevel"/>
                        <DataPointReference id="saturationLevel" path="HikvisionCameraImageAdjustment#saturationLevel"/>
                    </Object>
                    <Object id="Sharpness">
                        <DataPointReference id="SharpnessLevel" path="HikvisionCameraImageAdjustment#sharpnessLevel"/>
                    </Object>
                    <Object id="Gain">
                        <DataPointReference id="GainLevel" path="HikvisionCameraExposure#gainLevel"/>
                    </Object>
                    <Object id="Shutter">
                        <DataPointReference id="ShutterLevel" path="HikvisionCameraExposure#shutterLevel"/>
                    </Object>
                    <Object id="Dehaze">
                        <DataPointReference id="DehazeMode" path="HikvisionCameraImageEnhancement#dehazeMode"/>
                    </Object>
                    <Object id="ImageFlip">
                        <DataPointReference id="ImageFlipStyle" path="HikvisionCameraVideoAdjustment#imageFlipStyle"/>
                        <DataPointReference id="enabled" path="HikvisionCameraVideoAdjustment#imageFlipEnabled"/>
                    </Object>
                    <Object id="corridor">
                        <DataPointReference id="enabled" path="HikvisionCameraVideoAdjustment#corridorEnabled"/>
                    </Object>
                    <Object id="powerLineFrequency">
                        <DataPointReference id="powerLineFrequencyMode" path="HikvisionCameraVideoAdjustment#powerLineFrequency"/>
                    </Object>

                    <Object id="IrcutFilter">
                        <DataPointReference id="IrcutFilterType" path="HikvisionCameraIRCutFilter#ircutFilterType"/>
                        <DataPointReference id="nightToDayFilterLevel" path="HikvisionCameraIRCutFilter#nightToDayFilterLevel"/>
                        <DataPointReference id="nightToDayFilterTime" path="HikvisionCameraIRCutFilter#nightToDayFilterTime"/>
                        <Object id="Schedule">
                            <Object id="TimeRange">
                                <DataPointReference id="beginTime" path="HikvisionCameraIRCutFilter#ispScheduleBegin"/>
                                <DataPointReference id="endTime" path="HikvisionCameraIRCutFilter#ispScheduleEnd"/>
                            </Object>
                        </Object>
                    </Object>

                    <Object id="WDR">
                        <DataPointReference id="mode" path="HikvisionCameraBackLight#wdrMode"/>
                        <DataPointReference id="WDRLevel" path="HikvisionCameraBackLight#wdrLevel"/>
                    </Object>
                    <Object id="BLC">
                        <DataPointReference id="enabled" path="HikvisionCameraBackLight#blcEnabled"/>
                        <DataPointReference id="BLCMode" path="HikvisionCameraBackLight#blcMode"/>
                    </Object>

                    <Object id="NoiseReduce">
                        <DataPointReference id="mode" path="HikvisionCameraImageEnhancement#dnrMode"/>
                        <Object id="GeneralMode">
                            <DataPointReference id="generalLevel" path="HikvisionCameraImageEnhancement#generalLevel"/>
                        </Object>
                        <Object id="AdvancedMode">
                            <DataPointReference id="FrameNoiseReduceLevel" path="HikvisionCameraImageEnhancement#frameNoiseReduceLevel"/>
                            <DataPointReference id="InterFrameNoiseReduceLevel" path="HikvisionCameraImageEnhancement#interFrameNoiseReduceLevel"/>
                        </Object>
                    </Object>

                    <Object id="WhiteBalance">
                        <DataPointReference id="WhiteBalanceStyle" path="HikvisionCameraWhiteBalance#whiteBalanceStyle"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="GetImageSettingsDay">
            <Segment id="ChannelId" type="integer" />
        </Message>
        <Message id="ImageSettingsDay">
            <Object id="Resource">
                <Object id="ImageChannel">
                    <Object id="Color">
                        <DataPointReference id="brightnessLevel" path="HikvisionCameraImageAdjustment#brightnessLevelDay"/>
                        <DataPointReference id="contrastLevel"   path="HikvisionCameraImageAdjustment#contrastLevelDay"/>
                        <DataPointReference id="saturationLevel" path="HikvisionCameraImageAdjustment#saturationLevelDay"/>
                    </Object>

                    <Object id="Sharpness">
                        <DataPointReference id="SharpnessLevel" path="HikvisionCameraImageAdjustment#sharpnessLevelDay"/>
                    </Object>

                    <Object id="Gain">
                        <DataPointReference id="GainLevel" path="HikvisionCameraExposure#gainLevelDay"/>
                    </Object>

                    <Object id="Shutter">
                        <DataPointReference id="ShutterLevel" path="HikvisionCameraExposure#shutterLevelDay"/>
                    </Object>

                    <Object id="Dehaze">
                        <DataPointReference id="DehazeMode" path="HikvisionCameraImageEnhancement#dehazeModeDay"/>
                    </Object>

                    <Object id="NoiseReduce">
                        <DataPointReference id="mode" path="HikvisionCameraImageEnhancement#dnrModeDay"/>
                        <Object id="GeneralMode">
                            <DataPointReference id="generalLevel" path="HikvisionCameraImageEnhancement#generalLevelDay"/>
                        </Object>
                        <Object id="AdvancedMode">
                            <DataPointReference id="FrameNoiseReduceLevel"      path="HikvisionCameraImageEnhancement#frameNoiseReduceLevelDay"/>
                            <DataPointReference id="InterFrameNoiseReduceLevel" path="HikvisionCameraImageEnhancement#interFrameNoiseReduceLevelDay"/>
                        </Object>
                    </Object>

                    <Object id="WhiteBalance">
                        <DataPointReference id="WhiteBalanceStyle" path="HikvisionCameraWhiteBalance#whiteBalanceStyleDay"/>
                    </Object>

                    <Object id="WDR">
                        <DataPointReference id="mode"     path="HikvisionCameraBackLight#wdrModeDay"/>
                        <DataPointReference id="WDRLevel" path="HikvisionCameraBackLight#wdrLevelDay"/>
                    </Object>
                    <Object id="BLC">
                        <DataPointReference id="enabled" path="HikvisionCameraBackLight#blcEnabledDay"/>
                        <DataPointReference id="BLCMode" path="HikvisionCameraBackLight#blcModeDay"/>
                    </Object>
                    <Object id="HLC">
                        <DataPointReference id="enabled" path="HikvisionCameraBackLight#hlcEnabledDay"/>
                        <DataPointReference id="level"   path="HikvisionCameraBackLight#hlcHlclevelDay"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="GetImageSettingsNight">
            <Segment id="ChannelId" type="integer" />
        </Message>
        <Message id="GetImageSettingsISP">
            <Segment id="ChannelId" type="integer" />
        </Message>
        <Message id="ImageSettingsNight">
            <Object id="Resource">
                <Object id="ImageChannel">
                    <Object id="Color">
                        <DataPointReference id="brightnessLevel" path="HikvisionCameraImageAdjustment#brightnessLevelNight"/>
                        <DataPointReference id="contrastLevel"   path="HikvisionCameraImageAdjustment#contrastLevelNight"/>
                        <DataPointReference id="saturationLevel" path="HikvisionCameraImageAdjustment#saturationLevelNight"/>
                    </Object>

                    <Object id="Sharpness">
                        <DataPointReference id="SharpnessLevel" path="HikvisionCameraImageAdjustment#sharpnessLevelNight"/>
                    </Object>

                    <Object id="Gain">
                        <DataPointReference id="GainLevel" path="HikvisionCameraExposure#gainLevelNight"/>
                    </Object>

                    <Object id="Shutter">
                        <DataPointReference id="ShutterLevel" path="HikvisionCameraExposure#shutterLevelNight"/>
                    </Object>

                    <Object id="Dehaze">
                        <DataPointReference id="DehazeMode" path="HikvisionCameraImageEnhancement#dehazeModeNight"/>
                    </Object>

                    <Object id="NoiseReduce">
                        <DataPointReference id="mode" path="HikvisionCameraImageEnhancement#dnrModeNight"/>
                        <Object id="GeneralMode">
                            <DataPointReference id="generalLevel" path="HikvisionCameraImageEnhancement#generalLevelNight"/>
                        </Object>
                        <Object id="AdvancedMode">
                            <DataPointReference id="FrameNoiseReduceLevel"      path="HikvisionCameraImageEnhancement#frameNoiseReduceLevelNight"/>
                            <DataPointReference id="InterFrameNoiseReduceLevel" path="HikvisionCameraImageEnhancement#interFrameNoiseReduceLevelNight"/>
                        </Object>
                    </Object>

                    <Object id="WhiteBalance">
                        <DataPointReference id="WhiteBalanceStyle" path="HikvisionCameraWhiteBalance#whiteBalanceStyleNight"/>
                    </Object>

                    <Object id="WDR">
                        <DataPointReference id="mode"     path="HikvisionCameraBackLight#wdrModeNight"/>
                        <DataPointReference id="WDRLevel" path="HikvisionCameraBackLight#wdrLevelNight"/>
                    </Object>
                    <Object id="BLC">
                        <DataPointReference id="enabled" path="HikvisionCameraBackLight#blcEnabledNight"/>
                        <DataPointReference id="BLCMode" path="HikvisionCameraBackLight#blcModeNight"/>
                    </Object>
                    <Object id="HLC">
                        <DataPointReference id="enabled" path="HikvisionCameraBackLight#hlcEnabledNight"/>
                        <DataPointReference id="level"   path="HikvisionCameraBackLight#hlcHlclevelNight"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeImageSettings">
            <Segment id="TimeOfDay" type="string" />
            <Segment id="ChannelId" type="integer" />
            <Object id="Resource">
                <Object id="ImageChannel">
                    <Object id="Color">
                        <Segment id="brightnessLevel" type="integer"/>
                        <Segment id="contrastLevel" type="integer"/>
                        <Segment id="saturationLevel" type="integer"/>
                    </Object>
                    <Object id="Sharpness">
                        <Segment id="SharpnessLevel" type="integer"/>
                    </Object>
                    <Object id="Gain">
                        <Segment id="GainLevel" type="integer"/>
                    </Object>
                    <Object id="Shutter">
                        <Segment id="ShutterLevel" type="string"/>
                    </Object>
                    <Object id="Dehaze">
                        <Segment id="DehazeMode" type="string"/>
                    </Object>
                    <Object id="ImageFlip">
                        <Segment id="ImageFlipStyle" type="string"/>
                        <Segment id="enabled" type="boolean"/>
                    </Object>
                    <Object id="corridor">
                        <Segment id="enabled" type="boolean"/>
                    </Object>
                    <Object id="ISPMode">
                        <Segment id="mode" type="string"/>
                        <Object id="Schedule">
                            <Segment id="scheduleType" type="string"/>
                            <Object id="TimeRange">
                                <Segment id="beginTime" type="time"/>
                                <Segment id="endTime" type="time"/>
                            </Object>
                        </Object>
                    </Object>
                    <Object id="IrcutFilter">
                        <Segment id="IrcutFilterType" type="string"/>
                        <Segment id="nightToDayFilterLevel" type="string"/>
                        <Segment id="nightToDayFilterTime" type="integer"/>
                        <Object id="Schedule">
                            <Segment id="scheduleType" type="string"/>
                            <Object id="TimeRange">
                                <Segment id="beginTime" type="time"/>
                                <Segment id="endTime" type="time"/>
                            </Object>
                        </Object>
                    </Object>
                    <Object id="WDR">
                        <Segment id="mode" type="string"/>
                        <Segment id="WDRLevel" type="integer"/>
                    </Object>
                    <Object id="BLC">
                        <Segment id="enabled" type="boolean"/>
                        <Segment id="BLCMode" type="string"/>
                    </Object>
                    <Object id="HLC">
                        <Segment id="enabled" type="boolean"/>
                        <Segment id="level" type="integer"/>
                    </Object>
                    <Object id="NoiseReduce">
                        <Segment id="mode" type="string"/>
                        <Object id="GeneralMode">
                            <Segment id="generalLevel" type="integer"/>
                        </Object>
                        <Object id="AdvancedMode">
                            <Segment id="FrameNoiseReduceLevel" type="integer"/>
                            <Segment id="InterFrameNoiseReduceLevel" type="integer"/>
                        </Object>
                    </Object>
                    <Object id="WhiteBalance">
                        <Segment id="WhiteBalanceStyle" type="string"/>
                    </Object>
                    <Object id="powerLineFrequency">
                        <Segment id="powerLineFrequencyMode" type="string"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <!-- Security -->

        <Message id="GetSSHSettings"/>
        <Message id="SSHSettings">
            <Object id="Resource">
                <Object id="SSH">
                    <DataPointReference id="enabled" path="HikvisionCameraSecurity#sshEnabled" />
                </Object>
            </Object>
        </Message>

        <Message id="ChangeSSHSettings">
            <Object id="Resource">
                <Object id="SSH">
                    <Segment id="enabled" type="boolean" />
                </Object>
            </Object>
        </Message>

        <Message id="GetIllegalLoginLockSettings"/>
        <Message id="IllegalLoginLockSettings">
            <Object id="Resource">
                <Object id="IllegalLoginLock">
                    <DataPointReference id="enabled" path="HikvisionCameraSecurity#illegalLockEnabled" />
                </Object>
            </Object>
        </Message>

        <Message id="ChangeIllegalLoginLockSettings">
            <Object id="Resource">
                <Object id="IllegalLoginLock">
                    <Segment id="enabled" type="boolean" />
                </Object>
            </Object>
        </Message>

        <Message id="GetWebCertSettings"/>
        <Message id="WebCertSettings">
            <Object id="Resource">
                <Object id="WebCertificate">
                    <DataPointReference id="CertificateType" path="HikvisionCameraSecurity#certificateType" />
                    <Object id="SecurityAlgorithm">
                        <DataPointReference id="algorithmType" path="HikvisionCameraSecurity#algorithmType" />
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeWebCertSettings">
            <Object id="Resource">
                <Object id="WebCertificate">
                    <Segment id="CertificateType" type="string" />
                    <Object id="SecurityAlgorithm">
                        <Segment id="algorithmType" type="string" />
                    </Object>
                </Object>
            </Object>
        </Message>

        <!-- VIDEO OVERLAY SETTINGS -->

        <Message id="GetVideoOverlaySettings">
            <Segment id="ChannelId" type="integer" />
        </Message>
        <Message id="VideoOverlaySettings">
            <Object id="Resource">
                <Object id="VideoOverlay">
                    <DataPointReference id="normalizedScreenWidth" path="HikvisionCameraVideoOverlay#normScreenWidth"/>
                    <DataPointReference id="normalizedScreenHeight" path="HikvisionCameraVideoOverlay#normScreenHeight"/>
                    <Object id="attribute">
                        <DataPointReference id="transparent" path="HikvisionCameraVideoOverlay#osdTransparent"/>
                        <DataPointReference id="flashing" path="HikvisionCameraVideoOverlay#osdFlashing"/>
                    </Object>
                    <DataPointReference id="fontSize" path="HikvisionCameraVideoOverlay#fontSize"/>
                    <DataPointReference id="frontColorMode" path="HikvisionCameraVideoOverlay#frontColorMode"/>
                    <DataPointReference id="frontColor" path="HikvisionCameraVideoOverlay#frontColor"/>
                    <DataPointReference id="alignment" path="HikvisionCameraVideoOverlay#alignment"/>
                    <DataPointReference id="textDisplay" path="HikvisionCameraVideoOverlay#textDisplay"/>
                    <DataPointReference id="displayName" path="HikvisionCameraVideoOverlay#displayName"/>
                    <DataPointReference id="cameraName" path="HikvisionCameraVideoOverlay#cameraName"/>
                    <Object id="DateTimeOverlay">
                        <DataPointReference id="enabled" path="HikvisionCameraVideoOverlay#dtEnabled"/>
                        <DataPointReference id="positionX" path="HikvisionCameraVideoOverlay#dtPosX"/>
                        <DataPointReference id="positionY" path="HikvisionCameraVideoOverlay#dtPosY"/>
                        <DataPointReference id="dateStyle" path="HikvisionCameraVideoOverlay#dtDateStyle"/>
                        <DataPointReference id="timeStyle" path="HikvisionCameraVideoOverlay#dtTimeStyle"/>
                        <DataPointReference id="displayWeek" path="HikvisionCameraVideoOverlay#dtDisplayWeek"/>
                    </Object>
                    <Object id="channelNameOverlay">
                        <DataPointReference id="enabled" path="HikvisionCameraVideoOverlay#channelNameEnabled"/>
                        <DataPointReference id="positionX" path="HikvisionCameraVideoOverlay#channelNamePosX"/>
                        <DataPointReference id="positionY" path="HikvisionCameraVideoOverlay#channelNamePosY"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeVideoOverlaySettings">
            <Segment id="ChannelId" type="integer" />
            <Object id="Resource">
                <Object id="VideoOverlay">
                    <Object id="normalizedScreenSize">
                        <Segment id="normalizedScreenWidth" type="integer"/>
                        <Segment id="normalizedScreenHeight" type="integer"/>
                    </Object>
                    <Object id="attribute">
                        <Segment id="transparent" type="boolean"/>
                        <Segment id="flashing" type="boolean"/>
                    </Object>
                    <Segment id="fontSize" type="string"/>
                    <Segment id="frontColorMode" type="string"/>
                    <Segment id="frontColor" type="string"/>
                    <Segment id="alignment" type="string"/>
                    <Object id="DateTimeOverlay">
                        <Segment id="enabled" type="boolean"/>
                        <Segment id="positionX" type="integer"/>
                        <Segment id="positionY" type="integer"/>
                        <Segment id="dateStyle" type="string"/>
                        <Segment id="timeStyle" type="string"/>
                        <Segment id="displayWeek" type="boolean"/>
                    </Object>
                    <Object id="channelNameOverlay">
                        <Segment id="enabled" type="boolean"/>
                        <Segment id="positionX" type="integer"/>
                        <Segment id="positionY" type="integer"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="GetVideoChannelSettings">
            <Segment id="ChannelId" type="integer" />
        </Message>

        <Message id="VideoChannelSettings">
            <Object id="Resource">
                <Object id="VideoInputChannel">
                    <DataPointReference id="name" path="HikvisionCameraVideoOverlay#cameraName"/>
                </Object>
            </Object>
        </Message>

        <Message id="ChangeVideoChannelSettings">
            <Segment id="ChannelId" type="integer" />
            <Object id="Resource">
                <Object id="VideoInputChannel">
                    <Segment id="id" type="integer"/>
                    <Segment id="name" type="string"/>
                </Object>
            </Object>
        </Message>
        

        <!-- Basic Events -->
        <Message id="GetDiskFullBasicEvent" />
        <Message id="GetDiskErrorBasicEvent" />
        <Message id="GetIllegalAccessBasicEvent" />

        <Message id="DiskFullBasicEvent">
            <Object id="Resource">
                <Object id="EventTrigger">
                        <DataPointReference id="EventTriggerNotificationList" path="HikvisionCameraBasicEvents#diskFullBasicEvent" />
                </Object>
            </Object>
        </Message>

        <Message id="DiskErrorBasicEvent">
            <Object id="Resource">
                <Object id="EventTrigger">
                        <DataPointReference id="EventTriggerNotificationList" path="HikvisionCameraBasicEvents#diskErrorBasicEvent" />
                </Object>
            </Object>
        </Message>

        <Message id="IllegalAccessBasicEvent">
            <Object id="Resource">
                <Object id="EventTrigger">
                    <DataPointReference id="EventTriggerNotificationList" path="HikvisionCameraBasicEvents#illegalAccessBasicEvent" />
                </Object>
            </Object>
        </Message>

        <Message id="SetSingleNotificationBasicEvent">
            <Segment id="TriggerEvent" type="string"/>
            <Object id="Resource">
                <Object id="EventTriggerNotificationList">
                    <Object id="EventTriggerNotification">
                        <Segment id="id" type="string"/>
                        <Segment id="notificationMethod" type="string"/>
                    </Object>
                </Object>
            </Object>
        </Message>

        <Message id="SetCenterAndEmailNotificationsBasicEvent">
            <Segment id="TriggerEvent" type="string"/>
        </Message>

        <Message id="SetNoNotificationBasicEvent">
            <Segment id="TriggerEvent" type="string"/>
        </Message>
        

        <!-- HTTPS CERTIFICATE INFORMATION -->
        <Message id="GetHTTPSCertificateInformation" />

        <Message id="HTTPSCertificateInformation">
            <Object id="Resource">
                <Object id="CertificateInfo">
                    <DataPointReference id="id" path="HikvisionCameraCertificate#certificateId" />
                    <DataPointReference id="version" path="HikvisionCameraCertificate#certificateVersion" />
                    <Object id="IssuerDN">
                        <DataPointReference id="countryName" path="HikvisionCameraCertificate#issuerCountryName" />
                        <DataPointReference id="commonName" path="HikvisionCameraCertificate#issuerCommonName" />
                    </Object>
                    <Object id="SubjectDN">
                        <DataPointReference id="countryName" path="HikvisionCameraCertificate#subjectCountryName" />
                        <DataPointReference id="commonName" path="HikvisionCameraCertificate#subjectCommonName" />
                    </Object>
                    <DataPointReference id="signatureAlgorithm" path="HikvisionCameraCertificate#signatureAlgorithm" />
                    <DataPointReference id="keyAlgorithm" path="HikvisionCameraCertificate#keyAlgorithm" />
                    <DataPointReference id="startDate" path="HikvisionCameraCertificate#startDate" />
                    <DataPointReference id="endDate" path="HikvisionCameraCertificate#endDate" />
                    <DataPointReference id="serialNumber" path="HikvisionCameraCertificate#serialNumber" />
                </Object>
            </Object>
        </Message>

        <!-- Logs -->
        <Message id="GetDiagnosticData"/>
        <Message id="DiagnosticData">
            <Object id="Resource">
                <Segment id="content" type="datafile" reference="content" />
                <Segment id="content_name" type="datafile" reference="contentName" />
                <Segment id="content_length" type="datafile" reference="contentLength" />
                <Segment id="content_type" type="datafile" reference="contentType" />
                <Segment id="content_index" type="datafile" reference="contentIndex" />
            </Object>
        </Message>

        <Message id="GetConfigurationFile">
            <Object id="Resource">
                <Segment id="secretKey" type="string"/>
            </Object>
        </Message>
        <Message id="ApplyConfigurationFile">
            <Object id="Resource">
                <Segment id="secretKey" type="string"/>
                <Segment id="File" type="filestore" />
            </Object>
        </Message>

        <Message id="ConfigurationFile">
            <Object id="Resource">
                <Segment id="content" type="datafile" reference="content" />
                <Segment id="content_name" type="datafile" reference="contentName" />
                <Segment id="content_length" type="datafile" reference="contentLength" />
                <Segment id="content_type" type="datafile" reference="contentType" />
                <Segment id="content_index" type="datafile" reference="contentIndex" />
                <Segment id="content_purpose" type="datafile" reference="contentPurpose" />
            </Object>
        </Message>
        
    </Messages>

    <Transactions>
        <Transaction id="Register">
            <Blocks>
                <Block id="1">
                    <SendMessage id="RegisterAPI">
                        <UserAssignment actionArgName="Host Address" path="Settings/ApiIpAddress" hint="Enter the Address of the camera you want to register." />
                        <UserAssignment actionArgName="Username"     path="Settings/ApiKey" />
                        <UserAssignment actionArgName="Password"     path="Settings/ApiSecret" secret="true" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="RegisterAPISettings" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="BulkImportDevices">
            <Blocks>
                <Block id="1">
                    <SendMessage id="BulkImportDevices">
                        <UserAssignment actionArgName="CSV File" path="Resource/InputFile" hint="CSV file with device IP addresses and their logins/passwords. E.g. &quot;127.0.0.1,admin,password&quot;" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="SearchNewDevices">
            <Blocks>
                <Block id="1">
                    <SendMessage id="SearchNewDevices">
                        <UserAssignment actionArgName="Username" path="Settings/ApiKey" />
                        <UserAssignment actionArgName="Password" path="Settings/ApiSecret" secret="true" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="UpdateFirmwareFromFilestore" semanticid="Firmware-Download#download-file-filestore" isMetaTransaction="true">
          <Blocks>
            <Block id="1">
              <SendMessage id="HikUploadFirmware">
                <UserAssignment actionArgName="File" path="Resource/File"/>
              </SendMessage>
              <Switch>
                <SwitchOnMessage timeout="300000">
                  <MessageCase>
                    <ReceiveMessage id="Success"/>
                    <BlockAction>
                      <Terminate success="true"/>
                    </BlockAction>
                  </MessageCase>
                  <MessageCase>
                    <ReceiveMessage id="Error">
                      <VariableDefinition id="Resource" path="Resource"/>
                    </ReceiveMessage>
                    <BlockAction>
                      <Terminate success="false">
                        <Log variableId="Resource"/>
                      </Terminate>
                    </BlockAction>
                  </MessageCase>
                </SwitchOnMessage>
              </Switch>
            </Block>
          </Blocks>
          <AlertBlocks>
            <AlertBlock MessageId="HikAlert" timeoutAlertId="FirmwareDownloadTimeout" timeout="5400">
              <SuccessCase>
                <Enumeration>
                  <Value>FirmwareInstallationSuccess</Value>
                </Enumeration>
              </SuccessCase>
              <FailureCase>
                <Enumeration>
                  <Value>FirmwareInstallationFail</Value>
                </Enumeration>
              </FailureCase>
            </AlertBlock>
          </AlertBlocks>
        </Transaction>

        <Transaction id="Reboot" semanticid="HikReboot#reboot">
            <Blocks>
                <Block id="1">
                    <SendMessage id="Reboot"/>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="CheckIn" semanticid="base-module#checkin">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetDeviceState" />
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="DeviceState" />
                                <BlockAction>
                                    <GoToBlock blockId="2" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="2">
                    <SendMessage id="GetTimeSettings" />
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="TimeSettings" />
                                <BlockAction>
                                    <GoToBlock blockId="3" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource2" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource2" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="3">
                    <SendMessage id="GetNTPSettings" />
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="NTPSettings" />
                                <BlockAction>
                                    <GoToBlock blockId="4" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource3" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource3" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="4">
                    <SendMessage id="GetNetworkSettings" />
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="NetworkSettings" />
                                <BlockAction>
                                    <GoToBlock blockId="5" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource4" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource4" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="5">
                    <SendMessage id="GetDDNSSettings" />
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="DDNSSettings" />
                                <BlockAction>
                                    <GoToBlock blockId="6" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource5" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource5" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="6">
                    <SendMessage id="GetPorts" />
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Ports" />
                                <BlockAction>
                                    <Terminate success="true"></Terminate>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource6" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource6" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeDeviceSettings" semanticid="HikvisionCameraInfo#ChangeDeviceName">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeDeviceSettings">
                        <UserAssignment actionArgName="Device Name" path="Resource/DeviceInfo/deviceName" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeTimeSettings" semanticid="HikvisionCameraTime#ChangeTimeSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeTimeSettings">
                        <UserAssignment actionArgName="Time Mode"  path="Resource/Time/timeMode"   />
                        <UserAssignment actionArgName="Time Zone"  path="Resource/Time/timeZone"   />
                        <UserAssignment actionArgName="Device Time"  path="Resource/Time/localTime"   />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeNTPSettings" semanticid="HikvisionCameraTime#ChangeNTPSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeNTPSettings">
                        <ConstantAssignment path="Resource/NTPServer/id" value="1"/>
                        <UserAssignment actionArgName="Address Format" path="Resource/NTPServer/addressingFormatType" />
                        <UserAssignment actionArgName="Host Name / IP Address"            path="Resource/NTPServer/hostName" />
                        <UserAssignment actionArgName="Host Name / IP Address"            path="Resource/NTPServer/ipAddress" />
                        <UserAssignment actionArgName="Port"              path="Resource/NTPServer/portNo"   />
                        <UserAssignment actionArgName="Sync Interval" path="Resource/NTPServer/synchronizeInterval" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="GetSerialPort" semanticid="HikvisionCameraSerialPorts#GetSerialPortSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetSerialPort" />
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="SerialPort" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeSerialPort" semanticid="HikvisionCameraSerialPorts#ChangeSerialPortSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeSerialPort">
                        <UserAssignment actionArgName="Baud Rate"        path="Resource/SerialPort/baudRate" />
                        <UserAssignment actionArgName="Data Bit"        path="Resource/SerialPort/dataBits" />
                        <UserAssignment actionArgName="Parity Type"      path="Resource/SerialPort/parityType" />
                        <UserAssignment actionArgName="Stop Bit"        path="Resource/SerialPort/stopBits" />
                        <UserAssignment actionArgName="Flow Control"     path="Resource/SerialPort/flowCtrl" />
                        <UserAssignment actionArgName="Work Mode"        path="Resource/SerialPort/workMode" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeNetworkSettings" semanticid="HikvisionCameraNetwork#ChangeNetworkSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeNetworkSettings">
                        <ConstantAssignment path="Resource/NetworkInterface/IPAddress/ipVersion" value="dual"/>
                        <!-- Discovery -->
                        <UserAssignment actionArgName="ZeroConf Enabled"   path="Resource/NetworkInterface/Discovery/Zeroconf/enabled"/>

                        <!-- Link (Ethernet) Settings -->
                        <UserAssignment actionArgName="Auto Negotiation"   path="Resource/NetworkInterface/Link/autoNegotiation"/>
                        <UserAssignment actionArgName="Link Speed"         path="Resource/NetworkInterface/Link/speed"/>
                        <UserAssignment actionArgName="Link Duplex"        path="Resource/NetworkInterface/Link/duplex"/>
                        <UserAssignment actionArgName="MTU"                path="Resource/NetworkInterface/Link/MTU"/>

                        <!-- IPv4 Settings -->
                        <UserAssignment actionArgName="Addressing Type (IPv4)" path="Resource/NetworkInterface/IPAddress/addressingType" />
                        <UserAssignment actionArgName="Address (IPv4)"         path="Resource/NetworkInterface/IPAddress/ipAddress" />
                        <UserAssignment actionArgName="Subnet Mask"             path="Resource/NetworkInterface/IPAddress/subnetMask" />
                        <UserAssignment actionArgName="Default Gateway (IPv4)"  path="Resource/NetworkInterface/IPAddress/DefaultGateway/ipAddress" />
                        <UserAssignment actionArgName="Primary DNS (IPv4)"      path="Resource/NetworkInterface/IPAddress/PrimaryDNS/ipAddress" />
                        <UserAssignment actionArgName="Secondary DNS (IPv4)"    path="Resource/NetworkInterface/IPAddress/SecondaryDNS/ipAddress" />

                        <!-- IPv6 Settings -->
                        <UserAssignment actionArgName="Addressing Type (IPv6)"      path="Resource/NetworkInterface/IPAddress/ipV6AddressingType" />
                        <UserAssignment actionArgName="Address (IPv6)"              path="Resource/NetworkInterface/IPAddress/ipv6Address" />
                        <UserAssignment actionArgName="Bitmask (IPv6)"              path="Resource/NetworkInterface/IPAddress/bitMask" />
                        <UserAssignment actionArgName="Default Gateway (IPv6)"      path="Resource/NetworkInterface/IPAddress/DefaultGateway/ipv6Address" />
                        <UserAssignment actionArgName="Primary DNS (IPv6)"          path="Resource/NetworkInterface/IPAddress/PrimaryDNS/ipv6Address" />
                        <UserAssignment actionArgName="Secondary DNS (IPv6)"        path="Resource/NetworkInterface/IPAddress/SecondaryDNS/ipv6Address" />
                    </SendMessage>

                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeUPnPSettings" semanticid="HikvisionCameraNetwork#ChangeUPnPSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeUPnPSettings">
                        <UserAssignment actionArgName="UPnP Enabled"       path="Resource/UPnP/enabled"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeDDNSSettings" semanticid="DDNS#ChangeDDNSSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeDDNSSettings">
                        <ConstantAssignment path="Resource/DDNS/id" value="1"/>

                        <UserAssignment actionArgName="Enabled"                   path="Resource/DDNS/enabled" />
                        <UserAssignment actionArgName="Provider"                  path="Resource/DDNS/provider" />
                        <UserAssignment actionArgName="Server Address Format"     path="Resource/DDNS/serverAddress/addressingFormatType" />
                        <UserAssignment actionArgName="Host Name / IP Address"    path="Resource/DDNS/serverAddress/hostName" />
                        <UserAssignment actionArgName="Host Name / IP Address"    path="Resource/DDNS/serverAddress/ipAddress" />
                        <UserAssignment actionArgName="Port Number"               path="Resource/DDNS/portNo" />
                        <UserAssignment actionArgName="Device Domain Name"        path="Resource/DDNS/deviceDomainName" />
                        <UserAssignment actionArgName="User Name"                 path="Resource/DDNS/userName" />
                        <UserAssignment actionArgName="Password"                  path="Resource/DDNS/password" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>
        
        <Transaction id="ChangeHTTPPort" semanticid="Ports#ChangeHTTPPort">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeHTTPPort">
                        <ConstantAssignment path="Resource/AdminAccessProtocol/id" value="1"/>
                        <ConstantAssignment path="Resource/AdminAccessProtocol/protocol" value="HTTP"/>
                        <UserAssignment actionArgName="Enabled" path="Resource/AdminAccessProtocol/enabled"/>
                        <UserAssignment actionArgName="Port" path="Resource/AdminAccessProtocol/portNo"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeHTTPSPort" semanticid="Ports#ChangeHTTPSPort">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeHTTPSPort">
                        <ConstantAssignment path="Resource/AdminAccessProtocol/id" value="2"/>
                        <ConstantAssignment path="Resource/AdminAccessProtocol/protocol" value="HTTPS"/>
                        <UserAssignment actionArgName="Enabled" path="Resource/AdminAccessProtocol/enabled"/>
                        <UserAssignment actionArgName="Port" path="Resource/AdminAccessProtocol/portNo"/>
                        <UserAssignment actionArgName="Enable TLS1.1" path="Resource/AdminAccessProtocol/TLS1_1Enable"/>
                        <UserAssignment actionArgName="Enable TLS1.2" path="Resource/AdminAccessProtocol/TLS1_2Enable"/>
                        <UserAssignment actionArgName="Enable TLS1.3" path="Resource/AdminAccessProtocol/TLS1_3Enable"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeServerPort" semanticid="Ports#ChangeServerPort">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeServerPort">
                        <ConstantAssignment path="Resource/AdminAccessProtocol/id" value="3"/>
                        <ConstantAssignment path="Resource/AdminAccessProtocol/protocol" value="DEV_MANAGE"/>
                        <UserAssignment actionArgName="Port" path="Resource/AdminAccessProtocol/portNo"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="HikAlert" semanticid="HikAlert#alert">
            <Blocks>
                <Block id="1">
                    <ReceiveMessage id="HikAlert" />
                    <BlockAction>
                        <Terminate success="true" />
                    </BlockAction>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeRTSPPort" semanticid="Ports#ChangeRTSPPort">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeRTSPPort">
                        <ConstantAssignment path="Resource/AdminAccessProtocol/id" value="4"/>
                        <ConstantAssignment path="Resource/AdminAccessProtocol/protocol" value="RTSP"/>
                        <UserAssignment actionArgName="Enabled" path="Resource/AdminAccessProtocol/enabled"/>
                        <UserAssignment actionArgName="Port" path="Resource/AdminAccessProtocol/portNo"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="GetSNMPSettings" semanticid="SNMP#GetSNMPSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetSNMPSettings" />
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="SNMPSettings" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeSNMPv1v2Settings" semanticid="SNMP#ChangeSNMPv1v2Settings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeSNMPSettings">
                        <UserAssignment actionArgName="Enable SNMPv1"       path="Resource/snmpV1Enabled"/>
                        <UserAssignment actionArgName="Enable SNMP v2c"     path="Resource/snmpV2cEnabled"/>
                        <UserAssignment actionArgName="Read SNMP Community" path="Resource/snmpReadCommunity"/>
                        <UserAssignment actionArgName="Write SNMP Community" path="Resource/snmpWriteCommunity"/>

                        <ConstantAssignment path="Resource/Trap/SNMPTrapReceiver/id" value="1"/>
                        <ConstantAssignment path="Resource/Trap/SNMPTrapReceiver/ReceiverAddress/addressingFormatType" value="ipaddress"/>
                        <UserAssignment actionArgName="Trap IP Address"        path="Resource/Trap/SNMPTrapReceiver/ReceiverAddress/ipAddress"/>
                        <UserAssignment actionArgName="Trap Port"           path="Resource/Trap/SNMPTrapReceiver/ReceiverAddress/portNo"/>
                        <ConstantAssignment path="Resource/Trap/SNMPTrapReceiver/notificationType" value="trap"/>
                        <UserAssignment actionArgName="Trap Community String"      path="Resource/Trap/SNMPTrapReceiver/communityString"/>

                        <UserAssignment actionArgName="Enable SNMPv3"            path="Resource/snmpV3Enabled"/>
                        
                        <ConstantAssignment path="Resource/ReadUser/SNMPUser/id" value="1"/>
                        <UserAssignment actionArgName="Read UserName"                 path="Resource/ReadUser/SNMPUser/userName"/>
                        <UserAssignment actionArgName="Read Security Level"           path="Resource/ReadUser/SNMPUser/securityLevel"/>
                        <UserAssignment actionArgName="Read Authentication Algorithm" path="Resource/ReadUser/SNMPUser/snmpAuthenticationMethod"/>
                        <UserAssignment actionArgName="Read Authentication Password"  path="Resource/ReadUser/SNMPUser/snmpAuthenticationPassword"/>
                        <UserAssignment actionArgName="Read Private-key Algorithm"    path="Resource/ReadUser/SNMPUser/snmpPrivacyMethod"/>
                        <UserAssignment actionArgName="Read Private-key Password"     path="Resource/ReadUser/SNMPUser/snmpPrivacyPassword"/>

                        <ConstantAssignment path="Resource/WriteUser/SNMPUser/id" value="2"/>
                        <UserAssignment actionArgName="Write UserName"                 path="Resource/WriteUser/SNMPUser/userName"/>
                        <UserAssignment actionArgName="Write Security Level"           path="Resource/ReadUser/SNMPUser/securityLevel"/>
                        <UserAssignment actionArgName="Write Authentication Algorithm" path="Resource/WriteUser/SNMPUser/snmpAuthenticationMethod"/>
                        <UserAssignment actionArgName="Write Authentication Password"  path="Resource/WriteUser/SNMPUser/snmpAuthenticationPassword"/>
                        <UserAssignment actionArgName="Write Private-key Algorithm"    path="Resource/WriteUser/SNMPUser/snmpPrivacyMethod"/>
                        <UserAssignment actionArgName="Write Private-key Password"     path="Resource/WriteUser/SNMPUser/snmpPrivacyPassword"/>

                        <UserAssignment actionArgName="SNMP Port"           path="Resource/snmpPort"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="GetFTPNotificationSettings" semanticid="FTPNotification#GetFTPNotificationSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetFTPNotificationSettings" />
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="FTPNotificationSettings" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeFTPNotificationSettings" semanticid="FTPNotification#ChangeFTPNotificationSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeFTPNotificationSettings">
                        <ConstantAssignment   path="Resource/FTPNotification/id"                   value="1"/>
                        <UserAssignment       actionArgName="Anonymous"     path="Resource/FTPNotification/annoyftp"/>
                        <UserAssignment       actionArgName="Addressing Format"     path="Resource/FTPNotification/addressingFormatType"/>
                        <UserAssignment       actionArgName="Host Name / IP Address" path="Resource/FTPNotification/ipAddress"/>
                        <UserAssignment       actionArgName="Host Name / IP Address" path="Resource/FTPNotification/hostName"/>
                        <UserAssignment       actionArgName="Port Number"           path="Resource/FTPNotification/portNo"/>
                        <UserAssignment       actionArgName="User Name"             path="Resource/FTPNotification/userName"/>
                        <UserAssignment       actionArgName="Password"              path="Resource/FTPNotification/password"/>
                        <UserAssignment       actionArgName="Upload Picture"        path="Resource/FTPNotification/uploadPicture"/>
                        <UserAssignment       actionArgName="Upload Path Depth"     path="Resource/FTPNotification/uploadPath/pathDepth"/>
                        <UserAssignment       actionArgName="Top Dir Name Rule"     path="Resource/FTPNotification/uploadPath/topDirNameRule"/>
                        <UserAssignment       actionArgName="Sub Dir Name Rule"     path="Resource/FTPNotification/uploadPath/subDirNameRule"/>
                        <UserAssignment       actionArgName="Archiving Interval (days)"    path="Resource/FTPNotification/picArchivingInterval"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="GetMailingListSettings" semanticid="MailingList#GetMailingListSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetMailingListSettings" />
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="MailingListSettings" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeMailingListSettings" semanticid="MailingList#ChangeMailingListSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeMailingListSettings">
                        <ConstantAssignment path="Resource/mailing/id" value="1"/>
                        <ConstantAssignment  path="Resource/mailing/receiverList/receiver" value="1"/>
                        <UserAssignment  actionArgName="Enable Authorization" path="Resource/mailing/sender/smtp/enableAuthorization" />
                        <UserAssignment  actionArgName="Enable TLS" path="Resource/mailing/sender/smtp/enableTLS" />
                        <UserAssignment   actionArgName="Sender Name"        path="Resource/mailing/sender/name"/>
                        <UserAssignment   actionArgName="Sender Email Address" path="Resource/mailing/sender/emailAddress"/>
                        <UserAssignment   actionArgName="SMTP Address Format"    path="Resource/mailing/sender/smtp/addressingFormatType"/>
                        <UserAssignment   actionArgName="SMTP Host Name / IP Address"         path="Resource/mailing/sender/smtp/hostName"/>
                        <UserAssignment   actionArgName="SMTP Host Name / IP Address"         path="Resource/mailing/sender/smtp/ipAddress"/>
                        <UserAssignment   actionArgName="SMTP Port Number"       path="Resource/mailing/sender/smtp/portNo"/>
                        <UserAssignment   actionArgName="Sender Name"      path="Resource/mailing/sender/smtp/accountName"/>
                        <UserAssignment   actionArgName="SMTP Username"          path="Resource/mailing/sender/smtp/accountName"/>
                        <UserAssignment   actionArgName="SMTP Password"          path="Resource/mailing/sender/smtp/password"/>
                        <UserAssignment   actionArgName="Snapshot Enabled"      path="Resource/mailing/attachment/snapshot/enabled"/>
                        <UserAssignment   actionArgName="Snapshot Interval (sec)" path="Resource/mailing/attachment/snapshot/interval"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false"><Log variableId="Resource"/></Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="GetEhomeSettings" semanticid="Ehome#GetEhomeSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetEhomeSettings"/>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="EhomeSettings"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false"><Log variableId="Resource"/></Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeEhomeSettings" semanticid="Ehome#ChangeEhomeSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeEhomeSettings">
                        <UserAssignment actionArgName="Enabled"              path="Resource/Ehome/enabled"/>
                        <UserAssignment actionArgName="Addressing Format"    path="Resource/Ehome/addressingFormatType"/>
                        <UserAssignment actionArgName="Host Name / IP Address" path="Resource/Ehome/ipAddress"/>
                        <UserAssignment actionArgName="Host Name / IP Address" path="Resource/Ehome/hostName"/>
                        <UserAssignment actionArgName="Port Number"          path="Resource/Ehome/portNo"/>
                        <UserAssignment actionArgName="Device ID"            path="Resource/Ehome/deviceID"/>
                        <UserAssignment actionArgName="Protocol Version"     path="Resource/Ehome/protocolVersion"/>
                        <UserAssignment actionArgName="Key"                  path="Resource/Ehome/key"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false"><Log variableId="Resource"/></Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>
        
        <Transaction id="GetQoSSettings" semanticid="QoS#GetQoSSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetQoSSettings"/>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="QoSSettings"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false"><Log variableId="Resource"/></Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeDevMgmtDSCP" semanticid="QoS#ChangeDevMgmtDSCP">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeQoSSettings">
                        <ConstantAssignment path="Resource/DSCPList/DSCP/id"          value="1"/>
                        <ConstantAssignment path="Resource/DSCPList/DSCP/trafficType" value="devicemanagement"/>
                        <ConstantAssignment path="Resource/DSCPList/DSCP/enabled" value="true"/>
                        <UserAssignment actionArgName="Priority (0-63)"      path="Resource/DSCPList/DSCP/priorityValue"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false"><Log variableId="Resource"/></Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeCmdCtrlDSCP" semanticid="QoS#ChangeCmdCtrlDSCP">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeQoSSettings">
                        <ConstantAssignment path="Resource/DSCPList/DSCP/id"          value="2"/>
                        <ConstantAssignment path="Resource/DSCPList/DSCP/trafficType" value="commandcontrol"/>
                        <ConstantAssignment path="Resource/DSCPList/DSCP/enabled" value="true"/>
                        <UserAssignment actionArgName="Priority (0-63)"      path="Resource/DSCPList/DSCP/priorityValue"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false"><Log variableId="Resource"/></Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeVideoDSCP" semanticid="QoS#ChangeVideoDSCP">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeQoSSettings">
                        <ConstantAssignment path="Resource/DSCPList/DSCP/id"          value="3"/>
                        <ConstantAssignment path="Resource/DSCPList/DSCP/trafficType" value="video"/>
                        <ConstantAssignment path="Resource/DSCPList/DSCP/enabled" value="true"/>
                        <UserAssignment actionArgName="Priority (0-63)"      path="Resource/DSCPList/DSCP/priorityValue"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false"><Log variableId="Resource"/></Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="GetIEEE8021xSettings" semanticid="IEEE8021x#GetIEEE8021xSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetIEEE8021xSettings"/>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="IEEE8021xSettings"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false"><Log variableId="Resource"/></Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeIEEE8021xSettings" semanticid="IEEE8021x#ChangeIEEE8021xSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeIEEE8021xSettings">
                        <UserAssignment actionArgName="Enabled"              path="Resource/IEEE802_1x/enabled"/>
                        <UserAssignment actionArgName="Auth Protocol"        path="Resource/IEEE802_1x/authenticationProtocolType"/>
                        <UserAssignment actionArgName="Username"             path="Resource/IEEE802_1x/userName"/>
                        <UserAssignment actionArgName="Password"             path="Resource/IEEE802_1x/password"/>
                        <UserAssignment actionArgName="EAPOL Version"        path="Resource/IEEE802_1x/EAPOLVersion"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false"><Log variableId="Resource"/></Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="GetIntegrateSettings" semanticid="Integrate#GetIntegrateSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetIntegrateSettings"/>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="IntegrateSettings"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false"><Log variableId="Resource"/></Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeIntegrateSettings" semanticid="Integrate#ChangeIntegrateSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeIntegrateSettings">
                        <UserAssignment actionArgName="ONVIF Enabled" path="Resource/Integrate/ONVIF/enable"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false"><Log variableId="Resource"/></Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="FactoryReset" semanticid="Common-Actions#FactoryReset">
            <Blocks>
                <Block id="1">
                    <SendMessage id="FactoryReset">
                        <UserAssignment actionArgName="Mode" path="Resource/mode" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false"><Log variableId="Resource"/></Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="GetStreamingMainSettings" semanticid="StreamingMain-Actions#GetStreamingMainSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetStreamingMainSettings"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="StreamingMainSettings"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeStreamingMainSettings"
                     semanticid="StreamingMain-Actions#ChangeStreamingMainSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeStreamingMainSettings">
                        <UserAssignment actionArgName="Audio Enabled"
                                        path="Resource/StreamingChannel/Audio/enabled"/>
                        <UserAssignment actionArgName="Video Enabled"
                                        path="Resource/StreamingChannel/Video/enabled"/>

                        <UserAssignment actionArgName="Resolution Width"
                                        path="Resource/StreamingChannel/Video/videoResolutionWidth"/>
                        <UserAssignment actionArgName="Resolution Height"
                                        path="Resource/StreamingChannel/Video/videoResolutionHeight"/>

                        <UserAssignment actionArgName="Bitrate Type"
                                        path="Resource/StreamingChannel/Video/videoQualityControlType"/>
                        <UserAssignment actionArgName="Max Bitrate"
                                        path="Resource/StreamingChannel/Video/constantBitRate"/>
                        <UserAssignment actionArgName="Max Bitrate"
                                        path="Resource/StreamingChannel/Video/vbrUpperCap"/>
                        <UserAssignment actionArgName="Video Quality"
                                        path="Resource/StreamingChannel/Video/fixedQuality"/>

                        <UserAssignment actionArgName="Frame Rate (fps)"
                                        path="Resource/StreamingChannel/Video/maxFrameRate"/>
                        <UserAssignment actionArgName="I-Frame Interval"
                                        path="Resource/StreamingChannel/Video/GovLength"/>

                        <UserAssignment actionArgName="Video Encoding"
                                        path="Resource/StreamingChannel/Video/videoCodecType"/>
                        <UserAssignment actionArgName="Profile"
                                        path="Resource/StreamingChannel/Video/H264Profile"/>

                        <UserAssignment actionArgName="H.264/265+ Enabled"
                                        path="Resource/StreamingChannel/Video/SmartCodec/enabled"/>
                        <UserAssignment actionArgName="Max. Average Bitrate"
                                        path="Resource/StreamingChannel/Video/vbrAverageCap"/>
                        <UserAssignment actionArgName="SVC Enabled"
                                        path="Resource/StreamingChannel/Video/SVC/enabled"/>
                        <UserAssignment actionArgName="SVC Mode"
                                        path="Resource/StreamingChannel/Video/SVC/SVCMode"/>

                        <UserAssignment actionArgName="Smoothing (0-100)"
                                        path="Resource/StreamingChannel/Video/smoothing"/>

                        <UserAssignment actionArgName="RTSP Authentication"
                                        path="Resource/StreamingChannel/Transport/Security/certificateType"/>
                        <UserAssignment actionArgName="RTSP Digest Algorithm"
                                        path="Resource/StreamingChannel/Transport/Security/SecurityAlgorithm/algorithmType"/>
                    </SendMessage>

                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="GetStreamingSubSettings" semanticid="StreamingSub-Actions#GetStreamingSubSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetStreamingSubSettings"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="StreamingSubSettings"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeStreamingSubSettings"
                     semanticid="StreamingSub-Actions#ChangeStreamingSubSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeStreamingSubSettings">
                        <UserAssignment actionArgName="Audio Enabled"
                                        path="Resource/StreamingChannel/Audio/enabled"/>
                        <UserAssignment actionArgName="Video Enabled"
                                        path="Resource/StreamingChannel/Video/enabled"/>

                        <UserAssignment actionArgName="Resolution Width"
                                        path="Resource/StreamingChannel/Video/videoResolutionWidth"/>
                        <UserAssignment actionArgName="Resolution Height"
                                        path="Resource/StreamingChannel/Video/videoResolutionHeight"/>

                        <UserAssignment actionArgName="Bitrate Type"
                                        path="Resource/StreamingChannel/Video/videoQualityControlType"/>
                        <UserAssignment actionArgName="Max Bitrate"
                                        path="Resource/StreamingChannel/Video/constantBitRate"/>
                        <UserAssignment actionArgName="Max Bitrate"
                                        path="Resource/StreamingChannel/Video/vbrUpperCap"/>
                        <UserAssignment actionArgName="Video Quality"
                                        path="Resource/StreamingChannel/Video/fixedQuality"/>

                        <UserAssignment actionArgName="Frame Rate (fps)"
                                        path="Resource/StreamingChannel/Video/maxFrameRate"/>
                        <UserAssignment actionArgName="I-Frame Interval"
                                        path="Resource/StreamingChannel/Video/GovLength"/>

                        <UserAssignment actionArgName="Video Encoding"
                                        path="Resource/StreamingChannel/Video/videoCodecType"/>
                        <UserAssignment actionArgName="Profile"
                                        path="Resource/StreamingChannel/Video/H264Profile"/>

                        <UserAssignment actionArgName="Smoothing (0-100)"
                                        path="Resource/StreamingChannel/Video/smoothing"/>
                    </SendMessage>

                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="GetStreamingThirdSettings" semanticid="StreamingThird-Actions#GetStreamingThirdSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetStreamingThirdSettings"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="StreamingThirdSettings"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeStreamingThirdSettings"
                     semanticid="StreamingThird-Actions#ChangeStreamingThirdSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeStreamingThirdSettings">
                        <UserAssignment actionArgName="Audio Enabled"
                                        path="Resource/StreamingChannel/Audio/enabled"/>
                        <UserAssignment actionArgName="Video Enabled"
                                        path="Resource/StreamingChannel/Video/enabled"/>

                        <UserAssignment actionArgName="Resolution Width"
                                        path="Resource/StreamingChannel/Video/videoResolutionWidth"/>
                        <UserAssignment actionArgName="Resolution Height"
                                        path="Resource/StreamingChannel/Video/videoResolutionHeight"/>

                        <UserAssignment actionArgName="Bitrate Type"
                                        path="Resource/StreamingChannel/Video/videoQualityControlType"/>
                        <UserAssignment actionArgName="Max Bitrate"
                                        path="Resource/StreamingChannel/Video/constantBitRate"/>
                        <UserAssignment actionArgName="Max Bitrate"
                                        path="Resource/StreamingChannel/Video/vbrUpperCap"/>
                        <UserAssignment actionArgName="Video Quality"
                                        path="Resource/StreamingChannel/Video/fixedQuality"/>

                        <UserAssignment actionArgName="Frame Rate (fps)"
                                        path="Resource/StreamingChannel/Video/maxFrameRate"/>
                        <UserAssignment actionArgName="I-Frame Interval"
                                        path="Resource/StreamingChannel/Video/GovLength"/>

                        <UserAssignment actionArgName="Video Encoding"
                                        path="Resource/StreamingChannel/Video/videoCodecType"/>
                        <UserAssignment actionArgName="Profile"
                                        path="Resource/StreamingChannel/Video/H264Profile"/>
                        
                        <UserAssignment actionArgName="Smoothing (0-100)"
                                        path="Resource/StreamingChannel/Video/smoothing"/>
                    </SendMessage>

                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="GetTwoWayAudioSettings" semanticid="TwoWayAudioChannel#GetTwoWayAudioSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetTwoWayAudioSettings"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="TwoWayAudioSettings"/>
                                <BlockAction><GoToBlock blockId="2"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="2">
                    <SendMessage id="GetAudioSettings"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="AudioSettings"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource2" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource2"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeTwoWayAudioSettings" semanticid="TwoWayAudioChannel#ChangeTwoWayAudioSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeTwoWayAudioSettings">
                        <ConstantAssignment path="Resource/TwoWayAudioChannel/id" value="1"/>
                        <UserAssignment actionArgName="Two-way Audio Enabled"     path="Resource/TwoWayAudioChannel/enabled"/>
                        <UserAssignment actionArgName="Audio Compression Type"    path="Resource/TwoWayAudioChannel/audioCompressionType"/>
                        <UserAssignment actionArgName="Audio Input Type"          path="Resource/TwoWayAudioChannel/audioInputType"/>
                        <UserAssignment actionArgName="Speaker Volume"            path="Resource/TwoWayAudioChannel/speakerVolume"/>
                        <UserAssignment actionArgName="Noise Reduction"           path="Resource/TwoWayAudioChannel/noisereduce"/>
                        <UserAssignment actionArgName="Audio Sampling Rate" path="Resource/TwoWayAudioChannel/audioSamplingRate"/>
                        <UserAssignment actionArgName="Audio Bitrate"      path="Resource/TwoWayAudioChannel/audioBitRate"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction><Terminate success="true"/></BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>
        
        <Transaction id="GetUserPermissions" semanticid="UserPermissions#GetUserPermissions">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetUserPermissions"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="UserPermissions"/>
                                <BlockAction>
                                    <GoToBlock blockId="2" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="2">
                    <SendMessage id="GetOnlineUsers"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="OnlineUsers"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource2" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource2"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>
        <Transaction id="AddOrModifyUser" semanticid="UserManagement#add-modify-user">
            <Blocks>
                <Block id="1">
                    <SendMessage id="AddOrModifyUser"> 
                        <UserAssignment actionArgName="User Name"   path="Resource/userName"/>
                        <UserAssignment actionArgName="User Level"   path="Resource/userLevel"/>
                        <UserAssignment actionArgName="New Password"   path="Resource/newPassword" secret="true" />
                        <UserAssignment actionArgName="Confirm New Password"   path="Resource/confirmNewPassword" secret="true" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>
        <Transaction id="DeleteUser" semanticid="UserManagement#delete-user">
            <Blocks>
                <Block id="1">
                    <SendMessage id="DeleteUser"> 
                        <UserAssignment actionArgName="User Name" path="Resource/userName"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <!-- IMAGE SETTINGS -->

        <Transaction id="GetImageSettings" semanticid="HikvisionCameraGetImage#GetImageSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetImageSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="ImageSettings"/>
                                <BlockAction>
                                    <GoToBlock blockId="2" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="2">
                    <SendMessage id="GetImageSettingsDay">
                        <ConstantAssignment path="ChannelId" value="1" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="ImageSettingsDay"/>
                                <BlockAction>
                                    <GoToBlock blockId="3" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource2" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource2"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="3">
                    <SendMessage id="GetImageSettingsNight">
                        <ConstantAssignment path="ChannelId" value="1" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="ImageSettingsNight"/>
                                <BlockAction>
                                    <GoToBlock blockId="4" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource3" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource3"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="4">
                    <SendMessage id="GetImageSettingsISP">
                        <ConstantAssignment path="ChannelId" value="1" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="ImageSettings"/>
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource4" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource4"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeImageAdjustmentSettings" semanticid="HikvisionCameraImageAdjustment#ChangeImageAdjustmentSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeImageSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                        <UserAssignment actionArgName="Preset"           path="TimeOfDay"/>
                        <UserAssignment actionArgName="Brightness"       path="Resource/ImageChannel/Color/brightnessLevel"/>
                        <UserAssignment actionArgName="Contrast"         path="Resource/ImageChannel/Color/contrastLevel"/>
                        <UserAssignment actionArgName="Saturation"       path="Resource/ImageChannel/Color/saturationLevel"/>
                        <UserAssignment actionArgName="Sharpness Level"  path="Resource/ImageChannel/Sharpness/SharpnessLevel"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeExposureSettings" semanticid="HikvisionCameraExposure#ChangeExposureSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeImageSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                        <UserAssignment actionArgName="Preset"        path="TimeOfDay"/>
                        <UserAssignment actionArgName="Exposure Time" path="Resource/ImageChannel/Shutter/ShutterLevel"/>
                        <UserAssignment actionArgName="Gain Level"    path="Resource/ImageChannel/Gain/GainLevel"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeIRCutFilter" semanticid="HikvisionCameraIRCutFilter#ChangeIRCutFilter">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeImageSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                        <ConstantAssignment path="TimeOfDay" value="/"/>
                        <UserAssignment actionArgName="Day/Night Switch" path="Resource/ImageChannel/IrcutFilter/IrcutFilterType"/>
                        <UserAssignment actionArgName="Sensitivity"      path="Resource/ImageChannel/IrcutFilter/nightToDayFilterLevel"/>
                        <UserAssignment actionArgName="Filtering Time"   path="Resource/ImageChannel/IrcutFilter/nightToDayFilterTime"/>
                        <UserAssignment actionArgName="Start Time"       path="Resource/ImageChannel/IrcutFilter/Schedule/TimeRange/beginTime"/>
                        <UserAssignment actionArgName="End Time"         path="Resource/ImageChannel/IrcutFilter/Schedule/TimeRange/endTime"/>
                        <UserAssignment actionArgName="Schedule Type"    path="Resource/ImageChannel/IrcutFilter/Schedule/scheduleType"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeBackLightSettings" semanticid="HikvisionCameraBackLight#ChangeBackLightSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeImageSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                        <UserAssignment actionArgName="Preset"      path="TimeOfDay"/>
                        <UserAssignment actionArgName="BLC Mode"    path="Resource/ImageChannel/BLC/BLCMode"/>
                        <UserAssignment actionArgName="BLC Enabled" path="Resource/ImageChannel/BLC/enabled"/>
                        <UserAssignment actionArgName="WDR Mode"    path="Resource/ImageChannel/WDR/mode"/>
                        <UserAssignment actionArgName="WDR Level"   path="Resource/ImageChannel/WDR/WDRLevel"/>
                        <UserAssignment actionArgName="HLC Enabled"    path="Resource/ImageChannel/HLC/enabled"/>
                        <UserAssignment actionArgName="HLC Level"   path="Resource/ImageChannel/HLC/level"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeWhiteBalanceSettings" semanticid="HikvisionCameraWhiteBalance#WhiteBalanceSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeImageSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                        <UserAssignment actionArgName="Preset"              path="TimeOfDay"/>
                        <UserAssignment actionArgName="White Balance Style" path="Resource/ImageChannel/WhiteBalance/WhiteBalanceStyle"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeImageEnhancement" semanticid="HikvisionCameraImageEnhancement#ChangeImageEnhancement">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeImageSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                        <UserAssignment actionArgName="Preset"                  path="TimeOfDay"/>
                        <UserAssignment actionArgName="DNR Mode"                path="Resource/ImageChannel/NoiseReduce/mode"/>
                        <UserAssignment actionArgName="Space DNR Level"         path="Resource/ImageChannel/NoiseReduce/AdvancedMode/FrameNoiseReduceLevel"/>
                        <UserAssignment actionArgName="Time DNR Level"          path="Resource/ImageChannel/NoiseReduce/AdvancedMode/InterFrameNoiseReduceLevel"/>
                        <UserAssignment actionArgName="Noise Reduction Level"   path="Resource/ImageChannel/NoiseReduce/GeneralMode/generalLevel"/>
                        <UserAssignment actionArgName="Dehaze Mode"             path="Resource/ImageChannel/Dehaze/DehazeMode"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeVideoAdjustment" semanticid="HikvisionCameraVideoAdjustment#VideoAdjustment">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeImageSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                        <ConstantAssignment path="TimeOfDay" value="/"/>
                        <UserAssignment actionArgName="Mirror Enabled" path="Resource/ImageChannel/ImageFlip/enabled"/>
                        <UserAssignment actionArgName="Mirror Style"   path="Resource/ImageChannel/ImageFlip/ImageFlipStyle"/>
                        <UserAssignment actionArgName="Rotate"         path="Resource/ImageChannel/corridor/enabled"/>
                        <UserAssignment actionArgName="Video Standard" path="Resource/ImageChannel/powerLineFrequency/powerLineFrequencyMode"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeDayNightISPMode" semanticid="HikvisionCameraDayNightISPMode#DayNightISPMode">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeImageSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                        <ConstantAssignment path="TimeOfDay" value="/"/>
                        <UserAssignment actionArgName="ISP Begin Time"    path="Resource/ImageChannel/ISPMode/Schedule/TimeRange/beginTime"/>
                        <UserAssignment actionArgName="ISP End Time"      path="Resource/ImageChannel/ISPMode/Schedule/TimeRange/endTime"/>
                        <UserAssignment actionArgName="ISP Mode"          path="Resource/ImageChannel/ISPMode/mode"/>
                        <UserAssignment actionArgName="ISP Schedule Type" path="Resource/ImageChannel/ISPMode/Schedule/scheduleType"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <!-- Security -->
       <Transaction id="GetSecuritySettings" semanticid="HikvisionCameraSecurity#GetSecuritySettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetWebCertSettings"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="WebCertSettings"/>
                                <BlockAction>
                                    <GoToBlock blockId="2" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="2">
                    <SendMessage id="GetIllegalLoginLockSettings"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="IllegalLoginLockSettings"/>
                                <BlockAction>
                                    <GoToBlock blockId="3" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource2" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource2"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="3">
                    <SendMessage id="GetSSHSettings"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="SSHSettings"/>
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource3" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource3"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeSSHSettings" semanticid="HikvisionCameraSecurity#SSHServiceSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeSSHSettings">
                        <UserAssignment actionArgName="Enable Login SSH"    path="Resource/SSH/enabled" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeIllegalLoginLockSettings" semanticid="HikvisionCameraSecurity#BruteForceLoginLockSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeIllegalLoginLockSettings">
                        <UserAssignment actionArgName="Enable Login Lock"    path="Resource/IllegalLoginLock/enabled" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeWebCertSettings" semanticid="HikvisionCameraSecurity#WebCertSettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeWebCertSettings">
                        <UserAssignment actionArgName="Web Certificate Type"                path="Resource/WebCertificate/CertificateType" />
                        <UserAssignment actionArgName="Web Certificate Algorithm Type"      path="Resource/WebCertificate/SecurityAlgorithm/algorithmType" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <!-- VCA Resource -->

        <Transaction id="ChangeVCAResourceSettings" semanticid="HikvisionCameraVCA#changeVCAType">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeVCAResourceSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                        <UserAssignment actionArgName="VCA Resource Type" path="Resource/VCAResource/type" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success" />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="GetVCAResourceSettings" semanticid="HikvisionCameraVCA#getVCAType">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetVCAResourceSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="VCAResourceSettings"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <!-- VIDEO OVERLAY -->

        <Transaction id="GetVideoOverlaySettings" semanticid="HikvisionCameraVideoOverlay#getVideoOverlaySettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetVideoOverlaySettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="VideoOverlaySettings"/>
                                <BlockAction>
                                    <GoToBlock blockId="2"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="2">
                    <SendMessage id="GetVideoChannelSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="VideoChannelSettings"/>
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource2" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource2"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeVideoOverlaySettings" semanticid="HikvisionCameraVideoOverlay#changeVideoOverlaySettings">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeVideoOverlaySettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                        <UserAssignment actionArgName="OSD Transparent" path="Resource/VideoOverlay/attribute/transparent"/>
                        <UserAssignment actionArgName="OSD Flashing" path="Resource/VideoOverlay/attribute/flashing"/>
                        <UserAssignment actionArgName="OSD Size" path="Resource/VideoOverlay/fontSize"/>
                        <UserAssignment actionArgName="Font Color Mode" path="Resource/VideoOverlay/frontColorMode"/>
                        <UserAssignment actionArgName="Font Color" path="Resource/VideoOverlay/frontColor"/>
                        <UserAssignment actionArgName="Alignment" path="Resource/VideoOverlay/alignment"/>
                        <UserAssignment actionArgName="Display Date" path="Resource/VideoOverlay/DateTimeOverlay/enabled"/>
                        <UserAssignment actionArgName="Date/Time Position X" path="Resource/VideoOverlay/DateTimeOverlay/positionX"/>
                        <UserAssignment actionArgName="Date/Time Position Y" path="Resource/VideoOverlay/DateTimeOverlay/positionY"/>
                        <UserAssignment actionArgName="Date Format" path="Resource/VideoOverlay/DateTimeOverlay/dateStyle"/>
                        <UserAssignment actionArgName="Time Format" path="Resource/VideoOverlay/DateTimeOverlay/timeStyle"/>
                        <UserAssignment actionArgName="Display Week" path="Resource/VideoOverlay/DateTimeOverlay/displayWeek"/>
                        <UserAssignment actionArgName="Display Channel Name Overlay" path="Resource/VideoOverlay/channelNameOverlay/enabled"/>
                        <UserAssignment actionArgName="Channel Name Position X" path="Resource/VideoOverlay/channelNameOverlay/positionX"/>
                        <UserAssignment actionArgName="Channel Name Position Y" path="Resource/VideoOverlay/channelNameOverlay/positionY"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="ChangeVideoChannelSettings" semanticid="HikvisionCameraVideoOverlay#changeOverlayCameraName">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ChangeVideoChannelSettings">
                        <ConstantAssignment path="ChannelId" value="1" />
                        <ConstantAssignment path="Resource/VideoInputChannel/id" value="1" />
                        <UserAssignment actionArgName="Camera Name" path="Resource/VideoInputChannel/name"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <!-- HTTPS Certificate Information -->

        <Transaction id="GetHTTPSCertificateInformation" semanticid="HikvisionCameraCertificate#GetHTTPSCertificateInformation">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetHTTPSCertificateInformation"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="HTTPSCertificateInformation"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <!-- Basic Events -->
        <Transaction id="GetBasicEvents" semanticid="HikvisionCameraBasicEvents#GetBasicEvents">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetDiskFullBasicEvent"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="DiskFullBasicEvent"/>
                                <BlockAction>
                                    <GoToBlock blockId="2" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="2">
                    <SendMessage id="GetDiskErrorBasicEvent"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="DiskErrorBasicEvent"/>
                                <BlockAction>
                                    <GoToBlock blockId="3" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource2" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource2"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
                <Block id="3">
                    <SendMessage id="GetIllegalAccessBasicEvent"/>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="IllegalAccessBasicEvent"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource3" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource3"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="SetEmailNotificationBasicEvent" semanticid="HikvisionCameraBasicEvents#SetEmailNotificationBasicEvent">
            <Blocks>
                <Block id="1">
                    <SendMessage id="SetSingleNotificationBasicEvent">
                        <ConstantAssignment path="Resource/EventTriggerNotificationList/EventTriggerNotification/id" value="email"/>
                        <ConstantAssignment path="Resource/EventTriggerNotificationList/EventTriggerNotification/notificationMethod" value="email"/>
                        <UserAssignment actionArgName="Trigger Event" path="TriggerEvent"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>
        <Transaction id="SetCenterNotificationBasicEvent" semanticid="HikvisionCameraBasicEvents#SetCenterNotificationBasicEvent">
            <Blocks>
                <Block id="1">
                    <SendMessage id="SetSingleNotificationBasicEvent">
                        <ConstantAssignment path="Resource/EventTriggerNotificationList/EventTriggerNotification/id" value="center"/>
                        <ConstantAssignment path="Resource/EventTriggerNotificationList/EventTriggerNotification/notificationMethod" value="center"/>
                        <UserAssignment actionArgName="Trigger Event" path="TriggerEvent"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>
        <Transaction id="SetCenterAndEmailNotificationsBasicEvent" semanticid="HikvisionCameraBasicEvents#SetCenterAndEmailNotificationsBasicEvent">
            <Blocks>
                <Block id="1">
                    <SendMessage id="SetCenterAndEmailNotificationsBasicEvent">
                        <UserAssignment actionArgName="Trigger Event" path="TriggerEvent"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <Transaction id="SetNoNotificationBasicEvent" semanticid="HikvisionCameraBasicEvents#SetNoNotificationBasicEvent">
            <Blocks>
                <Block id="1">
                    <SendMessage id="SetNoNotificationBasicEvent">
                        <UserAssignment actionArgName="Trigger Event" path="TriggerEvent"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage timeout="240000">
                            <MessageCase>
                                <ReceiveMessage id="Success"/>
                                <BlockAction>
                                    <Terminate success="true"/>
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource"/>
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource"/>
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
        </Transaction>

        <!-- Logs -->
        <Transaction id="GetDiagnosticData" semanticid="GetLogsSimple#GetLogs" isMetaTransaction="true">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetDiagnosticData" />
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"  />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
          <AlertBlocks>
            <AlertBlock MessageId="HikAlert" timeoutAlertId="GetLogsTimeout" timeout="5400">
              <SuccessCase>
                <Enumeration>
                  <Value>DiagnosticDataDownloadSuccess</Value>
                </Enumeration>
              </SuccessCase>
              <FailureCase>
                <Enumeration>
                  <Value>DiagnosticDataDownloadFailure</Value>
                </Enumeration>
              </FailureCase>
            </AlertBlock>
          </AlertBlocks>
        </Transaction>
        <Transaction id="LogsEvent" semanticid="GetLogsSimple#LogsEvent">
            <Blocks>
                <Block id="1">
                    <ReceiveMessage id="DiagnosticData" />
                    <BlockAction>
                        <Terminate success="true" />
                    </BlockAction>
                </Block>
            </Blocks>
        </Transaction>

        <!-- Config -->

        <Transaction id="GetConfigurationFile" semanticid="HikvisionCameraConfiguration#get-config" isMetaTransaction="true">
            <Blocks>
                <Block id="1">
                    <SendMessage id="GetConfigurationFile">
                        <UserAssignment actionArgName="Secret Key" path="Resource/secretKey"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"  />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
            <AlertBlocks>
                <AlertBlock MessageId="HikAlert" timeoutAlertId="GetConfigTimeout" timeout="5400">
                    <SuccessCase>
                        <Enumeration>
                            <Value>ConfigDownloadSuccess</Value>
                        </Enumeration>
                    </SuccessCase>
                    <FailureCase>
                        <Enumeration>
                            <Value>ConfigDownloadFailure</Value>
                        </Enumeration>
                    </FailureCase>
                </AlertBlock>
            </AlertBlocks>
        </Transaction>

        <Transaction id="ApplyConfigurationFile" semanticid="HikvisionCameraConfiguration#apply-config" isMetaTransaction="true">
            <Blocks>
                <Block id="1">
                    <SendMessage id="ApplyConfigurationFile">
                        <UserAssignment actionArgName="Secret Key" path="Resource/secretKey"/>
                        <UserAssignment actionArgName="Configuration File" path="Resource/File"/>
                    </SendMessage>
                    <Switch>
                        <SwitchOnMessage>
                            <MessageCase>
                                <ReceiveMessage id="Success"  />
                                <BlockAction>
                                    <Terminate success="true" />
                                </BlockAction>
                            </MessageCase>
                            <MessageCase>
                                <ReceiveMessage id="Error">
                                    <VariableDefinition id="Resource" path="Resource" />
                                </ReceiveMessage>
                                <BlockAction>
                                    <Terminate success="false">
                                        <Log variableId="Resource" />
                                    </Terminate>
                                </BlockAction>
                            </MessageCase>
                        </SwitchOnMessage>
                    </Switch>
                </Block>
            </Blocks>
            <AlertBlocks>
                <AlertBlock MessageId="HikAlert" timeoutAlertId="ConfigurationImportTimeout" timeout="5400">
                    <SuccessCase>
                        <Enumeration>
                            <Value>ConfigurationImportSuccess</Value>
                        </Enumeration>
                    </SuccessCase>
                    <FailureCase>
                        <Enumeration>
                            <Value>ConfigurationImportFail</Value>
                        </Enumeration>
                    </FailureCase>
                </AlertBlock>
            </AlertBlocks>
        </Transaction>

        <Transaction id="ConfigEvent" semanticid="HikvisionCameraConfiguration#ConfigEvent">
            <Blocks>
                <Block id="1">
                    <ReceiveMessage id="ConfigurationFile" />
                    <BlockAction>
                        <Terminate success="true" />
                    </BlockAction>
                </Block>
            </Blocks>
        </Transaction>
    </Transactions>

    <ProtocolDefinition id="366D2390-3004-11F0-90A7-0800200C9A66" name="Hikvision Camera HTTP">
        <Protocol>
            <Transaction id="InitializeProtocol" hidden="true" />
            <Transaction id="Register" />
            <Transaction id="DiscoverDevices" instanceIdRequired="true" />
            <Transaction id="Unregister" instanceIdRequired="true" />
            <Transaction id="SearchNewDevices" />
            <Transaction id="NewDevices" />
            <Transaction id="BulkImportDevices" />
        </Protocol>

        <Devices>
            <Device id="hikvision-camera-ds">
                <ApiTypeId id="HIKVISION@@497-0532015@@1" />
                <ApiTypeId id="HIKVISION@@497-0532015-R@@1" />
                <Transaction id="CheckIn" />
                <Transaction id="UpdateFirmwareFromFilestore" />
                <Transaction id="Reboot" />
                <Transaction id="ChangeDeviceSettings" />
                <Transaction id="ChangeTimeSettings" />
                <Transaction id="ChangeNTPSettings" />
                <Transaction id="HikAlert" />
                <Transaction id="GetSerialPort" />
                <Transaction id="ChangeSerialPort" />
                <Transaction id="ChangeNetworkSettings" />
                <Transaction id="ChangeUPnPSettings" />
                <Transaction id="ChangeDDNSSettings" />
                <Transaction id="ChangeHTTPPort" />
                <Transaction id="ChangeHTTPSPort" />
                <Transaction id="ChangeServerPort" />
                <Transaction id="ChangeRTSPPort" />
                <Transaction id="GetSNMPSettings" />
                <Transaction id="ChangeSNMPv1v2Settings" />
                <Transaction id="GetFTPNotificationSettings" />
                <Transaction id="ChangeFTPNotificationSettings" />
                <Transaction id="GetMailingListSettings" />
                <Transaction id="ChangeMailingListSettings" />
                <Transaction id="GetEhomeSettings"/>
                <Transaction id="ChangeEhomeSettings"/>
                <Transaction id="GetQoSSettings"/>
                <Transaction id="ChangeDevMgmtDSCP"/>
                <Transaction id="ChangeCmdCtrlDSCP"/>
                <Transaction id="ChangeVideoDSCP"/>
                <Transaction id="GetIEEE8021xSettings"/>
                <Transaction id="ChangeIEEE8021xSettings"/>
                <Transaction id="GetIntegrateSettings" />
                <Transaction id="ChangeIntegrateSettings" />
                <Transaction id="FactoryReset" />
                <Transaction id="GetStreamingMainSettings"/>
                <Transaction id="ChangeStreamingMainSettings"/>
                <Transaction id="GetStreamingSubSettings"/>
                <Transaction id="ChangeStreamingSubSettings"/>
                <Transaction id="GetStreamingThirdSettings"/>
                <Transaction id="ChangeStreamingThirdSettings"/>
                <Transaction id="ChangeTwoWayAudioSettings" />
                <Transaction id="GetTwoWayAudioSettings"/>
                <Transaction id="GetUserPermissions" />
                <Transaction id="AddOrModifyUser" />
                <Transaction id="DeleteUser" />

                <!-- Image Settings -->
                <Transaction id="GetImageSettings" />
                <Transaction id="ChangeImageAdjustmentSettings" />
                <Transaction id="ChangeExposureSettings" />
                <Transaction id="ChangeIRCutFilter" />
                <Transaction id="ChangeBackLightSettings" />
                <Transaction id="ChangeWhiteBalanceSettings" />
                <Transaction id="ChangeImageEnhancement" />
                <Transaction id="ChangeVideoAdjustment" />
                <Transaction id="ChangeDayNightISPMode" />

                <!-- Security -->
                <Transaction id="GetSecuritySettings" />
                <Transaction id="ChangeSSHSettings" />
                <Transaction id="ChangeIllegalLoginLockSettings" />
                <Transaction id="ChangeWebCertSettings" />

                <!-- VCA -->
                <Transaction id="ChangeVCAResourceSettings" />
                <Transaction id="GetVCAResourceSettings" />

                <!-- Video Overlay -->
                <Transaction id="GetVideoOverlaySettings" />
                <Transaction id="ChangeVideoOverlaySettings" />
                <Transaction id="ChangeVideoChannelSettings" />

                <!-- Basic Events -->
                <Transaction id="GetBasicEvents" />
                <Transaction id="SetEmailNotificationBasicEvent" />
                <Transaction id="SetCenterNotificationBasicEvent" />
                <Transaction id="SetCenterAndEmailNotificationsBasicEvent" />
                <Transaction id="SetNoNotificationBasicEvent" />

                <Transaction id="GetHTTPSCertificateInformation" />

                <!-- Logs -->
                <Transaction id="GetDiagnosticData" />
                <Transaction id="LogsEvent" />

                <!-- Config -->
                <Transaction id="GetConfigurationFile" />
                <Transaction id="ConfigEvent" />

                <Transaction id="ApplyConfigurationFile" />
            </Device>
        </Devices>
    </ProtocolDefinition>
</Domain>
