summaryrefslogtreecommitdiff
path: root/httptnt/deviceDescription.ecpp
blob: 9646d3020590b6df2c36ceb928a793ff16b1908d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version = "1.0" encoding = "utf-8"?>
<#

This is the Device Description File

It contains the device and service descriptions of the media server.

#>
<%pre>
#include <string>
#include <stdint.h>
#include "../include/tools.h"
#include "../include/server.h"
#include "../include/service.h"
#include "../include/webserver.h"
#include "../include/config.h"

using namespace upnp;
</%pre>
<{
  upnp::cMediaServer* server = cMediaServer::GetInstance();
  const upnp::cWebserver& webserver = server->GetWebserver();
  
  const upnp::cMediaServer::Description& serverDescription = server->GetServerDescription();
  std::string deviceUUID = server->GetDeviceUUID();
  std::string presentationUrl = webserver.GetPresentationUrl();
  std::string staticContentUrl = webserver.GetStaticContentUrl();
  
  std::string serviceUrl = webserver.GetServiceUrl();
  std::string controlUrl = webserver.GetControlUrl();
  
  reply.setContentType("application/xml");

}>
<root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:dlna="urn:schemas-dlna-org:device-1-0"> 
  <specVersion> 
    <major>1</major> 
    <minor>0</minor> 
  </specVersion> 
  <device> 
    <deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType> 
    <friendlyName><$ serverDescription.friendlyName $></friendlyName> 
    <manufacturer><$ serverDescription.manufacturer $></manufacturer> 
    <manufacturerURL><$ serverDescription.manufacturerURL $></manufacturerURL> 
    <modelDescription><$ serverDescription.modelDescription $></modelDescription> 
    <modelName><$ serverDescription.modelName $></modelName> 
    <modelNumber><$ serverDescription.modelNumber $></modelNumber> 
    <modelURL><$ serverDescription.modelURL $></modelURL> 
    <serialNumber><$ serverDescription.serialNumber $></serialNumber> 
    <UDN><$ deviceUUID $></UDN> 
    <presentationURL><$ presentationUrl $></presentationURL> 
    <dlna:X_DLNADOC>DMS-1.50</dlna:X_DLNADOC> 
    <serviceList>
<{
  const cMediaServer::serviceMap& services = server->GetServices();
  
  for(cMediaServer::serviceMap::const_iterator it = services.begin(); it != services.end(); ++it){
  	const cUPnPService::Description& serviceDescription = (*it).second->GetServiceDescription();
}>

      <service>
        <serviceType><$ serviceDescription.serviceType $></serviceType>
        <serviceId><$ serviceDescription.serviceID $></serviceId>
        <SCPDURL><$ serviceUrl $><$ serviceDescription.SCPDXML $></SCPDURL>
        <controlURL><$ controlUrl $><$ serviceDescription.controlDescriptor $></controlURL>
        <eventSubURL><$ controlUrl $><$ serviceDescription.eventSubscriberDescriptor $></eventSubURL>
      </service>
%  };
    </serviceList>
    <iconList>
<{
  const cMediaServer::iconList& icons = server->GetServerIcons();
  
  for(cMediaServer::iconList::const_iterator it = icons.begin(); it != icons.end(); ++it){
}>
      <icon>
        <mimetype><$ (*it).profile.mime $></mimetype>
        <width><$ (*it).profile.width $></width>
        <height><$ (*it).profile.height $></height>
        <depth><$ (int)(*it).profile.bitDepth $></depth>
        <url><$ staticContentUrl $><$ (*it).filename $></url>
      </icon>
%  };
    </iconList>
  </device> 
</root>