[Tinyos-2-commits] CVS: tinyos-2.x/support/sdk/java/net/tinyos/tools ListenRaw.java, 1.4, 1.5

Janos Sallai sallai at users.sourceforge.net
Fri May 16 12:28:42 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/support/sdk/java/net/tinyos/tools
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20950/tools

Modified Files:
	ListenRaw.java 
Log Message:
added iris as an alias to 57600bps baud rate

Index: ListenRaw.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/support/sdk/java/net/tinyos/tools/ListenRaw.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ListenRaw.java	12 Dec 2006 18:23:00 -0000	1.4
--- ListenRaw.java	16 May 2008 19:28:40 -0000	1.5
***************
*** 2,6 ****
  
  /*									tab:4
!  * "Copyright (c) 2000-2003 The Regents of the University  of California.  
   * All rights reserved.
   *
--- 2,6 ----
  
  /*									tab:4
!  * "Copyright (c) 2000-2003 The Regents of the University  of California.
   * All rights reserved.
   *
***************
*** 9,18 ****
   * hereby granted, provided that the above copyright notice, the following
   * two paragraphs and the author appear in all copies of this software.
!  * 
   * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
   * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
   * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
   * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  * 
   * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
--- 9,18 ----
   * hereby granted, provided that the above copyright notice, the following
   * two paragraphs and the author appear in all copies of this software.
!  *
   * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
   * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
   * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
   * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  *
   * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
***************
*** 24,30 ****
   * All rights reserved.
   *
!  * This file is distributed under the terms in the attached INTEL-LICENSE     
   * file. If you do not find these files, copies can be found by writing to
!  * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, 
   * 94704.  Attention:  Intel License Inquiry.
   */
--- 24,30 ----
   * All rights reserved.
   *
!  * This file is distributed under the terms in the attached INTEL-LICENSE
   * file. If you do not find these files, copies can be found by writing to
!  * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
   * 94704.  Attention:  Intel License Inquiry.
   */
***************
*** 58,61 ****
--- 58,62 ----
      private static final int PORT_SPEED_MICA = 19200;
      private static final int PORT_SPEED_RENE = 19200;
+     private static final int PORT_SPEED_IRIS = 57600;
      private static final int LENGTH_OFFSET = 4;
      private int packetLength;
***************
*** 78,82 ****
  	in = port.getInputStream();
  	out = port.getOutputStream();
! 	
  	//port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
  	// These are the mote UART parameters
--- 79,83 ----
  	in = port.getInputStream();
  	out = port.getOutputStream();
! 
  	//port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
  	// These are the mote UART parameters
***************
*** 85,89 ****
  	System.out.println();
      }
!     
      private void printPortStatus() {
  	System.out.println(" baud rate: " + port.getBaudRate());
--- 86,90 ----
  	System.out.println();
      }
! 
      private void printPortStatus() {
  	System.out.println(" baud rate: " + port.getBaudRate());
***************
*** 94,101 ****
  
      public void read() throws IOException {
! 	int i; 
  	int count = 0;
  	byte[] packet = new byte[MAX_MSG_SIZE];
! 	
  	while ((i = in.read()) != -1) {
  	    if (i == 0x7e) {
--- 95,102 ----
  
      public void read() throws IOException {
! 	int i;
  	int count = 0;
  	byte[] packet = new byte[MAX_MSG_SIZE];
! 
  	while ((i = in.read()) != -1) {
  	    if (i == 0x7e) {
***************
*** 117,120 ****
--- 118,122 ----
  	System.err.println("  -mica:         Mica ("+PORT_SPEED_MICA+" bps)");
  	System.err.println("  -rene:         Rene ("+PORT_SPEED_RENE+" bps)");
+ 	System.err.println("  -iris:         Iris ("+PORT_SPEED_IRIS+" bps) [default]");
  	System.exit(-1);
      }
***************
*** 127,131 ****
  	    printUsage();
  	}
! 	
  	for (int i = 0; i < args.length; i++) {
  	    if (args[i].equals("-h") || args[i].equals("--help")) {
--- 129,133 ----
  	    printUsage();
  	}
! 
  	for (int i = 0; i < args.length; i++) {
  	    if (args[i].equals("-h") || args[i].equals("--help")) {
***************
*** 150,153 ****
--- 152,158 ----
  	        speed = PORT_SPEED_RENE;
  	    }
+ 	    if (args[i].equals("-iris")) {
+ 	        speed = PORT_SPEED_IRIS;
+ 	    }
  	}
  
***************
*** 155,159 ****
  	    return; // No port specified
  	}
! 	
  	ListenRaw reader = new ListenRaw(args[args.length - 1], speed);
  	try {
--- 160,164 ----
  	    return; // No port specified
  	}
! 
  	ListenRaw reader = new ListenRaw(args[args.length - 1], speed);
  	try {
***************
*** 163,167 ****
  	    e.printStackTrace();
  	}
! 	
  	try {
  	    reader.read();
--- 168,172 ----
  	    e.printStackTrace();
  	}
! 
  	try {
  	    reader.read();



More information about the Tinyos-2-commits mailing list