blob: 04ec450dae2b878340a885b01817211a37869f38 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head>
<title>Apache Felix - UPnP Examples</title>
<link rel="icon" href="/res/favicon.ico">
<link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
<link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
<body>
<div class="title">
<div class="logo">
<a href="https://felix.apache.org/">
<img border="0" alt="Apache Felix" src="/res/logo.png">
</a>
</div>
<div class="header">
<a href="https://www.apache.org/">
<img border="0" alt="Apache" src="/res/apache.png">
</a>
</div>
</div>
<div class="menu">
<style type="text/css">
/* The following code is added by mdx_elementid.py
It was originally lifted from http://subversion.apache.org/style/site.css */
/*
* Hide class="elementid-permalink", except when an enclosing heading
* has the :hover property.
*/
.headerlink, .elementid-permalink {
visibility: hidden;
}
h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
<p><a href="/news.html">News</a> <br />
<a href="/license.html">License</a> <br />
<a href="/downloads.cgi">Downloads</a> <br />
<a href="/documentation.html">Documentation</a> <br />
<a href="/documentation/community/project-info.html">Project Info</a> <br />
<a href="/documentation/community/contributing.html">Contributing</a> <br />
<a href="/sitemap.html">Site Map</a> <br />
<a href="https://www.apache.org/">ASF</a> <br />
<a href="https://www.apache.org/security/">Security</a> <br />
<a href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a> <br />
<a href="https://www.apache.org/foundation/thanks.html">Sponsors</a> </p>
<iframe
src="https://www.apache.org/ads/button.html"
style="border-width:0; float: left"
frameborder="0"
scrolling="no"
width="135"
height="135">
</iframe>
</div>
<div class="main">
<div class="breadcrump" style="font-size: 80%;">
<a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-upnp.html">Apache Felix UPnP</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-upnp/upnp-testing-devices.html">UPnP Testing Devices</a>
</div>
<h1>UPnP Examples</h1>
<style type="text/css">
/* The following code is added by mdx_elementid.py
It was originally lifted from http://subversion.apache.org/style/site.css */
/*
* Hide class="elementid-permalink", except when an enclosing heading
* has the :hover property.
*/
.headerlink, .elementid-permalink {
visibility: hidden;
}
h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
<h1 id="the-felix-upnp-examples">The Felix UPnP Examples<a class="headerlink" href="#the-felix-upnp-examples" title="Permanent link">&para;</a></h1>
<p>The UPnP examples released by the UPnP project are simple UPnP devices developed as a proof of concept. The first two examples, the TV and Clock, are used to check the importing and exporting capabilities of the base driver. The third one, the Binary Light, implements a standard UPnP DCP and provides additionally a UPnP presentation page.</p>
<h2 id="sample-tv-and-clock">Sample TV and Clock<a class="headerlink" href="#sample-tv-and-clock" title="Permanent link">&para;</a></h2>
<p>These devices are dual version of the sample devices developed by the project "Cyberlink for Java" by Satoshi Konno. They have been rewritten according to the OSGi specification and can be used to check the importing and exporting capabilities of the base driver. The simulated TV screen is used to show the messages received by the Clock device and other simulated device like the Air Conditionator and Washing Machine. When launching the original version of such devices you will see that the Felix TV running on the OSGi platform is able to receive the messages from UPnP devices running on different platform and imported in OSGi. At the same time, the Cyberlink TV is able to receive the time event generated by the Felix Clock device and exported by the base driver.
| !FelixUPnPTV.jpg! | !FelixClock.jpg! |
| <em>Figure 7</em> The Felix UPnP TV GUI | <em>Figure 8</em> The Felix UPnP Clock GUI |
If you want to avoid installing the Cyberlink devices, you can run a second instance of Felix by clicking on the batch file again. In this case the Felix TV and Clock will be exported and re-imported by both Felix runtimes and you will see a duplicated TV and Clock device on each platform. Notice that you can stop in any moment a device by closing its window. You can start it again from the Felix shell by selecting the respective bundle ID. Starting with two running instances of the Felix Clock, you can stop the first one and the TVs will lose for a moment the time signal. In fact, being subscribed to the Clock device type and not to a specific device instance, they will receive the time event from the remaining device Clock. One TV will be notified from the clock running on the same platform, while the other will receive the events from an imported TV device. As soon as you stop also the second clock device, the Time message will disappear from both the TVs.</p>
<h2 id="the-binarylight-example">The BinaryLight example<a class="headerlink" href="#the-binarylight-example" title="Permanent link">&para;</a></h2>
<p>The Binary Light device, according the UPnP DCP, shows a graphical interface you can use to switch on/off the light and to simulate the breaking of the lamp bulb. In this last circumstance you can see, by using the Felix UPnPDevice Tester interface, that the values of the "Status" and "Target" variable may be different. While the "Target" variable represents the expected status after invoking the related action, the "Status" variable describes the real status of the Light Device.
This example, by exploiting the Felix HTTP Service implementation, installs a UPnP presentation page. By code you can retrieve the presentation page URL by looking for the service property called "UPnP.presentationURL". This property is also visible, as link, through the interface provided by the Tester bundle. Accessing the presentation page by means of a web browser you can switch the light status by clicking on the Light image: the icon on the device windows changes accordingly.
| !FelixLight.jpg! | !FelixLightBroken.jpg! | !LightPresentationPage.jpg! |
<em>Figure 9</em> The BinaryLight GUI and the presentation page</p>
<p>The source code for the Binary light is slightly different from the one for TV and Clock code because it has been written starting from a Light model which notifies its changes through the PropertyChangeListener interface. </p>
<h5 id="testing-upnp-devices-writing-upnp-devices-and-control-points-upnp-writing-cd-and-cp"><a href="/documentation/subprojects/apache-felix-upnp/upnp-testing-devices.html">Testing UPnP Devices</a> &lt;&lt; \| &gt;&gt; [Writing UPnP Devices and Control Points| UPnP Writing CD and CP]<a class="headerlink" href="#testing-upnp-devices-writing-upnp-devices-and-control-points-upnp-writing-cd-and-cp" title="Permanent link">&para;</a></h5>
<div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
Rev. 1700393 by cziegeler on Tue, 1 Sep 2015 06:04:06 +0000
</div>
<div class="trademarkFooter">
Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project
logo are trademarks of The Apache Software Foundation. All other marks mentioned
may be trademarks or registered trademarks of their respective owners.
</div>
</div>
</body>
</html>