public class SerialDataMonitorThread extends Thread
This implementation class implements the 'Serial' monitoring thread to poll the serial received buffer and notify registered event listeners when data is available.
Before using the Pi4J library, you need to ensure that the Java VM in configured with access to the following system libraries:
This library depends on the wiringPi native system library. (developed by Gordon Henderson @ http://wiringpi.com/)
Serial
,
SerialDataEvent
,
SerialDataListener
,
SerialFactory
,
http://www.pi4j.com/Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
SerialDataMonitorThread(Serial serial,
CopyOnWriteArrayList<SerialDataListener> listeners)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
run()
This method is called when this monitoring thread starts
|
void |
shutdown()
Exit the monitoring thread.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public SerialDataMonitorThread(Serial serial, CopyOnWriteArrayList<SerialDataListener> listeners)
Default constructor
NOTE: This class is used internal to the Pi4J library by the SerialImpl class.
serial
- A class that implements the 'Serial' interface.listeners
- A collection of class instances that implement the SerialListener interface.Copyright © 2012–2019 Pi4J. All rights reserved.