Author: donsez
Date: Fri Oct 19 13:45:58 2007
New Revision: 586602

URL: http://svn.apache.org/viewvc?rev=586602&view=rev
Log:
change package names to include "sandbox"
add more subcommands (sleep,wakeup,whoiam,...)

Added:
    felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/
    felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/
      - copied from r586400, 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/bunny/
Removed:
    felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/bunny/
Modified:
    felix/sandbox/donsez/bunny/pom.xml
    
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/activator/Activator.java
    
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyCommand.java
    
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyServiceActivator.java
    
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyServiceModelImpl.java
    
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/model/BunnyServiceModel.java
    felix/sandbox/donsez/bunny/src/site/script.txt

Modified: felix/sandbox/donsez/bunny/pom.xml
URL: 
http://svn.apache.org/viewvc/felix/sandbox/donsez/bunny/pom.xml?rev=586602&r1=586601&r2=586602&view=diff
==============================================================================
--- felix/sandbox/donsez/bunny/pom.xml (original)
+++ felix/sandbox/donsez/bunny/pom.xml Fri Oct 19 13:45:58 2007
@@ -26,7 +26,7 @@
   <modelVersion>4.0.0</modelVersion>
   <packaging>bundle</packaging>
   <name>Bunny Service</name>
-  <artifactId>org.apache.felix.bunny</artifactId>
+  <artifactId>org.apache.felix.sandbox.bunny</artifactId>
   <groupId>org.apache.felix.sandbox</groupId>
   <version>0.1.0</version>
   <description>${description}</description>

Modified: 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/activator/Activator.java
URL: 
http://svn.apache.org/viewvc/felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/activator/Activator.java?rev=586602&r1=586400&r2=586602&view=diff
==============================================================================
--- 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/activator/Activator.java
 (original)
+++ 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/activator/Activator.java
 Fri Oct 19 13:45:58 2007
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bunny.activator;
+package org.apache.felix.sandbox.bunny.activator;
 
-import org.apache.felix.bunny.impl.BunnyCommand;
-import org.apache.felix.bunny.impl.BunnyServiceActivator;
+import org.apache.felix.sandbox.bunny.impl.BunnyCommand;
+import org.apache.felix.sandbox.bunny.impl.BunnyServiceActivator;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 

Modified: 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyCommand.java
URL: 
http://svn.apache.org/viewvc/felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyCommand.java?rev=586602&r1=586400&r2=586602&view=diff
==============================================================================
--- 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyCommand.java
 (original)
+++ 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyCommand.java
 Fri Oct 19 13:45:58 2007
@@ -16,12 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bunny.impl;
+package org.apache.felix.sandbox.bunny.impl;
 
 import java.io.PrintStream;
 import java.util.StringTokenizer;
 
-import org.apache.felix.bunny.model.BunnyServiceModel;
+import org.apache.felix.sandbox.bunny.model.BunnyServiceModel;
 import org.apache.felix.shell.Command;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
@@ -91,6 +91,21 @@
                        String encodedExtraURLParameters=st.nextToken();
                        bunnyServiceModel.sendRawURL(encodedExtraURLParameters);
 
+               } else if("issleeping".equals(subcommand) && n==0){
+                       bunnyServiceModel.sendRawURL("action=7");
+
+               } else if("sleep".equals(subcommand) && n==0){
+                       bunnyServiceModel.sendRawURL("action=13");
+
+               } else if("wakeup".equals(subcommand) && n==0){
+                       bunnyServiceModel.sendRawURL("action=14");
+
+               } else if("whoiam".equals(subcommand) && n==0){
+                       bunnyServiceModel.sendRawURL("action=10");
+                       bunnyServiceModel.sendRawURL("action=8");
+                       bunnyServiceModel.sendRawURL("action=4");
+                       bunnyServiceModel.sendRawURL("action=5");
+
                } else if("play".equals(subcommand) && n>1){
                        long newLeftEarPosition=Long.parseLong(st.nextToken());
                        long newRightEarPosition=Long.parseLong(st.nextToken());
@@ -125,7 +140,7 @@
         * @see org.apache.felix.shell.Command#getUsage()
         */
        public String getUsage() {
-               return  getName() + " [help|config|play|voice|ears|trace]";
+               return  getName() + " [help]";
        }       
 
        /**
@@ -137,6 +152,10 @@
                +"\n"+  getName() + " voice <voice>: set the default voice (eg 
julie22k,claire22s,caroline22k,bruno22k,graham22s,lucy22s,heather22k,ryan22k,aaron22s,laura22s)"
                +"\n"+  getName() + " ears : get ears positions"
                +"\n"+  getName() + " raw <url encoded params>: send the URL 
with raw encoded parameters"
+               +"\n"+  getName() + " sleep : sleep the bunny"
+               +"\n"+  getName() + " wakeup : wakeup the bunny"
+               +"\n"+  getName() + " issleeping : get the status of the bunny"
+               +"\n"+  getName() + " whoiam : get the name of the bunny"
                +"\n"+  getName() + " trace <on|off> : set on|off the trace"
                ;
        }       

Modified: 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyServiceActivator.java
URL: 
http://svn.apache.org/viewvc/felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyServiceActivator.java?rev=586602&r1=586400&r2=586602&view=diff
==============================================================================
--- 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyServiceActivator.java
 (original)
+++ 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyServiceActivator.java
 Fri Oct 19 13:45:58 2007
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bunny.impl;
+package org.apache.felix.sandbox.bunny.impl;
 
-import org.apache.felix.bunny.model.BunnyServiceModel;
+import org.apache.felix.sandbox.bunny.model.BunnyServiceModel;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 

Modified: 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyServiceModelImpl.java
URL: 
http://svn.apache.org/viewvc/felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyServiceModelImpl.java?rev=586602&r1=586400&r2=586602&view=diff
==============================================================================
--- 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyServiceModelImpl.java
 (original)
+++ 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/impl/BunnyServiceModelImpl.java
 Fri Oct 19 13:45:58 2007
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bunny.impl;
+package org.apache.felix.sandbox.bunny.impl;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -28,12 +28,7 @@
 import java.net.URLEncoder;
 import java.text.MessageFormat;
 
-import org.apache.felix.bunny.model.BunnyServiceModel;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-
-import quicktime.std.clocks.ExtremesCallBack;
+import org.apache.felix.sandbox.bunny.model.BunnyServiceModel;
 
 /**
  * this class provides implementation of a bunny service.

Modified: 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/model/BunnyServiceModel.java
URL: 
http://svn.apache.org/viewvc/felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/model/BunnyServiceModel.java?rev=586602&r1=586400&r2=586602&view=diff
==============================================================================
--- 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/model/BunnyServiceModel.java
 (original)
+++ 
felix/sandbox/donsez/bunny/src/main/java/org/apache/felix/sandbox/bunny/model/BunnyServiceModel.java
 Fri Oct 19 13:45:58 2007
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bunny.model;
+package org.apache.felix.sandbox.bunny.model;
 
 /**
  * this interface defines a bunny service.

Modified: felix/sandbox/donsez/bunny/src/site/script.txt
URL: 
http://svn.apache.org/viewvc/felix/sandbox/donsez/bunny/src/site/script.txt?rev=586602&r1=586601&r2=586602&view=diff
==============================================================================
--- felix/sandbox/donsez/bunny/src/site/script.txt (original)
+++ felix/sandbox/donsez/bunny/src/site/script.txt Fri Oct 19 13:45:58 2007
@@ -1,5 +1,15 @@
 
+bunny
+
+# configure the serial number and the token of your Nabaztag
+bunny config 00049DA1FBB71F 1163690075
+
 bunny trace on
+
+bunny issleeping
+bunny wakeup 
+bunny issleeping 
+
 bunny voice bruno22k
 bunny play 1 16 salut+didier
 
@@ -15,6 +25,9 @@
 # Bunny 
Request:http://api.nabaztag.com/vl/FR/api.jsp?key=0&sn=00904BBDA71F&token=1163675935&ears=ok
 # Bunny Reply (length=unknown):<?xml version="1.0" 
encoding="UTF-8"?><rsp><message>POSITIONEAR</message><leftposition>1</leftposition><rightposition>16</rightposition></rsp>
 
+bunny whoiam
+
+bunny issleeping 
 
 # send actions with the raw sub-command
 bunny raw action=2


Reply via email to