### Service::installReporter Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/control_2service_8hxx_source.html Installs a reporter object to handle variable change events from the service. ```APIDOC ## installReporter ### Description Registers a VarEventReporter instance to receive notifications when service variables change. ### Parameters - **reporter** (VarEventReporter*) - Required - The reporter instance to install. ``` -------------------------------- ### Install Event Reporter Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/control_2service_8hxx_source.html Installs a VarEventReporter to receive state change notifications for this service. The caller is responsible for managing the reporter's lifetime. ```cpp virtual void installReporter(VarEventReporter* reporter); ``` -------------------------------- ### Get Network Adapter Names Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/upnpputils_8hxx_source.html Retrieves a list of network adapter descriptions. Note that on Windows, this returns adapter descriptions as names are GUIDs not visible in the GUI. ```cpp bool UPNPP_API getAdapterNames(std::vector& names); ``` -------------------------------- ### installReporter() Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1Service.html Installs or uninstalls an event data reporter object for the service. ```APIDOC ## void UPnPClient::Service::installReporter() ### Description Install or uninstall event data reporter object. Passing nullptr disables reporting and cancels the UPnP subscription. ### Method void ### Parameters #### Path Parameters - **reporter** (VarEventReporter*) - Required - The callbacks to be installed, or nullptr to disable reporting. ``` -------------------------------- ### Method: StartElement Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1ServiceDescriptionParser-members.html Handles the start of an XML element during the parsing process. ```APIDOC ## ServiceDescriptionParser::StartElement ### Description Callback method triggered when an XML start element is encountered. ### Parameters - **name** (const XML_Char*) - Required - The name of the XML element. - **atts** (const XML_Char**) - Required - The attributes associated with the element. ``` -------------------------------- ### void UPnPProvider::UpnpDevice::startloop() Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPProvider_1_1UpnpDevice.html Starts a thread to run the event loop and returns immediately, serving as an alternative to running eventloop() from an application thread. ```APIDOC ## void UPnPProvider::UpnpDevice::startloop() ### Description Starts a thread to run the event loop and returns immediately. This is an alternative to running eventloop() from an application thread. The destructor will take care of the internal thread. ### Method void ### Endpoint UPnPProvider::UpnpDevice::startloop() ``` -------------------------------- ### UPnPDeviceDirectory Get Reason Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/discovery_8hxx_source.html Returns a string describing the reason for the last operation's failure or status. ```cpp const std::string getReason(); ``` -------------------------------- ### WorkQueue::start() Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classWorkQueue.html Starts the worker threads for the WorkQueue. It initializes and launches a specified number of worker threads, each executing a given thread function. ```APIDOC ## WorkQueue::start() ### Description Starts the worker threads. Initializes and launches a specified number of worker threads, each executing a given thread function. ### Method `inline` ### Parameters #### Path Parameters - **nworkers** (int) - Required - Number of threads to start. - **workproc** (void *) - Required - The thread function. It should loop taking (QueueWorker::take()) and executing tasks. - **_arg_** (void *) - Required - Initial parameter to the thread function. ### Response #### Success Response (bool) - **true** - Indicates the operation was successful. ### Request Example ```cpp // Example usage (conceptual): WorkQueue queue; queue.start(4, myTaskProcessor, &initialArg); ``` ### Response Example ``` true ``` ``` -------------------------------- ### Get LibUPnP Instance Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPP_1_1LibUPnP.html Retrieves the singleton LibUPnP object. Initialization is recommended via `init()` before calling this method without arguments. ```APIDOC ## Member Function: getLibUPnP() | LibUPnP * UPnPP::LibUPnP::getLibUPnP | ( | bool | _serveronly_ = `false`, ---|---|---|--- | | std::string * | _hwaddr_ = `0`, | | const std::string | _ifname_ = `std::string()`, | | const std::string | _ip_ = `std::string()`, | | unsigned short | _port_ = `0` | ) | | static Retrieve the singleton LibUPnP object. Using this call with arguments is deprecated. Call `init()` instead (creates the lib) then `getLibUPnP()` without arguments. This initializes libupnp, possibly setting an address and port, possibly registering a client if serveronly is false. ### Parameters - **serveronly** (bool): no client init. - **hwaddr** (std::string*): returns the hardware address for the specified network interface, or the first one if ifname is empty. If the IP address is specified instead of the interface name, the hardware address returned is not necessarily the one matching the IP. - **ifname** (const std::string): if not empty, network interface to use. Passed to libnpupnp. Null or empty to use the first interface, "*" for all interfaces, or space-separated list of interface names. - **ip** (const std::string): if not empty, IP address to use. Only used if ifname is empty. - **port** (unsigned short): port parameter to UpnpInit() (0 for default). ### Returns - LibUPnP*: Pointer to the LibUPnP object. Returns `nullptr` on failure. ``` -------------------------------- ### Set Receiver Playing (URI and Metadata) Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/linnsongcast_8hxx_source.html Starts playback on a given receiver with a specified URI and metadata. This allows initiating playback of specific content. ```cpp bool UPNPP_API setReceiverPlaying(ReceiverState& st, const std::string& uri, const std::string& meta); ``` -------------------------------- ### LibUPnP Initialization and Configuration Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPP_1_1LibUPnP.html Methods for initializing the UPnP library, setting logging levels, and configuring the web server document root. ```APIDOC ## Static Methods for Initialization ### init - **Description**: Initialize the library with specific flags and parameters. - **Parameters**: - **flags** (unsigned int) - Required - Configuration flags (e.g., UPNPPINIT_FLAG_NOIPV6, UPNPPINIT_FLAG_SERVERONLY). ### setLogFileName - **Description**: Set the log file name and activate/deactivate logging for libnpupnp. - **Parameters**: - **fn** (std::string) - Required - Path to the log file. - **level** (LogLevel) - Optional - Logging level (default: LogLevelError). ### setWebServerDocumentRoot - **Description**: Set the root/base directory for the HTTP server. - **Parameters**: - **rootpath** (std::string) - Required - The directory path to serve. ``` -------------------------------- ### Get Event Reporter Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/control_2service_8hxx_source.html Retrieves the currently installed VarEventReporter for this service. Returns nullptr if none is installed. ```cpp virtual VarEventReporter *getReporter(); ``` -------------------------------- ### UPnPDeviceDirectory Get Description Documents Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/discovery_8hxx_source.html Retrieves the XML description documents for a device or service identified by its UID or friendly name. Populates deviceXML and srvsXML with the respective XML content. ```cpp bool getDescriptionDocuments( const std::string &uidOrFriendly, std::string& deviceXML, std::unordered_map& srvsXML); ``` -------------------------------- ### Service Initialization from Description Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/control_2service_8hxx_source.html Initializes the service object using a UPnP device description. Returns true on success. ```cpp bool initFromDescription(const UPnPDeviceDesc& description); ``` -------------------------------- ### POST serviceInit() Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1RenderingControl.html Performs service-specific initialization for the RenderingControl. ```APIDOC ## POST serviceInit() ### Description Service-specific part of initialization, typically called from the constructor or initFromDescription(). ### Method POST ### Parameters #### Request Body - **UPnPDeviceDesc** (object) - Required - Device description object. - **UPnPServiceDesc** (object) - Required - Service description object. ### Response #### Success Response (200) - **success** (bool) - Returns true if initialization was successful. ``` -------------------------------- ### Get Sender by Name Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/linnsongcast_8hxx_source.html Attempts to get a sender by its name and provides a reason for failure if unsuccessful. The 'reason' string is populated on failure. ```cpp OHSNH UPNPP_API getSender(const std::string& nm, std::string& reason); ``` -------------------------------- ### Initialize ExpatXMLParser Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/expatmm_8h_source.html Sets up the parser buffer and initializes the Expat parser instance. ```cpp /* Constructor common code */ void init(size_t chunk_size = 0) { valid_parser = false; expat_parser = nullptr; xml_buffer_size = chunk_size ? chunk_size : 10240; xml_buffer = new XML_Char[xml_buffer_size]; if(xml_buffer == nullptr) return; expat_parser = XML_ParserCreate(nullptr); if(expat_parser == nullptr) { delete [] xml_buffer; xml_buffer = nullptr; return; } status = XML_STATUS_OK; last_error = XML_ERROR_NONE; memset(xml_buffer, 0, xml_buffer_size * sizeof(XML_Char)); /* Set the "ready" flag on this parser */ valid_parser = true; XML_SetUserData(expat_parser, this); register_default_handlers(); } ``` -------------------------------- ### Run Simple Get Action (Template) Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/control_2service_8hxx_source.html A templated helper function to run an action and retrieve a single value of type T. Useful for getting state variables. ```cpp template int runSimpleGet(const std::string& actnm, const std::string& valnm, T *valuep, ActionOptions *opts=nullptr); ``` -------------------------------- ### serviceInit Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1TypedService.html Performs the service-specific initialization, including downloading and parsing the service description data. This is called from initFromDescription(). ```APIDOC ## serviceInit() ### Description Service-specific part of initialization. This downloads and parses the service description data. This is called from initFromDescription(), typically in findTypedService() in our case. ### Method overrideprotectedvirtual ### Endpoint N/A (This is a class method) ### Parameters #### Path Parameters - **device** (UPnPDeviceDesc) - Required - The UPnP device description. - **service** (UPnPServiceDesc) - Required - The UPnP service description. ### Returns - **bool** - True if initialization is successful, false otherwise. ### Remarks Reimplemented from UPnPClient::Service. ``` -------------------------------- ### Class Members - Functions starting with 'n' Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/functions_n.html Lists functions within the libupnpp library whose names start with 'n', along with their respective class documentation links. ```APIDOC ## Functions starting with 'n' ### Description This section lists functions within the libupnpp library whose names begin with the letter 'n'. Each entry includes the function signature and a link to its corresponding class documentation. ### Functions - **noevents()** : UPnPProvider::UpnpService - **notifyEvent()** : UPnPProvider::UpnpDevice ``` -------------------------------- ### Logger Initialization and Usage Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classLogger.html Details on how to initialize and use the Logger, including obtaining the logger instance and setting log levels. ```APIDOC ## GET THE LOG INSTANCE ### Method GET ### Endpoint `/log/thelog` ### Description Retrieves the singleton logger instance. If the logger has not been initialized, it will be initialized with the provided filename. Subsequent calls will return the existing instance. ### Query Parameters * **fn** (string) - Optional - The filename to log to. Use "stderr" for standard error output. If not provided, the default behavior depends on the library's configuration. ### Response #### Success Response (200) * **logger_instance** (Logger*) - A pointer to the singleton Logger object. ### Response Example ```json { "logger_instance": "" } ``` ## SET LOG LEVEL ### Method POST ### Endpoint `/log/level` ### Description Sets the dynamic verbosity level for logging. ### Request Body * **level** (LogLevel) - Required - The desired log level (e.g., LLINF, LLDEB). ### Request Example ```json { "level": "LLDEB" } ``` ### Response #### Success Response (200) * **status** (string) - "success" ### Response Example ```json { "status": "success" } ``` ## REOPEN LOG FILE ### Method POST ### Endpoint `/log/reopen` ### Description Closes the current log file and reopens it with the specified filename. This is useful for log rotation. ### Request Body * **fn** (string) - Required - The new filename for the log file. ### Request Example ```json { "fn": "new_log_file.txt" } ``` ### Response #### Success Response (200) * **status** (string) - "success" ### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Device Configuration and Lifecycle Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPProvider_1_1UpnpDevice.html Methods for device initialization, versioning, and lifecycle management. ```APIDOC ## readLibFile() ### Description Pure virtual method to retrieve service definition XML files or device description fragments. ### Parameters - **name** (const std::string&) - Required - Designator set in the service constructor. - **contents** (std::string&) - Required - Output parameter for the data. ## setProductVersion() ### Description Sets the product name and version used in SERVER headers. ## start() ### Description Registers and activates the device. Used when eventloop() is not used and events are generated via notifyEvent(). ``` -------------------------------- ### GET getSources() Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1OHProduct.html Retrieves the list of sources for the OHProduct. ```APIDOC ## GET getSources() ### Description Retrieves the available sources for the OHProduct instance. ### Method GET ### Parameters #### Path Parameters - **_sources_** (std::vector< Source > &) - Required - Reference to a vector to store the retrieved sources. ### Response - **Return Value** (int) - 0 for success, UPnP error code otherwise. ``` -------------------------------- ### LibUPnP Initialization and Configuration Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/upnpplib_8hxx_source.html Functions for initializing the libupnpp library, setting up logging, and retrieving version information. ```APIDOC ## LibUPnP Initialization and Configuration ### Description Provides methods for initializing the UPnP library, configuring its behavior, and accessing version information. ### Methods #### `static bool init(unsigned int flags, ...)` Initializes the libupnpp library with specified flags. #### `static LibUPnP* getLibUPnP(bool serveronly = false, std::string* hwaddr = 0, const std::string ifname = std::string(), const std::string ip = std::string(), unsigned short port = 0)` Retrieves a singleton instance of the LibUPnP class, optionally configuring server-only mode, hardware address, interface name, IP address, and port. #### `std::string host()` Returns the host address of the UPnP service. #### `std::string port()` Returns the port number of the UPnP service. #### `std::string hwaddr()` Returns the hardware address associated with the UPnP service. #### `bool setWebServerDocumentRoot(const std::string& rootpath)` Sets the document root path for the embedded web server. #### `void setMaxContentLength(int bytes)` Sets the maximum content length for web server requests. #### `bool ok() const` Checks if the library is initialized and operational. #### `static std::string versionString()` Returns the version string of the libupnpp library. #### `static bool setLogFileName(const std::string& fn, LogLevel level = LogLevelError)` Sets the file name for logging and the logging level. #### `static bool setLogLevel(LogLevel level)` Sets the global logging level for the library. #### `static int getInitError()` Retrieves the error code from the last initialization attempt. ### Enums #### `enum InitFlags` Flags to control library initialization behavior. - `UPNPPINIT_FLAG_NONE`: No special flags. - `UPNPPINIT_FLAG_NOIPV6`: Disables IPv6 support. - `UPNPPINIT_FLAG_SERVERONLY`: Initializes the library in server-only mode. - `UPNPPINIT_FLAG_RESANITIZE_URLS`: Enables URL resanitization. #### `enum InitOption` Options that can be passed during initialization. - `UPNPPINIT_OPTION_END`: Marks the end of options. - `UPNPPINIT_OPTION_IFNAMES`: Specifies interface names. - `UPNPPINIT_OPTION_IPV4`: Uses a single IPv4 address. - `UPNPPINIT_OPTION_PORT`: Specifies the port number. - `UPNPPINIT_OPTION_SUBSCRIPTION_TIMEOUT`: Sets the subscription timeout. - `UPNPPINIT_OPTION_CLIENT_PRODUCT`: Sets the client product string. - `UPNPPINIT_OPTION_CLIENT_VERSION`: Sets the client version string. - `UPNPPINIT_OPTION_SUBSOPS_TIMEOUTMS`: Sets the subscription options timeout in milliseconds. - `UPNPPINIT_OPTION_RESANITIZED_CHARS`: Specifies characters to be resanitized. - `UPNPPINIT_OPTION_BOOTID`: Sets the boot ID. #### `enum LogLevel` Defines the severity levels for logging. - `LogLevelNone`: No logging. - `LogLevelError`: Error level logging. - `LogLevelInfo`: Information level logging. - `LogLevelDebug`: Debug level logging. - `LogLevelAll`: All levels of logging. ### Utility Functions #### `static std::string makeDevUUID(const std::string& name, const std::string& hw)` Generates a device UUID based on the provided name and hardware address. #### `static std::string errAsString(const std::string& who, int code)` Converts an error code to its string representation, indicating the source of the error. ``` -------------------------------- ### Get Queue Size Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/workqueue_8h_source.html Returns the current number of items in the queue. ```cpp size_t qsize() { std::unique_lock lock(m_mutex); return m_queue.size(); } ``` -------------------------------- ### GET /getDevByUDN Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1UPnPDeviceDirectory.html Finds a device by its Unique Device Name (UDN). ```APIDOC ## GET /getDevByUDN ### Description Find device by UDN. This will wait for the remaining duration of the initial search window if the device is not found at once. ### Parameters #### Query Parameters - **udn** (string) - Required - The device Unique Device Name (UUID). ### Response #### Success Response (200) - **ddesc** (UPnPDeviceDesc) - The description data if the device was found. ``` -------------------------------- ### Initialize Library Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPP_1_1LibUPnP.html Initializes the library with more control than a direct `getLibUPnP()` call. After successful initialization, `getLibUPnP()` can be called to access the object instance. ```APIDOC ## Member Function: init() | bool UPnPP::LibUPnP::init | ( | unsigned int | _flags_ , ---|---|---|--- | | | _..._ | ) | | static Initialize the library, with more complete control than a direct `getLibUPnP()` call. On success you will then call `getLibUPnP()` to access the object instance. ### Parameters - **flags** (unsigned int): A bitfield of `InitFlags` values. - **...**: A list of `InitOption` and values, ended by `UPNPPINIT_OPTION_END`. ### Returns - bool: `false` for failure, `true` for success. ``` -------------------------------- ### GET getVolume() Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1RenderingControl.html Retrieves the current volume level for a specified channel. ```APIDOC ## GET getVolume() ### Description Returns the current volume value for the specified channel. ### Method GET ### Parameters #### Query Parameters - **channel** (string) - Optional - The channel to query, defaults to "Master". ### Response #### Success Response (200) - **volume** (int) - Current volume value (0-100), or negative for error. ``` -------------------------------- ### UpnpService Constructor Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPProvider_1_1UpnpService.html Initializes a new UpnpService instance and registers it with the specified UPnP device. ```APIDOC ## UpnpService Constructor ### Description The main role of the derived constructor is to register the service action callbacks by calling UpnpDevice::addActionMapping() and register the object with the device. ### Parameters #### Path Parameters - **stp** (std::string) - Required - Service type. - **sid** (std::string) - Required - Service id. - **xmlfn** (std::string) - Required - XML service description designator. - **dev** (UpnpDevice*) - Required - The device this service will be attached to. - **noevents** (bool) - Optional - If set, the service will function normally except that no calls will be made to libupnp to broadcast events. ``` -------------------------------- ### Initialize and Configure libupnpp Logging Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/libupnpp-ctl.html Initializes the libupnpp logger and sets the verbosity level. Ensure the log file can be initialized; otherwise, an error is returned. Use LOGINF macro for informational messages. ```C++ if (Logger::getTheLog(logfilename) == 0) { cerr << "Can't initialize log" << endl; return 1; } Logger::getTheLog("")->setLogLevel(Logger::LLINF); ... LOGINF("Message at level INFO, it outputs some value: " << value); ``` -------------------------------- ### Get Simple Path Component Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/upnpp__p_8hxx_source.html Extracts the simplest component of a path string. ```cpp extern std::string path_getsimple(const std::string &s); ``` -------------------------------- ### Get Service Manufacturer Name Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/control_2service_8hxx_source.html Retrieves the manufacturer name of the UPnP device. ```cpp const std::string& getManufacturer() const; ``` -------------------------------- ### UPnPP::LibUPnP Initialization Flags and Options Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/functions_eval.html Lists the available enumeration values used for configuring the UPnPP::LibUPnP library initialization. ```APIDOC ## Enumerations: UPnPP::LibUPnP ### Description These flags and options are used to configure the behavior of the UPnP library during initialization. ### Enumerator Values - **UPNPPINIT_FLAG_NOIPV6** - Disable IPv6 support. - **UPNPPINIT_FLAG_RESANITIZE_URLS** - Enable URL re-sanitization. - **UPNPPINIT_FLAG_SERVERONLY** - Initialize in server-only mode. - **UPNPPINIT_OPTION_BOOTID** - Set boot ID option. - **UPNPPINIT_OPTION_CLIENT_PRODUCT** - Set client product name. - **UPNPPINIT_OPTION_CLIENT_VERSION** - Set client version string. - **UPNPPINIT_OPTION_END** - End of options list. - **UPNPPINIT_OPTION_IFNAMES** - Set interface names. - **UPNPPINIT_OPTION_IPV4** - Set IPv4 address. - **UPNPPINIT_OPTION_PORT** - Set port number. - **UPNPPINIT_OPTION_RESANITIZED_CHARS** - Set characters for URL re-sanitization. - **UPNPPINIT_OPTION_SUBSCRIPTION_TIMEOUT** - Set subscription timeout. - **UPNPPINIT_OPTION_SUBSOPS_TIMEOUTMS** - Set subscription operations timeout in milliseconds. ``` -------------------------------- ### Get Service Model Name Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/control_2service_8hxx_source.html Retrieves the model name of the UPnP device. ```cpp const std::string& getModelName() const; ``` -------------------------------- ### Macros and Initialization Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/smallut_8h_source.html Utility macros and initialization functions. ```APIDOC ## Macros and Initialization ### Description Utility macros for common programming tasks and initialization functions. ### Initialization - **smallut_init_mt**(): void Call this function before using any libupnpp utilities in a multithreaded environment. ### Macros - **MIN(A, B)** Returns the minimum of two values. - **MAX(A, B)** Returns the maximum of two values. - **deleteZ(X)** Deletes a pointer `X` and sets it to `nullptr`. - **PRETEND_USE(var)** A macro to indicate that a variable is intentionally unused, suppressing compiler warnings. - **VERSION_AT_LEAST(LIBMAJ, LIBMIN, LIBREV, TARGMAJ, TARGMIN, TARGREV)** A macro to check if the library version is at least the target version. It compares major, minor, and revision numbers. ``` -------------------------------- ### Constructor: ServiceDescriptionParser Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1ServiceDescriptionParser-members.html Initializes a new instance of the ServiceDescriptionParser to parse a UPnP service description string. ```APIDOC ## ServiceDescriptionParser::ServiceDescriptionParser ### Description Constructs a parser instance to process a UPnP service description input. ### Parameters - **out** (UPnPServiceDesc::Parsed&) - Required - Reference to the structure where parsed results will be stored. - **input** (const string&) - Required - The XML service description string to be parsed. ### Request Example ServiceDescriptionParser parser(parsedDesc, xmlInputString); ``` -------------------------------- ### Get Service Friendly Name Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/control_2service_8hxx_source.html Retrieves the human-readable name of the UPnP service. ```cpp const std::string& getFriendlyName() const; ``` -------------------------------- ### UPnPClient::MediaServer Class Methods Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1MediaServer.html Overview of the MediaServer class constructor and its associated methods for interacting with UPnP devices. ```APIDOC ## MediaServer Class ### Description Represents a UPnP Media Server device, providing access to Content Directory Services (CDS). ### Methods - **MediaServer(const UPnPDeviceDesc &desc)**: Constructor for the MediaServer class. - **cds()**: Returns the Content Directory Service (CDSH) associated with the server. ### Static Methods - **getDeviceDescs(std::vector &devices, const std::string &friendlyName="")**: Retrieves a list of available device descriptions, optionally filtered by friendly name. - **isMSDevice(const std::string &devicetype)**: Checks if a given device type string corresponds to a Media Server device. ``` -------------------------------- ### GET serviceTypeMatch() Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1OHProduct.html Compares a provided string against the service type of the current service. ```APIDOC ## GET serviceTypeMatch() ### Description Performs a comparison between the provided service type string and the one for the derived class. Used by initFromDescription() to look up entries from the device description service list. ### Method GET ### Parameters #### Query Parameters - **tp** (const std::string &) - Required - Service type string to be compared. ### Response - **Return Value** (bool) - Returns true if the service type matches, false otherwise. ``` -------------------------------- ### Class Members - UPNPPINIT_OPTION_CLIENT_PRODUCT Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/functions_u.html Details for the UPNPPINIT_OPTION_CLIENT_PRODUCT option within the UPnPP::LibUPnP namespace. ```APIDOC ## UPNPPINIT_OPTION_CLIENT_PRODUCT ### Description Initialization option to specify the client product information. ### Namespace UPnPP::LibUPnP ### Type Initialization Option ``` -------------------------------- ### Class Members - t Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/functions_t.html List of class members starting with 't' and their associated classes. ```APIDOC ## Class Members - t ### Description This section lists class members that start with the letter 't'. Each entry includes the member name and the class it belongs to. ### Members - **take()** (WorkQueue< T >) - **terminate()** (UPnPClient::UPnPDeviceDirectory) - **traverse()** (UPnPClient::UPnPDeviceDirectory) - **TypedService()** (UPnPClient::TypedService) ``` -------------------------------- ### SimpleRegexp::ok Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/smallut_8h_source.html Checks if the SimpleRegexp object was successfully initialized. ```cpp bool ok() const ``` -------------------------------- ### Class Members - a Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/functions.html List of class members starting with 'a' and their associated class documentation. ```APIDOC ## Class Members - a ### addActionMapping() - **Class**: UPnPProvider::UpnpDevice ### addCallback() - **Class**: UPnPClient::UPnPDeviceDirectory ### addFile() - **Class**: UPnPProvider::VirtualDir ### addLostCallback() - **Class**: UPnPClient::UPnPDeviceDirectory ### addService() - **Class**: UPnPProvider::UpnpDevice ### addVDir() - **Class**: UPnPProvider::VirtualDir ### addVFile() - **Class**: UPnPProvider::UpnpDevice ### autorenew_failed() - **Class**: UPnPClient::VarEventReporter ``` -------------------------------- ### UPnPDeviceDirectory Private Constructor Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/discovery_8hxx_source.html Private constructor for the UPnPDeviceDirectory class, enforcing the singleton pattern. It takes a search window parameter. ```cpp UPNP_LOCAL UPnPDeviceDirectory(time_t search_window); ``` -------------------------------- ### Get Parent Path Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/upnpp__p_8hxx_source.html Extracts the parent directory path from a given path string. ```cpp extern std::string path_getfather(const std::string &s); ``` -------------------------------- ### MediaServer Constructor Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/mediaserver_8hxx_source.html Details the constructor for the MediaServer class, which initializes the object with a UPnP device description. ```APIDOC ## MediaServer(const UPnPDeviceDesc& desc) ### Description Constructs a MediaServer object using a provided UPnPDeviceDesc. ### Method constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "desc": "UPnPDeviceDesc object" } ``` ### Response #### Success Response (200) None (Constructor) #### Response Example None ``` -------------------------------- ### UPnPDeviceParser Constructor Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1UPnPDeviceParser-members.html Initializes a new instance of the UPnPDeviceParser class to parse a UPnP device description. ```APIDOC ## UPnPDeviceParser::UPnPDeviceParser ### Description Constructs a parser for a UPnP device description. ### Parameters - **input** (const string &) - Required - The input string containing the XML device description. - **device** (UPnPDeviceDesc &) - Required - The object where the parsed device description will be stored. ``` -------------------------------- ### Check if String Begins With Prefix Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/smallut_8h_source.html Determines if a string 'b' starts with the prefix 'sml'. ```cpp extern bool beginswith(const std::string& b, const std::string& sml); ``` -------------------------------- ### Class Members - v Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/functions_v.html List of class members starting with 'v' from the libupnpp library. ```APIDOC ## Class Members - v ### Description This section lists class members that start with the letter 'v'. It includes functions, types, and variables along with their respective class documentation links. ### Members - **versionString()** : UPnPP::LibUPnP - Returns the version string of the library. - **Visitor** : UPnPClient::UPnPDeviceDirectory - Represents a visitor pattern for UPnP device directory traversal. - **volume()** : UPnPClient::OHVolume - Gets the current volume level. - **volumeMax** : UPnPClient::OHVCharacteristics - Represents the maximum volume level. - **volumeMilliDbPerStep** : UPnPClient::OHVCharacteristics - Represents the volume change in milli-decibels per step. - **volumeSteps** : UPnPClient::OHVCharacteristics - Represents the total number of volume steps. - **volumeUnity** : UPnPClient::OHVCharacteristics - Represents the volume level at unity gain. ``` -------------------------------- ### Initialization Options Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPP_1_1LibUPnP.html Enum defining options for initializing the LibUPnP library. Each option can be followed by specific parameters. ```APIDOC ## Enum UPnPP::LibUPnP::InitOption Options for the initialisation call. Each option argument may be followed by specific parameters. - **UPNPPINIT_OPTION_END**: Terminate the VARARGs list. - **UPNPPINIT_OPTION_IFNAMES**: Names of the interfaces to use. A `const std::string*` follows. This is a space-separated list. If not set, we will use the first interface. If set to '*', we will use all possible interfaces. Use an empty string to keep the default setting. - **UPNPPINIT_OPTION_IPV4**: Use single IPV4 address. A `const std::string*` address in dot notation follows. This is incompatible with OPTION_IFNAMES. Use an empty string to keep the default value. - **UPNPPINIT_OPTION_PORT**: IP Port to use. An `int` parameter follows. The lower lib default is 49152. - **UPNPPINIT_OPTION_SUBSCRIPTION_TIMEOUT**: Control: subscription timeout in seconds. An `int` parameter follows. Default: 1800. - **UPNPPINIT_OPTION_CLIENT_PRODUCT**: Control: product name to set in user-agent strings. A `const std::string*` follows. Use an empty string to keep the default. - **UPNPPINIT_OPTION_CLIENT_VERSION**: Control: product version to set in user-agent strings. A `const std::string*` follows. Use an empty string to keep the default. - **UPNPPINIT_OPTION_SUBSOPS_TIMEOUTMS**: Control: HTTP timeout for subscription/unsubscriptions connections to the device. The libupnp default of 30000 ms is very high. An `int` parameter follows. Use -1 to keep the default. - **UPNPPINIT_OPTION_RESANITIZED_CHARS**: Control: characters that we should further url-escape when found in URLs out of a content directory. The default is (delimited by excluded <>). A `const std::string*` follows. Use an empty string to keep the default. - **UPNPPINIT_OPTION_BOOTID**: Device: UPnP 1.1 BOOTINIT.UPNP.ORG value. `int` value. Use -1 to keep the constant default of 1. ``` -------------------------------- ### Get Service Action URL Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/control_2service_8hxx_source.html Retrieves the URL endpoint for sending actions to this UPnP service. ```cpp const std::string& getActionURL() const; ``` -------------------------------- ### UPnPDeviceDirectory Singleton Instance Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/discovery_8hxx_source.html Retrieves the singleton instance of UPnPDeviceDirectory. Allows specifying a search window for device discovery. ```cpp static UPnPDeviceDirectory *getTheDir(time_t search_window = 2); ``` -------------------------------- ### Get Service Device ID Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/control_2service_8hxx_source.html Retrieves the unique identifier for the UPnP device hosting this service. ```cpp const std::string& getDeviceId() const; ``` -------------------------------- ### UPnPClient::Device Class Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1Device.html Documentation for the Device class constructor and member functions. ```APIDOC ## Class: UPnPClient::Device ### Description For now, the Device class is just a holder for the description object. It is a pure data object; functionality is handled by the Service class and its derivatives. ### Public Member Functions - **Device(const UPnPDeviceDesc &desc)** - Constructor: Initializes the device with a UPnP device description. - **const UPnPDeviceDesc *desc() const** - Returns a pointer to the internal UPnPDeviceDesc object. ### Header #include ``` -------------------------------- ### GET /getDescriptionDocuments Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1UPnPDeviceDirectory.html Retrieves the description documents for a specific device identified by UUID or friendly name. ```APIDOC ## GET /getDescriptionDocuments ### Description Helper function to retrieve all description data for a named device. ### Parameters #### Query Parameters - **uidOrFriendly** (string) - Required - Device identification (UUID or friendly name). ### Response #### Success Response (200) - **deviceXML** (string) - The device description document. - **srvsXML** (unordered_map) - Map of service names to service descriptions. ``` -------------------------------- ### ServiceDescriptionParser Constructor Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1ServiceDescriptionParser.html Initializes a new instance of the ServiceDescriptionParser to parse a specific UPnP service description input. ```APIDOC ## Constructor: ServiceDescriptionParser ### Description Initializes the parser with the output structure and the input XML string. ### Parameters - **out** (UPnPServiceDesc::Parsed &) - Required - Reference to the structure where parsed data will be stored. - **input** (const string &) - Required - The XML input string to be parsed. ``` -------------------------------- ### UPnPClient::OHVolume Methods Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1OHVolume-members.html Methods for interacting with the OpenHome Volume service, including volume control, muting, and service initialization. ```APIDOC ## OHVolume Methods ### Description Methods for managing volume and mute states on a UPnP device supporting the OpenHome Volume service. ### Methods - **characteristics(OHVCharacteristics *c)**: Retrieves volume characteristics. - **mute(bool *value)**: Retrieves the current mute state. - **setMute(bool value)**: Sets the mute state. - **setVolume(int value)**: Sets the volume level. - **volume(int *value)**: Retrieves the current volume level. - **volumeLimit(int *value)**: Retrieves the volume limit. - **isOHVLService(const std::string &st)**: Static method to check if a service type string matches the OHVolume service. ``` -------------------------------- ### libupnpp Functions Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/functions_func.html A list of all documented functions within the libupnpp library, categorized by their starting letter. ```APIDOC ## libupnpp Functions Documentation This section details the functions available in the libupnpp library. ### Functions starting with 'a' - **addActionMapping()**: Returns `UPnPProvider::UpnpDevice`. - **addCallback()**: Belongs to `UPnPClient::UPnPDeviceDirectory`. - **addFile()**: Belongs to `UPnPProvider::VirtualDir`. - **addLostCallback()**: Belongs to `UPnPClient::UPnPDeviceDirectory`. - **addService()**: Belongs to `UPnPProvider::UpnpDevice`. - **addVDir()**: Belongs to `UPnPProvider::VirtualDir`. - **addVFile()**: Belongs to `UPnPProvider::UpnpDevice`. - **autorenew_failed()**: Belongs to `UPnPClient::VarEventReporter`. ### Functions starting with 'c' - **changed()**: Belongs to `UPnPClient::VarEventReporter`. - **checkobjok()**: Belongs to `UPnPClient::UPnPDirParser`. - **clear()**: Belongs to `UPnPClient::UPnPServiceDesc`. - **closeShop()**: Belongs to `WorkQueue< T >`. - **ContentDirectory()**: Belongs to `UPnPClient::ContentDirectory`. ### Functions starting with 'd' - **datestring()**: Belongs to `Logger`. - **delCallback()**: Belongs to `UPnPClient::UPnPDeviceDirectory`. - **delLostCallback()**: Belongs to `UPnPClient::UPnPDeviceDirectory`. - **dump()**: Belongs to `UPnPClient::UPnPServiceDesc`. ### Functions starting with 'e' - **errAsString()**: Belongs to `UPnPP::LibUPnP`. - **errString()**: Belongs to `UPnPProvider::UpnpService`. - **eventloop()**: Belongs to `UPnPProvider::UpnpDevice`. ### Functions starting with 'f' - **f2s()**: Belongs to `UPnPClient::UPnPDirObject`. - **fetchAndParseDesc()**: Belongs to `UPnPClient::UPnPServiceDesc`. ### Functions starting with 'g' - **get()**: Belongs to `UPnPP::SoapIncoming`. - **getAlbumArtist()**: Belongs to `UPnPClient::UPnPDirObject`. - **getAlbumArtistElseArtists()**: Belongs to `UPnPClient::UPnPDirObject`. - **getArtists()**: Belongs to `UPnPClient::UPnPDirObject`. - **getDescriptionDocuments()**: Belongs to `UPnPClient::UPnPDeviceDirectory`. - **getDevByFName()**: Belongs to `UPnPClient::UPnPDeviceDirectory`. - **getDevByUDN()**: Belongs to `UPnPClient::UPnPDeviceDirectory`. - **getDeviceDescs()**: Belongs to `UPnPClient::MediaRenderer`. - **getDeviceId()**: Belongs to `UPnPProvider::UpnpDevice`. - **getdidl()**: Belongs to `UPnPClient::UPnPDirObject`. - **getDurationSeconds()**: Belongs to `UPnPClient::UPnPDirObject`. - **getEventData()**: Belongs to `UPnPProvider::UpnpService`. - **getFriendlyName()**: Belongs to `UPnPClient::Service`. - **getInitError()**: Belongs to `UPnPP::LibUPnP`. - **getLibUPnP()**: Belongs to `UPnPP::LibUPnP`. - **getlogfilename()**: Belongs to `Logger`. - **getloglevel()**: Belongs to `Logger`. - **getMatch()**: Belongs to `MedocUtils::SimpleRegexp`. - **getMetadata()**: Belongs to `UPnPClient::ContentDirectory`. - **getName()**: Belongs to `UPnPP::SoapIncoming`. - **getprop()**: Belongs to `UPnPClient::UPnPDirObject`. - **getReason()**: Belongs to `UPnPClient::UPnPDeviceDirectory`. - **getRemainingDelay()**: Belongs to `UPnPClient::UPnPDeviceDirectory`. - **getRemainingDelayMs()**: Belongs to `UPnPClient::UPnPDeviceDirectory`. - **getReporter()**: Belongs to `UPnPClient::Service`. - **getRoledArtists()**: Belongs to `UPnPClient::UPnPDirObject`. - **getrprop()**: Belongs to `UPnPClient::UPnPDirObject`. - **getSearchCapabilities()**: Belongs to `UPnPClient::ContentDirectory`. - **getServerByName()**: Belongs to `UPnPClient::ContentDirectory`. - **getServices()**: Belongs to `UPnPClient::ContentDirectory`. - **getSources()**: Belongs to `UPnPClient::OHProduct`. - **getstream()**: Belongs to `Logger`. - **getTheDir()**: Belongs to `UPnPClient::UPnPDeviceDirectory`. - **getTheLog()**: Belongs to `Logger`. - **getupropref()**: Belongs to `UPnPClient::UPnPDirObject`. - **getVirtualDir()**: Belongs to `UPnPProvider::VirtualDir`. - **getVolume()**: Belongs to `UPnPClient::RenderingControl`. ### Functions starting with 'h' - **host()**: Belongs to `UPnPP::LibUPnP`. - **hwaddr()**: Belongs to `UPnPP::LibUPnP`. ### Functions starting with 'i' - **init()**: Belongs to `UPnPP::LibUPnP`. - **initFromDescription()**: Belongs to `UPnPClient::Service`. - **installReporter()**: Belongs to `UPnPClient::Service`. - **ipv4()**: Belongs to `UPnPProvider::UpnpDevice`. - **isAVTService()**: Belongs to `UPnPClient::AVTransport`. - **isCDService()**: Belongs to `UPnPClient::ContentDirectory`. - **isOHInfoService()**: Belongs to `UPnPClient::OHInfo`. - **isOHPlService()**: Belongs to `UPnPClient::OHPlaylist`. - **isOHPrService()**: Belongs to `UPnPClient::OHProduct`. - **isOHRcService()**: Belongs to `UPnPClient::OHReceiver`. - **isOHRdService()**: Belongs to `UPnPClient::OHRadio`. - **isOHSenderService()**: Belongs to `UPnPClient::OHSender`. - **isOHTMService()**: Belongs to `UPnPClient::OHTime`. - **isOHVLService()**: Belongs to `UPnPClient::OHVolume`. - **isRDCService()**: Belongs to `UPnPClient::RenderingControl`. ### Functions starting with 'l' - **logisstderr()**: Belongs to `Logger`. - **logthedate()**: Belongs to `Logger`. - **loopWakeup()**: Belongs to `UPnPProvider::UpnpDevice`. ### Functions starting with 'm' - **makeDevUUID()**: Belongs to `UPnPP::LibUPnP`. - **MediaRenderer()**: Belongs to `UPnPClient::MediaRenderer`. ### Functions starting with 'n' - **noevents()**: Belongs to `UPnPProvider::UpnpService`. - **notifyEvent()**: Belongs to `UPnPProvider::UpnpDevice`. ``` -------------------------------- ### Get Sender Service Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/linnsongcast_8hxx_source.html Retrieves the sender service for a given device. Requires a DVCH device object. ```cpp OHSNH UPNPP_API senderService(DVCH dev); ``` -------------------------------- ### Service-Specific Initialization Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/libupnpp-ctl.html Implement serviceInit for any initialization steps specific to your service type. This method is called after the base class is fully initialized. ```cpp virtual bool UPnPClient::Service::serviceInit(const UPnPDeviceDesc& device, const UPnPServiceDesc& service); ``` -------------------------------- ### GET serviceTypeMatch() Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1RenderingControl.html Compares a provided service type string against the class's internal service type. ```APIDOC ## GET serviceTypeMatch() ### Description Performs a comparison to the service type string for this specific service. ### Method GET ### Parameters #### Query Parameters - **tp** (string) - Required - Service type string to be compared. ### Response #### Success Response (200) - **match** (bool) - Returns true if the service types match. ``` -------------------------------- ### Get Service Type Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/control_2service_8hxx_source.html Retrieves the UPnP service type identifier (e.g., 'urn:schemas-upnp-org:service:ContentDirectory:1'). ```cpp const std::string& getServiceType() const; ``` -------------------------------- ### POST Service() Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1OHProduct.html Constructor for the Service object. ```APIDOC ## POST Service() ### Description Initializes an empty Service object. The object may be initialized later by calling initFromDescription(). ### Method POST ``` -------------------------------- ### UPnPDirParser Constructor Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/classUPnPClient_1_1UPnPDirParser-members.html Initializes a new instance of the UPnPDirParser class with the target directory content and input string. ```APIDOC ## UPnPDirParser::UPnPDirParser ### Description Constructs a parser instance to process UPnP directory content from a given input string. ### Parameters - **dir** (UPnPDirContent&) - Required - Reference to the directory content object to be populated. - **input** (const std::string&) - Required - The XML input string to be parsed. ``` -------------------------------- ### Set Receiver Playing (State Object) Source: https://www.lesbonscomptes.com/upmpdcli/libupnpp-refdoc/refdoc/html/linnsongcast_8hxx_source.html Starts playback on a given receiver using its current state information. ```cpp bool UPNPP_API setReceiverPlaying(ReceiverState& st); ```