Discovery and Description (Windows Embedded CE 6.0)

1/5/2010

Discovery is the process of a device announcing itself and finding devices through Universal Plug and Play (UPnP). This is done through Simple Service Discovery Protocol (SSDP). Every network device must host a device description document that other devices can examine to determine the properties and the supported media types of that device, and whether it supports Microsoft Windows Media Digital Rights Management (DRM) 10 for Network Devices.

Discovery

Your device uses the Media Query Engine (MQE) to detect UPnP Media Servers such as Microsoft Windows Media Connect.

Windows Media Connect uses standard UPnP discovery mechanisms for announcing itself and for finding devices, depending on whether the devices are Media Renderers or UPnP Control Points. A networked media device is considered a Control Point.

Windows Media Connect announces itself as a UPnP Media Server device by using the SSDP protocol in accordance with the UPnP specification. Windows Media Connect sends out an SSDP NOTIFY message every 15 minutes. Each message is sent twice. Certain fields in these messages have different values depending on the computer that is hosting Windows Media Connect.

The following code samples are NOTIFY messages that are sent out by Windows Media Connect.

Ee480794.collapse(en-US,WinEmbedded.60).gifSample Message 1

NOTIFY * HTTP/1.1\r\n
    Host:239.255.255.250:1900\r\n
    NT:urn:schemas-upnp-org:service:ConnectionManager:1\r\n
    NTS:ssdp:alive\r\n
Location:http://192.168.1.100:2869/upnphost/udhisapi.dll?content=uuid:224e2bb9-6961-4d79-b05f-f72cb415dc6c\r\ns
USN:uuid:224e2bb9-6961-4d79-b05f-f72cb415dc6c::urn:schemas-upnp-org:service:ConnectionManager:1\r\n
    Cache-Control:max-age=1800\r\n
    Server:Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0\r\n
    \r\n

Ee480794.collapse(en-US,WinEmbedded.60).gifSample Message 2

NOTIFY * HTTP/1.1\r\n
Host:239.255.255.250:1900\r\n
    NT:urn:schemas-upnp-org:service:ContentDirectory:1\r\n
NTS:ssdp:alive\r\n
Location:http://192.168.1.100:2869/upnphost/udhisapi.dll?content=uuid:224e2bb9-6961-4d79-b05f-f72cb415dc6c\r\n
USN:uuid:224e2bb9-6961-4d79-b05f-f72cb415dc6c::urn:schemas-upnp-org:service:ContentDirectory:1\r\n
    Cache-Control:max-age=1800\r\n
    Server:Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0\r\n
    \r\n

Ee480794.collapse(en-US,WinEmbedded.60).gifSample Message 3

NOTIFY * HTTP/1.1\r\n
    Host:239.255.255.250:1900\r\n
    NT:urn:schemas-upnp-org:device:MediaServer:1\r\n
    NTS:ssdp:alive\r\n

Ee480794.collapse(en-US,WinEmbedded.60).gifSample Message 4

Location:http://192.168.1.100:2869/upnphost/udhisapi.dll?content=uuid:224e2bb9-6961-4d79-b05f-f72cb415dc6c\r\n
USN:uuid:224e2bb9-6961-4d79-b05f-f72cb415dc6c::urn:schemas-upnp-org:device:MediaServer:1\r\n
    Cache-Control:max-age=1800\r\n
    Server:Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0\r\n
    \r\n

Ee480794.collapse(en-US,WinEmbedded.60).gifSample Message 5

NOTIFY * HTTP/1.1\r\n
Host:239.255.255.250:1900\r\n
NT:upnp:rootdevice\r\n
NTS:ssdp:alive\r\n
Location:http://192.168.1.100:2869/upnphost/udhisapi.dll?content=uuid:224e2bb9-6961-4d79-b05f-f72cb415dc6c\r\n
USN:uuid:224e2bb9-6961-4d79-b05f-f72cb415dc6c::upnp:rootdevice\r\n
Cache-Control:max-age=1800\r\n
Server:Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0\r\n

Ee480794.collapse(en-US,WinEmbedded.60).gifSample Message 6

Windows Media Connect will also respond to any properly formatted M-SEARCH action looking for a media server. The following example shows a UPnP SEARCH message response.
M-SEARCH * HTTP/1.1\r\n
    Host:239.255.255.250:1900\r\n
    ST:urn:schemas-upnp-org:device:MediaServer:1\r\n
    Man:"ssdp:discover"\r\n
    MX:3\r\n
    \r\n

Windows Media Connect Device Discovery

Windows Media Connect attempts to discover all compatible devices. This includes UPnP Media Renderers and UPnP Control Points, such as the networked media device. Whenever a new network device is discovered, a balloon tip in the Microsoft Windows user interface (UI) notifies the user.

Control Points are discovered through UPnP actions. When a UPnP action from a Control Point comes in, the MAC address is checked against a stored list. If the MAC address is new, the device is announced as a new device.

The Description Document

Windows Media Connect displays information about the device if the device makes the information available. Media Renderers is displayed with a generic name "Device<N>", where <N> is an integer.

Most of the device information that is displayed in the UI is acquired from the description document. Each description document must have an XML version tag (as shown here), or the device is not discovered. The XML version tag must look like the following sample XML version tag:

<XML version = 1.0>

Each device must host its own description document. If a device has a description document that is hosted elsewhere, that device is not discovered.

Icons

Windows Media Connect requires icons to be 48 x 48 pixels, with a color depth of 24 bits. Icons can be in the following formats:

  • ICO
  • BMP
  • GIF
  • JPEG
  • PNG
  • TIFF

If an icon that measures 48 x 48 pixels icon is unavailable, the icon that is the closest match is used. Icons of other resolutions might not display properly. Because of this, an icon that measures 48 x 48 pixels is recommended.

The URL that points to the icon must be the same host as the device URL host.

Devices that are not represented by specific icons are represented by a generic device icon.

Digital Rights Management

A custom tag has been added to the UPnP Description Document to identify devices that support Windows Media DRM 10 for Network Devices. If a device supports Windows Media DRM 10 for Network Devices, it must include the following XML in the device description document:

<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:ms=" urn:microsoft-com:wmc-1-0">
  <specVersion>
    <major>1</major>
    <minor>0</minor>
  </specVersion>
  <device ms:X_MS_SupportsWMDRM="true">
  ...
  </device>
</root>

See Also

Concepts

Media Query Engine Architecture