|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ionetrics.lib.annotatorcomm.AnnotatorComm
public class AnnotatorComm
AnnotatorComm is the base class for communications with the Annotator. It is capable of communicating across any pair of I/O streams and is thread-safe.
Field Summary | |
---|---|
static int |
ETX
End of Transmission Marker |
static int |
MAX_NAME_LEN
Maximum length of an Annotator name |
static int |
STX
Start of Transmission Marker |
Constructor Summary | |
---|---|
AnnotatorComm(java.io.InputStream in,
java.io.OutputStream out)
Construct an AnnotatorComm from I/O streams attached to an Annotator. |
Method Summary | |
---|---|
void |
addTextMessageListener(TextMessageListener listener)
Add a text message listener to be notified when a text message is received. |
void |
addTimestampListener(TimestampListener listener)
Add a timestamp listener to be notified when a timestamp is received. |
void |
close()
Close I/O streams attached to the Annotator. |
MicrosecondTimestamp |
getCurrentTime()
Get the Annotator's current time. |
DeviceId |
getDeviceId()
Get the device's ID. |
java.lang.String |
getDeviceName()
Get the device's name. |
java.lang.String |
getFirmwareTimestamp()
Get the firmware build time and date stamp. |
FirmwareVersion |
getFirmwareVersion()
Get the device's version number. |
static java.lang.String |
getLibAnnotatorCommVersion()
Get the version of libAnnotatorComm. |
int |
getSerialNumber()
Get the device's serial number. |
TimeSource[] |
getSupportedTimeSources()
Get the supported time sources. |
TextMessageListener[] |
getTextMessageListeners()
Get current text message listeners. |
TimeSource |
getTimeSource()
Get the time source currently being decoded. |
TimeSourceLockStatus |
getTimeSourceLockStatus()
Get the time source lock status. |
TimestampListener[] |
getTimestampListeners()
Get current timestamp listeners. |
boolean |
isTimeSourceTimestampMode()
Get the time source timestamp mode. |
void |
noop()
Perform a NOOP command. |
void |
removeTextMessageListener(TextMessageListener listener)
Remove a text message listener. |
void |
removeTimestampListener(TimestampListener listener)
Remove a timestamp listener. |
void |
saveOptions()
Save current options as the default to flash memory. |
protected ResponseMessage |
sendRecv(CommandMessage msg)
Send a command and return its response. |
void |
setCurrentTime(MicrosecondTimestamp timestamp)
Set the Annotator's current time. |
void |
setDeviceName(java.lang.String name)
Set the device's name. |
void |
setSerialNumber(int serialno,
int key)
Set the device's serial number. |
void |
setTimeSource(TimeSource timeSource)
Set the time source to be decoded. |
void |
setTimeSourceTimestampMode(boolean isEnabled)
Set the time source timestamp mode. |
protected void |
signal(ResponseMessage rspmsg)
Signal that a response message has been read and needs tending. |
protected void |
signalSynchronousResponse(ResponseMessage rspmsg)
Signal that a response message has been received. |
protected void |
signalTimestampListeners(Timestamp timestamp)
Signal timestamp listeners that a timestamp has been received. |
static void |
sleep(int iMilliseconds)
Put the calling thread to sleep for the requested number of milliseconds. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_NAME_LEN
public static final int STX
public static final int ETX
Constructor Detail |
---|
public AnnotatorComm(java.io.InputStream in, java.io.OutputStream out)
in
- input stream from the controllerout
- output stream to the controllerMethod Detail |
---|
public void close() throws java.io.IOException
close
in interface java.io.Closeable
java.io.IOException
- failure to close streamspublic void addTimestampListener(TimestampListener listener)
listener
- timestamp listener to notifypublic void removeTimestampListener(TimestampListener listener)
listener
- timestamp listener to removepublic TimestampListener[] getTimestampListeners()
public void addTextMessageListener(TextMessageListener listener)
listener
- text message listener to notifypublic void removeTextMessageListener(TextMessageListener listener)
listener
- text message listener to removepublic TextMessageListener[] getTextMessageListeners()
public void noop() throws java.io.IOException
java.io.IOException
- failure to complete NOOP commandpublic DeviceId getDeviceId() throws java.io.IOException
java.io.IOException
- failure to get the device's IDpublic FirmwareVersion getFirmwareVersion() throws java.io.IOException
java.io.IOException
- failure to get device firmware versionpublic java.lang.String getFirmwareTimestamp() throws java.io.IOException
java.io.IOException
- failure to get firmware build timepublic int getSerialNumber() throws java.io.IOException
java.io.IOException
- failure to get serial numberpublic void setSerialNumber(int serialno, int key) throws java.io.IOException
serialno
- serial numberkey
- security key
java.io.IOException
public java.lang.String getDeviceName() throws java.io.IOException
java.io.IOException
- failure to get device namepublic void setDeviceName(java.lang.String name) throws java.io.IOException
name
- device name
java.io.IOException
- failure to set device nameMAX_NAME_LEN
public TimeSource[] getSupportedTimeSources() throws java.io.IOException
java.io.IOException
- failure to get supported time sourcespublic TimeSource getTimeSource() throws java.io.IOException
java.io.IOException
- failiure to get current time sourcepublic void setTimeSource(TimeSource timeSource) throws java.io.IOException
timeSource
- time source to decode
java.io.IOException
- failure to set time sourcepublic MicrosecondTimestamp getCurrentTime() throws java.io.IOException
java.io.IOException
- failure to get current timepublic void setCurrentTime(MicrosecondTimestamp timestamp) throws java.io.IOException
timestamp
- current time
java.io.IOException
- failure to set current timepublic TimeSourceLockStatus getTimeSourceLockStatus() throws java.io.IOException
java.io.IOException
- failure to get lock statuspublic void setTimeSourceTimestampMode(boolean isEnabled) throws java.io.IOException
isEnabled
- enabled status
java.io.IOException
- failure to set modepublic boolean isTimeSourceTimestampMode() throws java.io.IOException
java.io.IOException
- failure to get modepublic void saveOptions() throws java.io.IOException
java.io.IOException
- failure to save optionsprotected ResponseMessage sendRecv(CommandMessage msg) throws java.io.IOException
msg
- command message to send
java.io.IOException
- failure to send and receiveprotected void signal(ResponseMessage rspmsg)
rspmsg
- new response messageprotected void signalTimestampListeners(Timestamp timestamp)
timestamp
- timestamp receivedprotected void signalSynchronousResponse(ResponseMessage rspmsg)
rspmsg
- reponse message receivedpublic static void sleep(int iMilliseconds)
iMilliseconds
- number of milliseconds to sleeppublic static java.lang.String getLibAnnotatorCommVersion()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |