libnpupnp  4.1.0
An almost compatible successor for the Portable UPnP reference library
upnpdescription.h
1 /*******************************************************************************
2  *
3  * Copyright (C) 2020 J.F. Dockes <jf@dockes.org>
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  * * Neither name of Intel Corporation nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
21  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  *
29  ******************************************************************************/
30 #ifndef _UPNPDEV_HXX_INCLUDED_
31 #define _UPNPDEV_HXX_INCLUDED_
32 
33 /*
34  * Store parsed XML description document into more convenient c++ structures.
35  * Keep field names compatible with the libupnpp version to facilitate
36  * a possible future merge.
37  */
38 
39 #include <string>
40 #include <vector>
41 
42 #include "UpnpGlobal.h"
43 
44 class EXPORT_SPEC UPnPServiceDesc {
45 public:
47  std::string serviceType;
49  std::string serviceId;
51  std::string SCPDURL;
53  std::string controlURL;
55  std::string eventSubURL;
56 };
57 
58 class EXPORT_SPEC UPnPDeviceDesc {
59 public:
60  UPnPDeviceDesc(const std::string& url, const std::string& description);
61  UPnPDeviceDesc() = default;
62 
64  bool ok{false};
66  std::string deviceType;
68  std::string friendlyName;
71  std::string UDN;
73  std::string descURL;
75  std::string URLBase;
77  std::string manufacturer;
79  std::string modelName;
81  std::string XMLText;
82 
84  std::vector<UPnPServiceDesc> services;
85 
89  std::vector<UPnPDeviceDesc> embedded;
90 };
91 
92 #endif /* _UPNPDEV_HXX_INCLUDED_ */
Definition: upnpdescription.h:58
std::string URLBase
Base for all relative URLs. e.g. http://192.168.4.4:49152/.
Definition: upnpdescription.h:75
std::vector< UPnPDeviceDesc > embedded
Definition: upnpdescription.h:89
std::string descURL
URL this was downloaded from.
Definition: upnpdescription.h:73
std::string friendlyName
User-configurable name (usually), e.g. Lounge-streamer.
Definition: upnpdescription.h:68
std::vector< UPnPServiceDesc > services
Services provided by this device.
Definition: upnpdescription.h:84
std::string manufacturer
Manufacturer: e.g. D-Link, PacketVideo.
Definition: upnpdescription.h:77
std::string XMLText
Raw downloaded document.
Definition: upnpdescription.h:81
std::string deviceType
Device Type: e.g. urn:schemas-upnp-org:device:MediaServer:1.
Definition: upnpdescription.h:66
std::string modelName
Model name: e.g. MediaTomb, DNS-327L.
Definition: upnpdescription.h:79
std::string UDN
Definition: upnpdescription.h:71
Definition: upnpdescription.h:44
std::string serviceType
Service Type e.g. urn:schemas-upnp-org:service:ConnectionManager:1.
Definition: upnpdescription.h:47
std::string eventSubURL
Service event URL.
Definition: upnpdescription.h:55
std::string serviceId
Service Id inside device: e.g. urn:upnp-org:serviceId:ConnectionManager.
Definition: upnpdescription.h:49
std::string controlURL
Service control URL.
Definition: upnpdescription.h:53
std::string SCPDURL
Service description URL.
Definition: upnpdescription.h:51