public class VirtualDevice extends Service implements SerialDataListener
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
log |
cfgDir, dnaPool, MESSAGE_RECORDING_FORMAT_BINARY, MESSAGE_RECORDING_FORMAT_XML
Constructor and Description |
---|
VirtualDevice(java.lang.String n) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
SerialDevice |
connectVirtualUart(java.lang.String myPort,
java.lang.String uartPort) |
void |
createVirtualArduino(java.lang.String portName) |
void |
createVirtualSerial(java.lang.String portName) |
SerialDevice |
createVirtualUart() |
Python |
getLogic() |
static ServiceType |
getMetaData()
This static method returns all the details of the class without it having
to be constructed.
|
Message |
getMsg(long timeout) |
java.util.concurrent.BlockingQueue<Message> |
getMsgs() |
Serial |
getUart(java.lang.String portName) |
java.util.HashMap<java.lang.String,Serial> |
getUarts() |
static void |
main(java.lang.String[] args) |
java.lang.Integer |
onByte(java.lang.Integer b) |
void |
onConnect(java.lang.String portName) |
void |
onDisconnect(java.lang.String portName) |
boolean |
preProcessHook(Message msg) |
void |
startService() |
java.util.ArrayList<Message> |
waitForMsgs(int count) |
java.util.ArrayList<Message> |
waitForMsgs(int count,
int timeout) |
java.util.ArrayList<Message> |
waitForMsgs(int count,
int timeout,
int pollInterval) |
addListener, addListener, addTask, addTask, addTask, addTaskOneShot, allowDisplay, allowDisplay, attach, attach, broadcastState, buildDna, buildDna, buildDnaKeys, buildDnaNames, clearLastError, close, containsTask, copyShallowFrom, createPeer, createPeer, createRootReserved, detach, detach, detach, echoHeartbeat, error, error, error, getAttached, getCfgDir, getComm, getDeclaredMethodNames, getDeclaredMethods, getDescription, getDna, getDnaString, getHostName, getInbox, getInstanceId, getIntanceName, getInterfaceSet, getLastError, getMessageSet, getMetaData, getMethodMap, getMethodNames, getMethods, getMethodToolTip, getMsg, getName, getNotifyList, getNotifyListKeySet, getOutbox, getPeerKey, getPeerName, getServiceResourceFile, getSimpleName, getTasks, getThisThread, getType, hasError, hasPeers, help, help, in, info, info, invoke, invoke, invoke, invokeOn, isAttached, isAttached, isLocal, isReady, isRunning, isRuntime, isVirtual, load, load, logTimeEnable, mergeDna, mergeDna, mergePeerDna, movePeerDna, out, out, preRoutingHook, publishError, publishQueueStats, publishState, publishStats, publishStatus, purgeTask, purgeTasks, releasePeers, releaseService, removeAllListeners, removeListener, requiresSecurity, reserve, reserve, reserveRoot, reserveRoot, reserveRootAs, run, save, save, save, send, send, send, send, sendBlocking, sendBlocking, sendBlocking, sendBlocking, sendPeer, setInstanceId, setName, setPeer, setSecurityProvider, setState, setThisThread, setVirtual, sleep, stackToString, startHeartbeat, startPeer, startPeer, startRecording, stopHeartbeat, stopMsgRecording, stopService, subscribe, subscribe, subscribe, toString, unsubscribe, unsubscribe, unsubscribe, updateStats, warn, warn
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
publishStats, updateStats
getName
public void startService()
startService
in interface ServiceInterface
startService
in class Service
public Python getLogic()
public Serial getUart(java.lang.String portName)
public java.util.HashMap<java.lang.String,Serial> getUarts()
public void createVirtualSerial(java.lang.String portName) throws java.io.IOException
java.io.IOException
public void createVirtualArduino(java.lang.String portName) throws java.io.IOException
java.io.IOException
public SerialDevice connectVirtualUart(java.lang.String myPort, java.lang.String uartPort) throws java.io.IOException
java.io.IOException
public SerialDevice createVirtualUart() throws java.io.IOException
java.io.IOException
public java.lang.Integer onByte(java.lang.Integer b) throws java.io.IOException
onByte
in interface SerialDataListener
java.io.IOException
public void onConnect(java.lang.String portName)
onConnect
in interface PortListener
public void onDisconnect(java.lang.String portName)
onDisconnect
in interface PortListener
public boolean preProcessHook(Message msg)
preProcessHook
in class Service
public void clear()
public java.util.concurrent.BlockingQueue<Message> getMsgs()
public Message getMsg(long timeout) throws java.lang.InterruptedException
java.lang.InterruptedException
public java.util.ArrayList<Message> waitForMsgs(int count) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public java.util.ArrayList<Message> waitForMsgs(int count, int timeout) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public java.util.ArrayList<Message> waitForMsgs(int count, int timeout, int pollInterval) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public static ServiceType getMetaData()
public static void main(java.lang.String[] args)