SunSPOT API V3.0


com.sun.spot.util
Class BootloaderListener

java.lang.Object
  extended by java.lang.Thread
      extended by com.sun.spot.util.BootloaderListener
All Implemented Interfaces:
Runnable

public class BootloaderListener
extends Thread

Simple class to listen to the serial input over the USB connection and pass control to the bootloader. Means you do not have to push the reset button on the SPOT when downloading new code. To use (simplest way): new BootloaderListener().start(); the BootloaderListener will exit the VM when a bootloader command is detected. If you want to take your own action: new BootloaderListener(myCallbackObject).start(); where myCallbackObject implements IBootloaderListenerCallback. You can cancel the bootloader listener by calling cancel()

Author:
Ron Goldman / Syntropy

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
BootloaderListener()
           
BootloaderListener(IBootloaderListenerCallback callback)
           
 
Method Summary
 void cancel()
          Cleanup after ourself and stop running.
 void run()
          Loop reading characters sent over USB connection and dispatch to bootloader when requested.
 
Methods inherited from class java.lang.Thread
activeCount, currentThread, getName, getPriority, interrupt, isAlive, join, setPriority, sleep, start, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BootloaderListener

public BootloaderListener()

BootloaderListener

public BootloaderListener(IBootloaderListenerCallback callback)
Method Detail

cancel

public void cancel()
Cleanup after ourself and stop running.


run

public void run()
Loop reading characters sent over USB connection and dispatch to bootloader when requested.

Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Thread.start(), Runnable.run()

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.