annotatorcomm::AnnotatorComm Class Reference

#include <AnnotatorComm.h>

Inheritance diagram for annotatorcomm::AnnotatorComm:

annotatorcomm::annotatorjr::AnnotatorJr List of all members.

Public Member Functions

 AnnotatorComm (InputStream *in, OutputStream *out)
virtual ~AnnotatorComm ()
virtual void close () throw (IOException)
virtual void signal (ResponseMessage &rsp)
virtual void addTimestampListener (TimestampListener *listener)
virtual void removeTimestampListener (TimestampListener *listener)
virtual vector< TimestampListener * > getTimestampListeners ()
virtual void addTextMessageListener (TextMessageListener *listener)
virtual void removeTextMessageListener (TextMessageListener *listener)
virtual vector< TextMessageListener * > getTextMessageListeners ()
void noop () throw (IOException)
const DeviceIdgetDeviceId () throw (IOException)
FirmwareVersion getFirmwareVersion () throw (IOException)
string getFirmwareTimestamp () throw (IOException)
int getSerialNumber () throw (IOException)
void setSerialNumber (int serialno, int key) throw (IOException)
string getDeviceName () throw (IOException)
void setDeviceName (string name) throw (IOException)
vector< const TimeSource * > getSupportedTimeSources () throw (IOException)
const TimeSourcegetTimeSource () throw (IOException)
void setTimeSource (const TimeSource *source) throw (IOException)
MicrosecondTimestamp getCurrentTime () throw (IOException)
void setCurrentTime (MicrosecondTimestamp &timestamp) throw (IOException)
const TimeSourceLockStatusgetTimeSourceLockStatus () throw (IOException)
void setTimeSourceTimestampMode (bool isEnabled) throw (IOException)
bool isTimeSourceTimestampMode () throw (IOException)
void saveOptions () throw (IOException)

Static Public Member Functions

static string getLibAnnotatorCommVersion ()

Static Public Attributes

static const string VERSION
static const unsigned int MAX_NAME_LEN
static const int STX
static const int ETX

Protected Member Functions

virtual ResponseMessage sendRecv (CommandMessage &msg) throw (IOException)
virtual void signalTimestampListeners (Timestamp &timestamp)
virtual void signalSynchronousResponse (ResponseMessage &rsp)

Detailed Description

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.

Definition at line 46 of file AnnotatorComm.h.


Constructor & Destructor Documentation

annotatorcomm::AnnotatorComm::AnnotatorComm ( InputStream in,
OutputStream out 
)

Construct an AnnotatorComm.

Parameters:
in Annotator input stream
out Annotator output stream

virtual annotatorcomm::AnnotatorComm::~AnnotatorComm (  )  [virtual]

AnnotatorComm destructor


Member Function Documentation

virtual void annotatorcomm::AnnotatorComm::addTextMessageListener ( TextMessageListener listener  )  [virtual]

Add a text message listener to be notified when a text message is received.

Parameters:
listener text message listener to notify

virtual void annotatorcomm::AnnotatorComm::addTimestampListener ( TimestampListener listener  )  [virtual]

Add a timestamp listener to be notified when a timestamp is received.

Parameters:
listener timestamp listener to notify

virtual void annotatorcomm::AnnotatorComm::close (  )  throw (IOException) [virtual]

Close I/O streams attached to the Annotator.

Exceptions:
IOException failure to close streams

Reimplemented in annotatorcomm::annotatorjr::AnnotatorJr.

MicrosecondTimestamp annotatorcomm::AnnotatorComm::getCurrentTime (  )  throw (IOException)

Get the Annotator's current time.

Returns:
curren time
Exceptions:
IOException failure to get current time

const DeviceId* annotatorcomm::AnnotatorComm::getDeviceId (  )  throw (IOException)

Get the device's ID. Determine which type of Annotator is present.

Returns:
device id
Exceptions:
IOException failure to get the device's ID

string annotatorcomm::AnnotatorComm::getDeviceName (  )  throw (IOException)

Get the device's name.

Returns:
device name
Exceptions:
IOException failure to get device name

string annotatorcomm::AnnotatorComm::getFirmwareTimestamp (  )  throw (IOException)

Get the firmware build time and date stamp.

Returns:
firmware build time
Exceptions:
IOException failure to get firmware build time

FirmwareVersion annotatorcomm::AnnotatorComm::getFirmwareVersion (  )  throw (IOException)

Get the device's version number.

Returns:
device firmware version
Exceptions:
IOException failure to get device firmware version

static string annotatorcomm::AnnotatorComm::getLibAnnotatorCommVersion (  )  [static]

Get libAnnotatorComm's version.

Returns:
libAnnotatorComm's version

int annotatorcomm::AnnotatorComm::getSerialNumber (  )  throw (IOException)

Get the device's serial number.

Returns:
serial number
Exceptions:
IOException failure to get serial number

vector<const TimeSource*> annotatorcomm::AnnotatorComm::getSupportedTimeSources (  )  throw (IOException)

Get the supported time sources. The device can be set to decode any of the returned time sources.

Returns:
supported time sources
Exceptions:
IOException failure to get supported time sources

virtual vector<TextMessageListener*> annotatorcomm::AnnotatorComm::getTextMessageListeners (  )  [virtual]

Get current text message listeners.

Returns:
text message listeners

const TimeSource* annotatorcomm::AnnotatorComm::getTimeSource (  )  throw (IOException)

Get the time source currently being decoded.

Returns:
current time source
Exceptions:
IOException failiure to get current time source

const TimeSourceLockStatus* annotatorcomm::AnnotatorComm::getTimeSourceLockStatus (  )  throw (IOException)

Get the time source lock status.

Returns:
lock status
Exceptions:
IOException failure to get lock status

virtual vector<TimestampListener*> annotatorcomm::AnnotatorComm::getTimestampListeners (  )  [virtual]

Get current timestamp listeners.

Returns:
timestamp listeners

bool annotatorcomm::AnnotatorComm::isTimeSourceTimestampMode (  )  throw (IOException)

Get the time source timestamp mode.

Returns:
enabled status
Exceptions:
IOException failure to get mode

void annotatorcomm::AnnotatorComm::noop (  )  throw (IOException)

Perform a NOOP command.

Exceptions:
IOException failure to complete NOOP command

virtual void annotatorcomm::AnnotatorComm::removeTextMessageListener ( TextMessageListener listener  )  [virtual]

Remove a text message listener.

Parameters:
listener text message listener to remove

virtual void annotatorcomm::AnnotatorComm::removeTimestampListener ( TimestampListener listener  )  [virtual]

Remove a timestamp listener.

Parameters:
listener timestamp listener to remove

void annotatorcomm::AnnotatorComm::saveOptions (  )  throw (IOException)

Save current options as the default to flash memory. When the device is reset, the options will be restored from flash. Device name and other options specially marked are not affected by this command.

Exceptions:
IOException failure to save options

virtual ResponseMessage annotatorcomm::AnnotatorComm::sendRecv ( CommandMessage msg  )  throw (IOException) [protected, virtual]

Send a command and return its response.

Parameters:
msg command message to send
Returns:
response received
Exceptions:
IOException failure to send and receive

void annotatorcomm::AnnotatorComm::setCurrentTime ( MicrosecondTimestamp timestamp  )  throw (IOException)

Set the Annotator's current time.

Parameters:
timestamp current time
Exceptions:
IOException failure to set current time

void annotatorcomm::AnnotatorComm::setDeviceName ( string  name  )  throw (IOException)

Set the device's name.

Parameters:
name device name
Exceptions:
IOException failure to set device name
See also:
MAX_NAME_LEN

void annotatorcomm::AnnotatorComm::setSerialNumber ( int  serialno,
int  key 
) throw (IOException)

Set the device's serial number. This method is for factory use only and requires a security key to function.

Parameters:
serialno serial number
key security key
Exceptions:
IOException 

void annotatorcomm::AnnotatorComm::setTimeSource ( const TimeSource source  )  throw (IOException)

Set the time source to be decoded.

Parameters:
source time source to decode
Exceptions:
IOException failure to set time source

void annotatorcomm::AnnotatorComm::setTimeSourceTimestampMode ( bool  isEnabled  )  throw (IOException)

Set the time source timestamp mode. When enabled, the Annotator will stream time source timestamps back across the AnnotatorComm link.

Parameters:
isEnabled enabled status
Exceptions:
IOException failure to set mode

virtual void annotatorcomm::AnnotatorComm::signal ( ResponseMessage rsp  )  [virtual]

Signal that a response message has been read and needs tending. Override this method to provide device specific response message functionality. This method is called by ResponseReader.

Parameters:
rsp new response message

Reimplemented in annotatorcomm::annotatorjr::AnnotatorJr.

virtual void annotatorcomm::AnnotatorComm::signalSynchronousResponse ( ResponseMessage rsp  )  [protected, virtual]

Signal that a response message has been received.

Parameters:
rsp reponse message received

virtual void annotatorcomm::AnnotatorComm::signalTimestampListeners ( Timestamp timestamp  )  [protected, virtual]

Signal timestamp listeners that a timestamp has been received.

Parameters:
timestamp timestamp received


Member Data Documentation

const int annotatorcomm::AnnotatorComm::ETX [static]

End of Transmission Marker

Definition at line 67 of file AnnotatorComm.h.

const unsigned int annotatorcomm::AnnotatorComm::MAX_NAME_LEN [static]

Maximum length of an Annotator name

Definition at line 57 of file AnnotatorComm.h.

const int annotatorcomm::AnnotatorComm::STX [static]

Start of Transmission Marker

Definition at line 62 of file AnnotatorComm.h.

const string annotatorcomm::AnnotatorComm::VERSION [static]

libAnnotatorComm version

Definition at line 52 of file AnnotatorComm.h.


The documentation for this class was generated from the following file:
Generated on Tue Aug 1 11:14:11 2006 for libAnnotatorComm by  doxygen 1.4.7