UPnP Design by Example: A Software Developer's Guide to Universal Plug and Play

Chapter 14: Handling Subscriptions and Events

In the previous chapter you learned how to define service description documents and add control support to your device through the definition and support of UPnP service actions. Each defined action that has input or output parameters for your Super Toaster also had a list of associated state variables. In this chapter you learn what it means for a state variable to be evented, understand how to manage service subscriptions, and implement support for subscriptions and eventing in your sample device.

Problem Description

UPnP devices like your Super Toaster have a wealth of information that control point applications would like to get their hands on. One way to retrieve this information is to call an explicit action exposed on the device that returns the value of the associated state variable.Yet polling is inefficient and puts unnecessary burden on your device and on available network bandwidth. Instead, the control point application would prefer a mechanism to receive instant asynchronous notification when a state variable in a service changes. For this you have UPnP service subscriptions and the eventing of service state variables.

UPnP Service Subscriptions

Simply put, UPnP service subscriptions are a method for subscribing to asynchronous events on the device. The UPnP device architecture uses a subscriber/publisher relationship to define eventing. The subscriber is a control point application interested in receiving information from a device, called the publisher. For the remainder of this chapter the term control point may be used interchangeably with subscriber and

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Network and Communication Chips
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.