Universal Plug and Play

UPnP Prerequisites

UPnP Device Architecture and Device Control Protocols

The Applied Informatics Universal Plug and Play framework tries to shield the developer from the implementation details of the various UPnP technologies as much as possible. However, in order to successfully implement a UPnP-capable device, a good knowledge of the UPnP Device Architecture, as well as of the relevant device control protocols is necessary.

Before proceeding with this documentation and the tutorials contained therein, we strongly recommend to read the UPnP Device Architecture (UDA) document. Currently, there are two versions of this document available. Version 1.0 is the one currently most widely in use. Version 1.1 is the latest version, containing some significant improvements. The Applied Informatics UPnP implementation currently only supports Version 1.0 of the UDA. Support for Version 1.1 will be added in a future version.

The UDA document (PDF) is available from the UPnP Forum website free of charge.

The specifications for the various device control protocols, along with the necessary schema and device/service description XML files are also available from the UPnP Forum website.

POCO C++ Libraries

Like all C++ libraries and tools by Applied Informatics, the Universal Plug and Play framework is based on the POCO C++ Libraries. Familiarity with the basics of the POCO C++ Libraries is a plus when working with the Applied Informatics UPnP framework. Furthermore, being familiar with the HTTP server framework in the Net library, as well as with the XML library is highly recommended.

Applied Informatics Remoting and RemotingNG

Device control (SOAP) and eventing (GENA) are implemented based on the Applied Informatics Remoting framework. Being familiar with the basics of Remoting is required when working with the Applied Informatics UPnP framework. The Remoting Overview, Remoting Tutorial Part 1 and Remoting User Guide provide the necessary basics and should be read before proceeding with UPnP.

Note that UPnP uses a new version of the Remoting framework named RemotingNG. RemotingNG offers some additonal features (such as remote events) and provides a more streamlined programming interface. However, the basics of Remoting as described in the documentation still apply. As soon as all existing Remoting transports (Binary, SoapLite, JSON) have been ported to RemotingNG, it will entirely replace the old Remoting framework. Remoting and RemotingNG can be used in parallel, if necessary.

PageCompiler

The POCO C++ Server Page Compiler is used together with the Universal Plug and Play framework to simplify the creation of device description, service description and device presentation/user interface web pages. Familiarity with the tool is recommended in order to understand the sample applications shown in the documentation.

UPnP Framework Components

The Universal Plug and Play framework is modular and consists of various libraries and tools. Figure 1 shows the various libraries used by, or making up the framework.

Figure 1: UPnP Libraries
Figure 1: UPnP Libraries

The UPnP framework requires the Foundation, XML, Net and Util libraries from the POCO C++ Libraries. The UPnP library is a small library that provides a just few classes needed by all other libraries of the framework. The SSDP library implements the Simple Service Discovery Protocol. If no device control or eventing feature is required for a device, the UPnP and SSDP libraries can be used alone to build devices that announce themselves, and thus can be found, via UPnP. For device control and eventing, the SOAP and GENA libraries, as well as the underlying RemotingNG library are required.

In addition to the libraries, the following tools are needed:

  • UPnPGen is a code generator that creates C++ source code from UPnP service description documents.
  • RemoteGen creates the necessary infrastructure code for invoking and providing UPnP services via SOAP, as well as for implementing events via GENA, from the generated service code.
  • PageCompiler is used to implement the web server serving the device and service descriptions, as well as the web-based device user interface.

The UPnP framework can be used to implement controlled devices and control points. The main focus of the framework is on implementing controlled devices. However, control points can also be implemented if some processing logic for device description documents is implemented.

Securely control IoT edge devices from anywhere   Connect a Device