UPnP Description

The responses that the control point receives for the search discovery request contain a URL that links to the device descriptions. To retrieve a description for an individual device, the control point issues an HTTP GET request on the URL from the discovery message. On receiving the request from the control point, the device must send an HTTP response that contains the device description in the message body. The UPnP description for a device consists of an XML document that contains several pieces of device-specific information, the definitions of all nested devices, and a list of all services including the state variables and actions.

The following code example shows how to create an XML device description, as it is used in both the C Device Host API COM Device Host API.

<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0">
  <specVersion>
    <major>1</major>
    <minor>0</minor>
  </specVersion>

  <device>
    <deviceType>urn:schemas-upnp-org:device.lighting.2</deviceType>
    <friendlyName>Dan's UPnP Device Host Test</friendlyName>
    <manufacturer>Microsoft</manufacturer>
    <manufacturerURL>https://www.microsoft.com/</manufacturerURL>
    <modelDescription>Dan's UPnP-X10 Light and Dimmer control</modelDescription>
    <modelName>X-10L1</modelName>
    <modelNumber>L1</modelNumber>
    <modelURL>https://www.microsoft.com/</modelURL>
    <serialNumber>0000001</serialNumber>
    <UDN>DummyUDN</UDN>
    <UPC>00000-00001</UPC>

    <iconList>
       <icon>
          <mimetype>image/png</mimetype>
          <width>16</width>
          <height>16</height>
          <depth>2</depth>
          <url>icon.png</url>
       </icon>
    </iconList>
    <serviceList>
      <service>
        <serviceType>urn:schemas-upnp-org:service:pwrdim:2</serviceType>
        <serviceId>upnp:id:pwrdim</serviceId>
        <controlURL></controlURL>
        <eventSubURL></eventSubURL>
        <SCPDURL>SampleSCPD.xml</SCPDURL>
      </service>
    </serviceList>

    <presentationURL>sample.html</presentationURL>

   </device>

</root>

See Also

UPnP Framework

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.