libupnpp  0.16.0
A C++ wrapper for the Portable UPnP reference library
Classes | Typedefs | Functions
UPnPClient Namespace Reference

UPnP Description phase: interpreting the device description which we downloaded from the URL obtained by the discovery phase. More...

Classes

class  AVTransport
 AVTransport Service client class. More...
 
class  ConnectionManager
 
class  ContentDirectory
 Content Directory Service client class. More...
 
class  Device
 For now, the Device class is just a holder for the description object. More...
 
class  DeviceDescriptor
 
class  DevicePool
 
class  DirCB
 
class  DiscoveredTask
 
class  LastchangeParser
 
class  MediaRenderer
 The MediaRenderer class mostly holds a bunch of convenience functions to create the different services (and cache handles to them). More...
 
class  MediaServer
 
class  OHInfo
 OHInfo Service client class. More...
 
class  OHPlaylist
 OHPlaylist Service client class. More...
 
class  OHProduct
 OHProduct Service client class. More...
 
class  OHRadio
 OHRadio Service client class. More...
 
class  OHReceiver
 OHReceiver client class. More...
 
class  OHSender
 OHSender client class. More...
 
class  OHSourceParser
 
class  OHTime
 OHTime Service client class. More...
 
class  OHTrackListParser
 
struct  OHVCharacteristics
 
class  OHVolume
 OHVolume Service client class. More...
 
class  RenderingControl
 RenderingControl Service client class. More...
 
class  Service
 
class  ServiceDescriptionParser
 
class  TypedService
 Access an UPnP service actions through a string based interface. More...
 
class  UPnPDeviceDesc
 Data holder for a UPnP device, parsed from the XML description obtained during discovery. More...
 
class  UPnPDeviceDirectory
 Manage UPnP discovery and maintain a directory of active devices. More...
 
class  UPnPDeviceParser
 
class  UPnPDirContent
 Image of a MediaServer Directory Service container (directory), possibly containing items and subordinate containers. More...
 
class  UPnPDirObject
 UPnP Media Server directory entry, converted from XML data. More...
 
class  UPnPDirParser
 
class  UPnPResource
 UPnP resource. More...
 
class  UPnPServiceDesc
 Data holder for a UPnP service, parsed from the device XML description. More...
 
class  VarEventReporter
 To be implemented by upper-level client code for event reporting. More...
 

Typedefs

typedef std::shared_ptr< AVTransportAVTH
 
typedef std::shared_ptr< ContentDirectoryCDSH
 
typedef std::shared_ptr< ConnectionManagerCNMH
 
typedef std::shared_ptr< DeviceDVCH
 
typedef std::shared_ptr< MediaRendererMRDH
 
typedef std::shared_ptr< MediaServerMSRH
 
typedef std::shared_ptr< OHInfoOHIFH
 
typedef std::shared_ptr< OHPlaylistOHPLH
 
typedef std::shared_ptr< OHProductOHPRH
 
typedef std::shared_ptr< OHRadioOHRDH
 
typedef std::shared_ptr< OHReceiverOHRCH
 
typedef std::shared_ptr< OHSenderOHSNH
 
typedef std::shared_ptr< OHTimeOHTMH
 
typedef std::shared_ptr< OHVolumeOHVLH
 
typedef std::shared_ptr< RenderingControlRDCH
 
typedef std::function< void(const std::unordered_map< std::string, std::string > &)> evtCBFunc
 Type of the event callbacks. More...
 

Functions

bool decodeAVLastChange (const string &xml, std::unordered_map< string, string > &props)
 
bool decodeAVLastChange (const std::string &xml, std::unordered_map< std::string, std::string > &props)
 Helper function for decoding UPnP/AV LastChange data. More...
 
bool downloadUrlWithCurl (const string &url, string &out, long timeoutsecs, struct sockaddr_storage *saddr)
 
bool downloadUrlWithCurl (const std::string &url, std::string &out, long timeoutsecs, struct sockaddr_storage *saddr=nullptr)
 
TypedServicefindTypedService (const std::string &devname, const std::string &servicetype, bool fuzzy)
 Find specified service inside specified device, and build a TypedService object. More...
 

Detailed Description

UPnP Description phase: interpreting the device description which we downloaded from the URL obtained by the discovery phase.

Helper functions for dealing with Linn Songcast Sender and Receiver UPnP services.

These deal with plumbing set up, and do not touch the audio stream at all.

Typedef Documentation

◆ evtCBFunc

typedef std::function<void (const std::unordered_map<std::string, std::string>&)> UPnPClient::evtCBFunc

Type of the event callbacks.

If registered by a call to Service::registerCallBack(cbfunc), this will be called with a map of state variable names and values when an event arrives. The call is performed in a separate thread. A call with an empty map means that a subscription autorenew failed.

Function Documentation

◆ decodeAVLastChange()

bool UPnPClient::decodeAVLastChange ( const std::string &  xml,
std::unordered_map< std::string, std::string > &  props 
)

Helper function for decoding UPnP/AV LastChange data.

<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT_RCS"> <InstanceID val="0"> <Mute val="0"> <Volume val="24"> </InstanceID> </Event>

◆ findTypedService()

TypedService UPNPP_API * UPnPClient::findTypedService ( const std::string &  devname,
const std::string &  servicetype,
bool  fuzzy 
)

Find specified service inside specified device, and build a TypedService object.

Parameters
devnamethe device identifier can be specified as an UDN or a friendly name. Beware that friendly names are not necessarily unique. In case of duplicates the first (random) device found will be used. Comparisons between friendly names are case-insensitive (not conform to the standard but convenient).
servicetypeDepending on the value of fuzzy, this will either be used to match the service type exactly, or as a partial match: for example with fuzzy set to true, a servicetype of "avtransport" would match "urn:schemas-upnp-org:service:AVTransport:1", which is what you want in general, with a bit of care.
fuzzydetermines if the service type match is exact or partial.
Returns
an allocated TypedService. Ownership is tranferred to the caller, who will have to delete the object when done.