<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.qualcomm.com/debugpolicy"
	xmlns:tns="http://www.qualcomm.com/debugpolicy">

    <element name="debugpolicy">
    	<complexType>
    		<sequence>
    			<element name="metadata" type="tns:metadata" maxOccurs="1" minOccurs="1"></element>
    			<element name="file_properties" type="tns:complex_file_properties" maxOccurs="1" minOccurs="1"></element>
    		</sequence>
    	</complexType></element>

    <complexType name="metadata">
    	<sequence>
    		<element name="chipset" type="string"></element>
    		<element name="version" type="string"></element>
    	</sequence>
    </complexType>

    <complexType name="complex_file_properties">
        <all>
        	<element name="revision" maxOccurs="1" minOccurs="1">

        		<simpleType>
        			<restriction base="unsignedInt">

        				<minInclusive value="1"></minInclusive>
        			</restriction>
        		</simpleType>
        	</element>
        	<element name="serial_number_start" maxOccurs="1"
        		minOccurs="0">
        		<simpleType>
        			<restriction base="unsignedInt">

        				<minInclusive value="0"></minInclusive>

        				<maxInclusive value="4294967295"></maxInclusive>
        			</restriction>
        		</simpleType>
        	</element>
        	<element name="serial_number_end" maxOccurs="1"
        		minOccurs="0">
        		<simpleType>
        			<restriction base="unsignedInt">

        				<minInclusive value="0"></minInclusive>

        				<maxInclusive value="4294967295"></maxInclusive>
        			</restriction>
        		</simpleType>
        	</element>
        	
        	
        	
        	<element name="flags" type="tns:complex_flags" />
        	<element name="image_id_list" maxOccurs="1" minOccurs="0" type="tns:complex_image_id_list" />
            <element name="root_cert_hash_list" type="tns:complex_root_cert_hash_list" />
            <element name="serial_num_list" maxOccurs="1" minOccurs="0" type="tns:complex_serial_num_list"/>
            <element name="root_cert_hash_qti_list" maxOccurs="1" minOccurs="0" type="tns:complex_root_cert_hash_qti_list" />
            <element name="elf" type="tns:complex_elf" />
        </all>
    </complexType>

    <complexType name="complex_flags">
        <sequence>
            <element name="flag" maxOccurs="64" minOccurs="0">
            	<complexType>
    				<all>
                        <element name="bit_pos" type="int" />
                        <element name="value" type="boolean"/>
    				</all>
            	</complexType>
            </element>
        </sequence>
    </complexType>
    
    <complexType name="complex_image_id_list">
        <sequence>
            <element name="image_id" maxOccurs="32" minOccurs="0">

            	<simpleType>
            		<restriction base="string">
            			<maxLength value="8"></maxLength>
            		</restriction>
            	</simpleType>
            </element>
        </sequence>
    </complexType>

    <complexType name="complex_root_cert_hash_list">
        <sequence>
            <element name="root_cert_hash" maxOccurs="4"
            	minOccurs="0">
            	<simpleType>
            		<restriction base="string">

            			<length value="64"></length>
            		</restriction>
            	</simpleType>
            </element>
        </sequence>
    </complexType>

    <complexType name="complex_serial_num_list">
        <sequence>
            <element name="serial_num" maxOccurs="200"
            	minOccurs="1">
            	<simpleType>
            		<restriction base="string">

            			<length value="8"></length>
            		</restriction>
            	</simpleType>
            </element>
        </sequence>
    </complexType>

    <complexType name="complex_root_cert_hash_qti_list">
        <sequence>
            <element name="root_cert_hash_qti" maxOccurs="4"
            	minOccurs="0">
            	<simpleType>
            		<restriction base="string">

            			<length value="64"></length>
            		</restriction>
            	</simpleType>
            </element>
        </sequence>
    </complexType>
    
	<complexType name="complex_elf">
        <all>
        	<element name="elf_class" maxOccurs="1" minOccurs="1">
        		<simpleType>
        			<restriction base="unsignedInt">


        				<minInclusive value="32"></minInclusive>
        				<maxInclusive value="64"></maxInclusive>
        			</restriction>
        		</simpleType>
        	</element>
        	<element name="phys_addr">
        		<simpleType>
        			<restriction base="hexBinary">
        				<maxLength value="8"></maxLength>
        			</restriction>
        		</simpleType>
        	</element>
        </all>
    </complexType>

</schema>