com.sun.spot.util
Class BootloaderListener
java.lang.Object
java.lang.Thread
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
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 |
BootloaderListener
public BootloaderListener()
BootloaderListener
public BootloaderListener(IBootloaderListenerCallback callback)
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()
Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.