<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="racepoint_component_profile.xsd" manufacturer="Zappiti" model="hdr" alias="Zappiti" device_class="Media_server" minimum_component_engine_version="0.0" rpm_xml_version="8.02" unique_identifier="none">
    <notes>
    	This profile is to be used on all HDR models.Non-HDR models use a different protocol.
    	Make sure they have the latest firmware installed on the Zappiti and you have started 
    	the Zappiti Service. This is the Z icon with the spanners on it.
		====================== Change Log ==================
		Version: 8.0 Initial version
		Version: 8.01 Syntax errors fixed
		Version: 8.02 Refined Profile
		Version: 8.03 Fixed certain keys not working. Ok, and some transport keys.
	
		Avation: Chief
</notes>

    <control_interfaces preferred="ip" control_optional="false">
        <ip port="8080" response_time_length_ms="500" protocol="http" name_on_component="Ethernet">
            <send_prefix type="character"></send_prefix>
            <send_postfix type="character"></send_postfix>

            <response_codes>
                <rspcode message_name="200" status="success" type="character">200</rspcode>
            </response_codes>
        </ip>
    </control_interfaces>

    <media_interfaces>
        <input name_on_component="HDMI IN">
            <combined_media>
                <audio_media type="hdmi_audio"/>
                <video_media type="hdmi"/>
            </combined_media>
        </input>

        <output name_on_component="HDMI">
            <combined_media>
                <audio_media type="hdmi_audio"/>
                <video_media type="hdmi"/>
            </combined_media>
            <resource resource_type="AV_EXTERNALMEDIASERVER_SOURCE"/>
            <resource resource_type="AV_VOLUMECONTROL_FUNCTION"/>
        </output>

        <output name_on_component="Analogue Audio">
            <audio_media type="rca_stereo"></audio_media>
            <resource resource_type="AV_EXTERNALMEDIASERVER_SOURCE"/>
        </output>	
        <output name_on_component="Digital Audio COAX">       
            <audio_media type="coaxial_digital"></audio_media>
            <resource resource_type="AV_EXTERNALMEDIASERVER_SOURCE"/>
        </output>
        <output name_on_component="Digital Audio Optical">
            <audio_media type="optical_digital"></audio_media>
            <resource resource_type="AV_EXTERNALMEDIASERVER_SOURCE"/>
        </output>
        <output name_on_component="Composite Video">
            <video_media type="composite"></video_media>
            <resource resource_type="AV_EXTERNALMEDIASERVER_SOURCE"/>
        </output>

        <data name_on_component="LAN">
            <combined_media>
                <data_media type="ethernet"></data_media>
                <control port="8080"></control>
            </combined_media>
        </data>

        <data name_on_component="USB2.0 rear 1">
            <data_media type="usb"></data_media>
        </data>
        <data name_on_component="USB2.0 rear 2">
            <data_media type="usb"></data_media>
        </data>
        <data name_on_component="USB3.0 rear">
            <data_media type="usb"></data_media>
        </data>
    </media_interfaces>

    <state_variable_list>
    <!--
        <state_variable name="AppID_Netflix" state_center_binding="AppID_Netflix" state_center_type="string" owning_logical_component="Media_server"></state_variable>
	-->
        <state_variable name="Power_current_power_Media_server" state_center_binding="CurrentPowerStatus" state_center_type="string" owning_logical_component="Media_server">OFF</state_variable>
        <state_variable name="Mute_current_mute_Media_server" state_center_binding="CurrentMuteStatus" state_center_type="string" owning_logical_component="Media_server">OFF</state_variable>
        <volume_state_variable name="Volume_current_volume_Media_server" state_center_binding="CurrentVolume" state_center_type="integer" owning_logical_component="Media_server" granularity="1" min_value="0" max_value="100">0</volume_state_variable>
    </state_variable_list>
    
    <logical_component logical_component_name="Media_server">
        <implementation>
            <!--<input name_on_component="HDMI IN"></input>-->
            <output name_on_component="Analogue Audio"></output>
            <output name_on_component="Digital Audio COAX"></output>
            <output name_on_component="Digital Audio Optical"></output>
            <output name_on_component="Composite Video"></output>
            <output name_on_component="HDMI"></output>
        </implementation>
        <status_messages>
            <status_message name="200">
                <constant type="character">200</constant>
            </status_message>
            <status_message name="App">
                <constant type="character">&lt;app id="</constant>
                <data type="character" terminator="&quot;" terminator_type="character">
                    <update state="AppID" type="string"></update>
                </data>
                <data type="character" terminator=">" terminator_type="character">
                    <update state="ThrowAway" type="string"></update>
                </data>
                <data type="character" terminator="&lt;" terminator_type="character">
                    <update state="AppName" type="string"></update>
                </data>
                <constant type="character">/app&gt;</constant>
                <append_data_to_state_names state="AppName" note="Name of the app this ID applies to"></append_data_to_state_names>
            </status_message>
            <status_message name="ThrowAwayHTTPResponse">
                <data type="character" constant_length="2000">
                    <update state="ThrownAwayData" type="string"></update>
                </data>
            </status_message>
        </status_messages>


        <universal_component_actions>
            <action name="PowerOn">
                <execute_on_state_variable_condition name="Power_current_power_Media_server" test_condition="not_equal">ON</execute_on_state_variable_condition>
                <update_state_variable name="Power_current_power_Media_server" update_type="set" update_source="constant">ON</update_state_variable>
                <command_interface interface="ip">
                    <command response_required="yes">
                        <command_string http_request_type="POST" type="character">/remoteCmd?id=0&amp;command=KEYCODE_WAKEUP</command_string>
                        <delay ms_delay="3000"></delay>
                    </command>
                </command_interface>
            </action>

            <action name="PowerOff">
                <execute_on_state_variable_condition name="Power_current_power_Media_server" test_condition="not_equal">OFF</execute_on_state_variable_condition>
                <update_state_variable name="Power_current_power_Media_server" update_type="set" update_source="constant">OFF</update_state_variable>
                <command_interface interface="ip">
                    <command response_required="yes">
                        <command_string http_request_type="POST" type="character">/remoteCmd?id=0&amp;command=KEYCODE_SLEEP</command_string>
                        <delay ms_delay="3000"></delay>
                    </command>
                </command_interface>
            </action>

            <action name="PowerToggle">
                <command_interface interface="ip">
                    <command response_required="yes">
                        <command_string http_request_type="POST" type="character">/remoteCmd?id=0&amp;command=KEYCODE_POWER</command_string>
                        <delay ms_delay="3000"></delay>
                    </command>
                </command_interface>
            </action>
        </universal_component_actions>


        <resource_component_actions resource_type="AV_EXTERNALMEDIASERVER_SOURCE">
            <action name="Select">
                <command_interface interface="ip">
                    <command response_required="yes">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_DPAD_CENTER</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="OSDCursorUp">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_DPAD_UP</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="OSDCursorDown">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_DPAD_DOWN</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="OSDCursorLeft">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_DPAD_LEFT</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="OSDCursorRight">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_DPAD_RIGHT</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="Play">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_MEDIA_PLAY</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="Pause">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_MEDIA_PAUSE</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="Stop">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_MEDIA_STOP</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            
            <action name="Exit">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_BACK</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="Menu">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_MENU</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="Info">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_INFO</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="SkipUp">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_MEDIA_NEXT</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="SkipDown">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_MEDIA_PREVIOUS</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="Audio">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_MEDIA_AUDIO_TRACK</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="Subtitle">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_CAPTIONS</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="NumberZero">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_0</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="NumberOne">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_1</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="NumberTwo">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_2</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="NumberThree">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_3</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="NumberFour">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_4</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="NumberFive">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_5</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="NumberSix">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_6</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="NumberSeven">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_7</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="NumberEight">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_8</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="NumberNine">
                <command_interface interface="ip">
                    <command response_required="no">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_9</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
        </resource_component_actions>
        
        <custom_component_actions>
           	<action name="Zappiti">
                <command_interface interface="ip">
                    <command response_required="yes">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_F3</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="Explorer">
                <command_interface interface="ip">
                    <command response_required="yes">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_F4</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>
            <action name="Settings">
                <command_interface interface="ip">
                    <command response_required="yes">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_SETTINGS</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>           
            <action name="Home">
                <command_interface interface="ip">
                    <command response_required="yes">
                        <command_string http_request_type="POST" type="character">remoteCmd?id=0&amp;command=KEYCODE_HOME</command_string>
                        <delay ms_delay="200"></delay>
                    </command>
                </command_interface>
            </action>               

        </custom_component_actions>
        
    </logical_component>
</component>