uwcse.location.objects.mote
Class MoteSerialReadWrite

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--uwcse.location.objects.mote.MoteSerialReadWrite
All Implemented Interfaces:
EventListener, Runnable, javax.comm.SerialPortEventListener

public class MoteSerialReadWrite
extends Thread
implements javax.comm.SerialPortEventListener

A thread to read and write location system packets form a serial port connected to a Berkeley mote.

Version:
$Revision: 1.2 $
Author:
Eugene Shih Date: $Date: 2004/02/09 23:47:06 $
See Also:
MoteDriver

Nested Class Summary
 class MoteSerialReadWrite.basePacket
           
 class MoteSerialReadWrite.beacon_packet
           
 class MoteSerialReadWrite.bs_reply
           
 class MoteSerialReadWrite.header
          PACKET INFORMATION AND TYPES *
 class MoteSerialReadWrite.SynchronizedString
          Synchronized String *
 class MoteSerialReadWrite.test_route_packet
           
 class MoteSerialReadWrite.topo_packet
           
 
Field Summary
static int BASE_ID
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MoteSerialReadWrite(String portName, String programName, MoteDriver.SynchronizedQueue inQ)
           
 
Method Summary
 int calcrc(byte[] packet, int count)
           
 void closePort()
          Close serial port
 void finalize()
           
 void open(String portName)
          Open specified serial port
 void printAllPorts()
           
 void run()
           
 void send_data(MoteSerialReadWrite.topo_packet tp)
           
 void serialEvent(javax.comm.SerialPortEvent event)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BASE_ID

public static int BASE_ID
Constructor Detail

MoteSerialReadWrite

public MoteSerialReadWrite(String portName,
                           String programName,
                           MoteDriver.SynchronizedQueue inQ)
Method Detail

finalize

public void finalize()
Overrides:
finalize in class Object

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

printAllPorts

public void printAllPorts()

send_data

public void send_data(MoteSerialReadWrite.topo_packet tp)

calcrc

public int calcrc(byte[] packet,
                  int count)

open

public void open(String portName)
          throws javax.comm.NoSuchPortException,
                 javax.comm.PortInUseException,
                 IOException,
                 javax.comm.UnsupportedCommOperationException,
                 TooManyListenersException
Open specified serial port

Throws:
javax.comm.NoSuchPortException
javax.comm.PortInUseException
IOException
javax.comm.UnsupportedCommOperationException
TooManyListenersException

closePort

public void closePort()
Close serial port


serialEvent

public void serialEvent(javax.comm.SerialPortEvent event)
Specified by:
serialEvent in interface javax.comm.SerialPortEventListener


This documentation is for the Location Stack v0.8. The latest distribution, the documentation, and the list of contributors to the Location Stack can always be found at http://portolano.cs.washington.edu/projects/location/

© Copyright 2004 University of Washington CSE