You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by do...@apache.org on 2010/07/11 17:06:31 UTC
svn commit: r963093 - in /felix/sandbox/donsez/upnp.devicegen: ./
generation/ generation/res/ generation/res/device/ generation/res/service/
src/main/java/org/apache/felix/upnp/devicegen/activator/impl/
src/main/resources/icon/
Author: donsez
Date: Sun Jul 11 15:06:31 2010
New Revision: 963093
URL: http://svn.apache.org/viewvc?rev=963093&view=rev
Log:
add new sdcp for the UPnP LowPower specification
Added:
felix/sandbox/donsez/upnp.devicegen/generation/res/device/LowPowerDeviceTest1.xml
felix/sandbox/donsez/upnp.devicegen/generation/res/project.LowPowerDeviceTest1.properties
felix/sandbox/donsez/upnp.devicegen/generation/res/service/LowPowerDevice1.xml
felix/sandbox/donsez/upnp.devicegen/generation/res/service/LowPowerProxy1.xml
felix/sandbox/donsez/upnp.devicegen/src/main/resources/icon/power.png (with props)
Modified:
felix/sandbox/donsez/upnp.devicegen/generation/build.device.xml
felix/sandbox/donsez/upnp.devicegen/generation/build.xml
felix/sandbox/donsez/upnp.devicegen/generation/device2build.xsl
felix/sandbox/donsez/upnp.devicegen/generation/res/service/BunnyService1.xml
felix/sandbox/donsez/upnp.devicegen/pom.xml
felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/activator/impl/Activator.java
Modified: felix/sandbox/donsez/upnp.devicegen/generation/build.device.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.devicegen/generation/build.device.xml?rev=963093&r1=963092&r2=963093&view=diff
==============================================================================
--- felix/sandbox/donsez/upnp.devicegen/generation/build.device.xml (original)
+++ felix/sandbox/donsez/upnp.devicegen/generation/build.device.xml Sun Jul 11 15:06:31 2010
@@ -28,7 +28,7 @@
<target name="main" depends="init, generate.class"></target>
<target name="init">
- <mkdir dir="generated"/>
+ <mkdir dir="${generation.dir}"/>
<tstamp>
<format property="date" pattern="d-MMMM-yyyy" locale="en"/>
</tstamp>
@@ -43,9 +43,9 @@
<echo>Generation of ${device.name} ...</echo>
- <delete file="generated/build.sources.xml"/>
+ <delete file="${generation.dir}/build.sources.xml"/>
- <xslt in="${device.description.xml.file}" out="generated/build.sources.xml" style="device2build.xsl"
+ <xslt in="${device.description.xml.file}" out="${generation.dir}/build.sources.xml" style="device2build.xsl"
classpath="." >
<param name="date" expression="${date}"/>
<param name="author" expression="${author}"/>
@@ -56,22 +56,23 @@
<outputproperty name="indent" value="yes"/>
</xslt>
- <ant antfile="generated/build.sources.xml" dir="."/>
+ <ant antfile="${generation.dir}/build.sources.xml" dir="."/>
<echo>Generation of ${device.name} Completed</echo>
<copy todir="../src/main/resources">
- <fileset dir="generated/res"/>
+ <fileset dir="${generation.dir}/res"/>
</copy>
<copy todir="../src/main/java">
- <fileset dir="generated/src"/>
+ <fileset dir="${generation.dir}/src"/>
</copy>
+<!--
<copy todir="../manifest">
- <fileset dir="generated/manifest"/>
+ <fileset dir="${generation.dir}/manifest"/>
</copy>
-
+-->
</target>
<!-- clean generated files and backup files -->
Modified: felix/sandbox/donsez/upnp.devicegen/generation/build.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.devicegen/generation/build.xml?rev=963093&r1=963092&r2=963093&view=diff
==============================================================================
--- felix/sandbox/donsez/upnp.devicegen/generation/build.xml (original)
+++ felix/sandbox/donsez/upnp.devicegen/generation/build.xml Sun Jul 11 15:06:31 2010
@@ -24,6 +24,8 @@
<project name="OSGi UPnP Device Driver Source Generation" default="main" basedir=".">
+ <property name="generation.dir" value="../target/generated"/>
+
<target name="main" depends="init, compile.xalan.utilclasses, generate.class">
</target>
@@ -46,7 +48,7 @@ set CLASSPATH=%XALAN_HOME%\xalan.jar;%XA
</echo>
- <mkdir dir="generated"/>
+ <!-- <mkdir dir="generated"/> -->
</target>
<target name="generate.class">
@@ -63,6 +65,9 @@ set CLASSPATH=%XALAN_HOME%\xalan.jar;%XA
<!-- Devices defined by the UPnP Forum -->
<ant antfile="build.device.xml" target="generate.class" inheritall="true">
+ <property name="properties" value="res/project.LowPowerDeviceTest1.properties" />
+ </ant>
+ <ant antfile="build.device.xml" target="generate.class" inheritall="true">
<property name="properties" value="res/project.PositionDevice1.properties" />
</ant>
<ant antfile="build.device.xml" target="generate.class" inheritall="true">
@@ -141,7 +146,7 @@ set CLASSPATH=%XALAN_HOME%\xalan.jar;%XA
</target>
<target name="clean">
- <delete dir="generated"/>
+ <delete dir="${generation.dir}"/>
</target>
</project>
Modified: felix/sandbox/donsez/upnp.devicegen/generation/device2build.xsl
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.devicegen/generation/device2build.xsl?rev=963093&r1=963092&r2=963093&view=diff
==============================================================================
--- felix/sandbox/donsez/upnp.devicegen/generation/device2build.xsl (original)
+++ felix/sandbox/donsez/upnp.devicegen/generation/device2build.xsl Sun Jul 11 15:06:31 2010
@@ -51,7 +51,7 @@
<tstamp>
<format property="date" pattern="d-MMMM-yyyy hh:mm aa" locale="en"/>
</tstamp>
- <property name="generation.dir" value="generated"/>
+ <property name="generation.dir" value="../target/generated"/>
<property name="author" value="{$author}"/>
</target>
@@ -59,7 +59,7 @@
<!-- clean generated files and backup files -->
<target name="clean">
- <delete dir="generated"/>
+ <delete dir="${{generation.dir}}"/>
</target>
</project>
@@ -78,13 +78,14 @@
<target name="generate">
<mkdir dir="${{generation.dir}}/res"/>
- <mkdir dir="${{generation.dir}}/manifest"/>
+ <!-- <mkdir dir="${{generation.dir}}/manifest"/> -->
<mkdir dir="${{generation.dir}}/src/{$path}"/>
<mkdir dir="${{generation.dir}}/src/{$path}/device"/>
<mkdir dir="${{generation.dir}}/src/{$path}/service"/>
<mkdir dir="${{generation.dir}}/src/{$path}/impl"/>
<mkdir dir="${{generation.dir}}/src/{$path}/model"/>
<mkdir dir="${{generation.dir}}/src/{$path}/controlpoint"/>
+ <mkdir dir="${{generation.dir}}/src/{$path}/widget"/>
<xslt in="{$descriptionfilename}"
out="${{generation.dir}}/src/{$path}/device/{$classname}.java"
Added: felix/sandbox/donsez/upnp.devicegen/generation/res/device/LowPowerDeviceTest1.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.devicegen/generation/res/device/LowPowerDeviceTest1.xml?rev=963093&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.devicegen/generation/res/device/LowPowerDeviceTest1.xml (added)
+++ felix/sandbox/donsez/upnp.devicegen/generation/res/device/LowPowerDeviceTest1.xml Sun Jul 11 15:06:31 2010
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<root>
+ <!-- Cut and paste from BinaryLight1.pdf -->
+ <specVersion>
+ <major>1</major>
+ <minor>0</minor>
+ </specVersion>
+ <URLBase>http://www.apache.org/~donsez/dev/osgi/upnp.devicegen</URLBase>
+ <device>
+ <deviceType>urn:schemas-upnp-org:device:LowPower:1</deviceType>
+ <friendlyName>Generated LowPower Device and Proxy UPnP Device</friendlyName>
+ <manufacturer>Felix team</manufacturer>
+ <manufacturerURL>http://www.apache.org/~donsez</manufacturerURL>
+ <modelDescription>Generated LowPower Device and Proxy UPnP Device</modelDescription>
+ <modelName>LowPower Device and Proxy</modelName>
+ <modelNumber>123</modelNumber>
+ <modelURL>http://www.apache.org/~donsez/dev/osgi/upnp.devicegen/readme.html</modelURL>
+ <serialNumber>123456789</serialNumber>
+ <UDN>uuid:felix-lowpower</UDN>
+ <UPC>upc:felix-lowpower</UPC>
+ <iconList>
+ <icon>
+ <mimetype>image/png</mimetype>
+ <width>48</width>
+ <height>48</height>
+ <depth>16</depth>
+ <url>/icon/power.png</url>
+ </icon>
+ </iconList>
+ <serviceList>
+ <service>
+ <serviceType>urn:schemas-upnp-org:service:LowPowerDevice:1</serviceType>
+ <serviceId>urn:upnp-org:serviceId:LowPowerDevice:1</serviceId>
+ <SCPDURL>URL to service description</SCPDURL>
+ <controlURL>URL for control</controlURL>
+ <eventSubURL>URL for eventing</eventSubURL>
+ </service>
+ <service>
+ <serviceType>urn:schemas-upnp-org:service:LowPowerProxy:1</serviceType>
+ <serviceId>urn:upnp-org:serviceId:LowPowerProxy:1</serviceId>
+ <SCPDURL>URL to service description</SCPDURL>
+ <controlURL>URL for control</controlURL>
+ <eventSubURL>URL for eventing</eventSubURL>
+ </service>
+ <!--Declarations for other services added by UPnP vendor (if
+ any) go here-->
+ </serviceList>
+ <deviceList>
+ <!-- Description of embedded devices added by UPnP vendor (if any) go here -->
+ </deviceList>
+ <presentationURL>http://www.apache.org/~donsez/dev/osgi/upnp.devicegen/readme.html</presentationURL>
+ </device>
+</root>
\ No newline at end of file
Added: felix/sandbox/donsez/upnp.devicegen/generation/res/project.LowPowerDeviceTest1.properties
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.devicegen/generation/res/project.LowPowerDeviceTest1.properties?rev=963093&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.devicegen/generation/res/project.LowPowerDeviceTest1.properties (added)
+++ felix/sandbox/donsez/upnp.devicegen/generation/res/project.LowPowerDeviceTest1.properties Sun Jul 11 15:06:31 2010
@@ -0,0 +1,8 @@
+# properties for the generation of
+# BinaryLight (V1) UPnP (V1) device and associated services classes
+#
+# ant -f build.device.xml -Dproperties=project.BinaryLight1.properties
+
+device.description.xml.file=res/device/LowPowerDeviceTest1.xml
+package=org.apache.felix.upnp.devicegen.lowpower
+device.name=LowPowerDeviceTest
Modified: felix/sandbox/donsez/upnp.devicegen/generation/res/service/BunnyService1.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.devicegen/generation/res/service/BunnyService1.xml?rev=963093&r1=963092&r2=963093&view=diff
==============================================================================
--- felix/sandbox/donsez/upnp.devicegen/generation/res/service/BunnyService1.xml (original)
+++ felix/sandbox/donsez/upnp.devicegen/generation/res/service/BunnyService1.xml Sun Jul 11 15:06:31 2010
@@ -88,7 +88,7 @@
<argument>
<name>NewRightEarPosition</name>
<direction>in</direction>
- <relatedStateVariable>LeftEarPosition</relatedStateVariable>
+ <relatedStateVariable>RightEarPosition</relatedStateVariable>
</argument>
<argument>
<name>TextToSpeech</name>
Added: felix/sandbox/donsez/upnp.devicegen/generation/res/service/LowPowerDevice1.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.devicegen/generation/res/service/LowPowerDevice1.xml?rev=963093&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.devicegen/generation/res/service/LowPowerDevice1.xml (added)
+++ felix/sandbox/donsez/upnp.devicegen/generation/res/service/LowPowerDevice1.xml Sun Jul 11 15:06:31 2010
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+<scpd xmlns="urn:schemas-upnp-org:service-1-0">
+ -->
+ <scpd>
+ <specVersion>
+ <major>1</major>
+ <minor>0</minor>
+ </specVersion>
+ <actionList>
+ <action>
+ <name>GetPowerManagementInfo</name>
+ <argumentList>
+ <argument>
+ <name>WakeupMethod</name>
+ <direction>out</direction>
+ <relatedStateVariable>WakeupMethod</relatedStateVariable>
+ </argument>
+ <argument>
+ <name>PowerSupplyStatus</name>
+ <direction>out</direction>
+ <relatedStateVariable>PowerSupplyStatus</relatedStateVariable>
+ </argument>
+ </argumentList>
+ </action>
+ <action>
+ <name>GoToSleep</name>
+ <argumentList>
+ <argument>
+ <name>RecommendedSleepPeriod</name>
+ <direction>in</direction>
+ <relatedStateVariable>SleepPeriod</relatedStateVariable>
+ </argument>
+ <argument>
+ <name>RecommendedPowerState</name>
+ <direction>in</direction>
+ <relatedStateVariable>PowerState</relatedStateVariable>
+ </argument>
+ <argument>
+ <name>SleepPeriod</name>
+ <direction>out</direction>
+ <relatedStateVariable>SleepPeriod</relatedStateVariable>
+ </argument>
+ <argument>
+ <name>PowerState</name>
+ <direction>out</direction>
+ <relatedStateVariable>PowerState</relatedStateVariable>
+ </argument>
+ </argumentList>
+ </action>
+ <action>
+ <name>Wakeup</name>
+ </action>
+ </actionList>
+ <serviceStateTable>
+ <stateVariable>
+ <name>ExternalPowerSupplySource</name>
+ <sendEventsAttribute>yes</sendEventsAttribute>
+ <dataType>i4</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>BatteryLow</name>
+ <sendEventsAttribute>yes</sendEventsAttribute>
+ <dataType>boolean</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>PowerSupplyStatus</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>string</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>SleepPeriod</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>i4</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>PowerState</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>string</dataType>
+ <AllowedValueList>
+ <AllowedValue>0</AllowedValue>
+ <AllowedValue>1</AllowedValue>
+ <AllowedValue>2</AllowedValue>
+ <AllowedValue>4</AllowedValue>
+ </AllowedValueList>
+ </stateVariable>
+ <stateVariable>
+ <name>WakeupMethod</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>string</dataType>
+ </stateVariable>
+ </serviceStateTable>
+</scpd>
\ No newline at end of file
Added: felix/sandbox/donsez/upnp.devicegen/generation/res/service/LowPowerProxy1.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.devicegen/generation/res/service/LowPowerProxy1.xml?rev=963093&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.devicegen/generation/res/service/LowPowerProxy1.xml (added)
+++ felix/sandbox/donsez/upnp.devicegen/generation/res/service/LowPowerProxy1.xml Sun Jul 11 15:06:31 2010
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<scpd>
+ <specVersion>
+ <major>1</major>
+ <minor>0</minor>
+ </specVersion>
+ <actionList>
+ <action>
+ <name>SearchSleepingDevices</name>
+ <argumentList>
+ <argument>
+ <name>SearchCriteria</name>
+ <direction>in</direction>
+ <relatedStateVariable>A_ARG_TYPE_SearchCriteria</relatedStateVariable>
+ </argument>
+ <argument>
+ <name>PowerState</name>
+ <direction>in</direction>
+ <relatedStateVariable>A_ARG_TYPE_PowerState</relatedStateVariable>
+ </argument>
+ <argument>
+ <name>DeviceList</name>
+ <direction>out</direction>
+ <relatedStateVariable>DeviceListInfo</relatedStateVariable>
+ </argument>
+ </argumentList>
+ </action>
+ <action>
+ <name>WakeupDevice</name>
+ <argumentList>
+ <argument>
+ <name>Uuid</name>
+ <direction>in</direction>
+ <relatedStateVariable>A_ARG_TYPE_UUID</relatedStateVariable>
+ </argument>
+ <argument>
+ <name>Success</name>
+ <direction>out</direction>
+ <relatedStateVariable>A_ARG_TYPE_Success</relatedStateVariable>
+ </argument>
+ </argumentList>
+ </action>
+ </actionList>
+ <serviceStateTable>
+ <stateVariable>
+ <name>DeviceListInfo</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>string</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>A_ARG_TYPE_PowerState</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>i4</dataType>
+ <allowedValueRange>
+ <minimum>1</minimum>
+ <maximum>7</maximum>
+ </allowedValueRange>
+ </stateVariable>
+ <stateVariable>
+ <name>A_ARG_TYPE_Success</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>boolean</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>A_ARG_TYPE_SearchCriteria</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>string</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>A_ARG_TYPE_UUID</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>string</dataType>
+ </stateVariable>
+ </serviceStateTable>
+</scpd>
\ No newline at end of file
Modified: felix/sandbox/donsez/upnp.devicegen/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.devicegen/pom.xml?rev=963093&r1=963092&r2=963093&view=diff
==============================================================================
--- felix/sandbox/donsez/upnp.devicegen/pom.xml (original)
+++ felix/sandbox/donsez/upnp.devicegen/pom.xml Sun Jul 11 15:06:31 2010
@@ -23,31 +23,28 @@
<description>generates and packages UPnPDevice services following the OSGi UPnP Device Driver.</description>
</properties>
- <parent>
- <groupId>org.apache.felix</groupId>
- <artifactId>felix</artifactId>
- <version>0.9.0-incubator-SNAPSHOT</version>
- </parent>
<modelVersion>4.0.0</modelVersion>
<packaging>bundle</packaging>
<name>Apache Felix UPnP Device Generator</name>
<artifactId>org.apache.felix.upnp.devicegen</artifactId>
+ <groupId>org.apache.felix.sandbox</groupId>
+ <version>0.1.0</version>
<description>${description}</description>
<dependencies>
<dependency>
- <groupId>${pom.groupId}</groupId>
+ <groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
- <version>${pom.version}</version>
+ <version>1.4.0</version>
</dependency>
<dependency>
- <groupId>${pom.groupId}</groupId>
+ <groupId>org.apache.felix</groupId>
<artifactId>org.osgi.compendium</artifactId>
- <version>${pom.version}</version>
+ <version>1.4.0</version>
</dependency>
<dependency>
- <groupId>${pom.groupId}</groupId>
+ <groupId>org.apache.felix.sandbox</groupId>
<artifactId>org.apache.felix.upnp.devicegen.util</artifactId>
- <version>${pom.version}</version>
+ <version>0.1.0</version>
</dependency>
</dependencies>
<build>
Modified: felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/activator/impl/Activator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/activator/impl/Activator.java?rev=963093&r1=963092&r2=963093&view=diff
==============================================================================
--- felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/activator/impl/Activator.java (original)
+++ felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/activator/impl/Activator.java Sun Jul 11 15:06:31 2010
@@ -7,6 +7,7 @@ import org.apache.felix.upnp.devicegen.h
import org.apache.felix.upnp.devicegen.igd.device.InternetGatewayDevice;
import org.apache.felix.upnp.devicegen.lightingcontrols.device.BinaryLight;
import org.apache.felix.upnp.devicegen.lightingcontrols.device.DimmableLight;
+import org.apache.felix.upnp.devicegen.lowpower.device.LowPowerDeviceTest;
import org.apache.felix.upnp.devicegen.media.device.MediaRenderer;
import org.apache.felix.upnp.devicegen.media.device.MediaServer;
import org.apache.felix.upnp.devicegen.ogd.device.OSGiGatewayDevice;
@@ -20,10 +21,11 @@ import org.osgi.framework.BundleContext;
/**
- * @author donsez
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
public class Activator implements BundleActivator {
+ LowPowerDeviceTest lowPowerDeviceTest;
DimmableLight dimmableLightDevice;
BinaryLight binaryLightDevice;
HVAC_System hvacSystemDevice;
@@ -40,6 +42,7 @@ public class Activator implements Bundle
BunnyDevice bunnyDevice;
public void start(BundleContext bundleContext) throws Exception {
+ lowPowerDeviceTest=new LowPowerDeviceTest(bundleContext,null);
binaryLightDevice=new BinaryLight(bundleContext,null);
dimmableLightDevice=new DimmableLight(bundleContext,null);
hvacSystemDevice=new HVAC_System(bundleContext,null);
@@ -56,6 +59,7 @@ public class Activator implements Bundle
bunnyDevice=new BunnyDevice(bundleContext,null);
+ lowPowerDeviceTest.start(bundleContext);
binaryLightDevice.start(bundleContext);
dimmableLightDevice.start(bundleContext);
hvacSystemDevice.start(bundleContext);
@@ -87,5 +91,6 @@ public class Activator implements Bundle
hvacSystemDevice.stop(bundleContext);
dimmableLightDevice.stop(bundleContext);
binaryLightDevice.stop(bundleContext);
+ lowPowerDeviceTest.stop(bundleContext);
}
}
Added: felix/sandbox/donsez/upnp.devicegen/src/main/resources/icon/power.png
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.devicegen/src/main/resources/icon/power.png?rev=963093&view=auto
==============================================================================
Binary file - no diff available.
Propchange: felix/sandbox/donsez/upnp.devicegen/src/main/resources/icon/power.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream