libupnpp  0.16.0
A C++ wrapper for the Portable UPnP reference library
Classes | Public Member Functions | Public Attributes | List of all members
UPnPClient::UPnPServiceDesc Class Reference

Data holder for a UPnP service, parsed from the device XML description. More...

#include <description.hxx>

Classes

struct  Action
 UPnP service action descriptor, from the service description document. More...
 
struct  Argument
 Description of an action argument: name, direction, state variable it relates to (which will yield the type) More...
 
struct  Parsed
 Service description as parsed from the service XML document: actions and state variables. More...
 
struct  StateVariable
 Holder for all the attributes of an UPnP service state variable. More...
 

Public Member Functions

void clear ()
 Reset all data.
 
std::string dump () const
 Debug: return the basic parsed data as a string.
 
bool fetchAndParseDesc (const std::string &urlbase, Parsed &parsed, std::string *XMLText=0) const
 Fetch the service description document and parse it. More...
 

Public Attributes

std::string serviceType
 Service Type e.g. urn:schemas-upnp-org:service:ConnectionManager:1.
 
std::string serviceId
 Service Id inside device: e.g. urn:upnp-org:serviceId:ConnectionManager.
 
std::string SCPDURL
 Service description URL.
 
std::string controlURL
 Service control URL.
 
std::string eventSubURL
 Service event URL.
 

Detailed Description

Data holder for a UPnP service, parsed from the device XML description.

The discovery code does not download the service description documents, and the only set values after discovery are those available from the device description (serviceId, SCPDURL, controlURL, eventSubURL). You can call fetchAndParseDesc() to obtain a parsed version of the service description document, with all the actions and state variables. This is mostly useful if you need to retrieve some min/max values for the state variable, in case there is no action defined to retrieve them (e.g. min/max volume values for AVT RenderingControl). Also, if you wanted to define dynamic methods from the description data.

Member Function Documentation

◆ fetchAndParseDesc()

bool UPnPClient::UPnPServiceDesc::fetchAndParseDesc ( const std::string &  urlbase,
Parsed parsed,
std::string *  XMLText = 0 
) const

Fetch the service description document and parse it.

Parameters
urlbaseThe URL base is found in the device description
[out]parsedThe resulting parsed Action and Variable lists.
[out]XMLTextThe raw downloaded XML text.

The documentation for this class was generated from the following files: