asyn  4-34
Public Member Functions | List of all members
asynOctetClient Class Reference

Class for asyn port clients to communicate on the asynOctet interface. More...

#include <asynPortClient.h>

Inheritance diagram for asynOctetClient:
asynPortClient

Public Member Functions

 asynOctetClient (const char *portName, int addr, const char *drvInfo, double timeout=DEFAULT_TIMEOUT)
 Constructor for asynOctetClient class. More...
 
virtual ~asynOctetClient ()
 Destructor for asynOctetClient class. More...
 
virtual asynStatus write (const char *buffer, size_t bufferLen, size_t *nActual)
 Writes a char buffer to the port driver. More...
 
virtual asynStatus read (char *buffer, size_t bufferLen, size_t *nActual, int *eomReason)
 Reads a char buffer from the port driver. More...
 
virtual asynStatus writeRead (const char *writeBuffer, size_t writeBufferLen, char *readBuffer, size_t readBufferLen, size_t *nBytesOut, size_t *nBytesIn, int *eomReason)
 Writes a char buffer to the port driver and reads the response as an atomic operation. More...
 
virtual asynStatus flush ()
 Flushes the input buffer in the port driver. More...
 
virtual asynStatus setInputEos (const char *eos, int eosLen)
 Sets the input end-of-string terminator in the driver. More...
 
virtual asynStatus getInputEos (char *eos, int eosSize, int *eosLen)
 Gets the input end-of-string terminator from the driver. More...
 
virtual asynStatus setOutputEos (const char *eos, int eosLen)
 Sets the output end-of-string terminator in the driver. More...
 
virtual asynStatus getOutputEos (char *eos, int eosSize, int *eosLen)
 Gets the output end-of-string terminator from the driver. More...
 
virtual asynStatus registerInterruptUser (interruptCallbackOctet pCallback)
 Registers an interruptCallbackOctet function that the driver will call when there is a new value. More...
 
- Public Member Functions inherited from asynPortClient
 asynPortClient (const char *portName, int addr, const char *asynInterfaceType, const char *drvInfo, double timeout)
 Constructor for asynPortClient class. More...
 
virtual ~asynPortClient ()
 Destructor for asynPortClient class Frees all allocated resources. More...
 
void setTimeout (double timeout)
 
void report (FILE *fp, int details)
 Reports the properties of this client. More...
 

Additional Inherited Members

- Protected Attributes inherited from asynPortClient
asynUser * pasynUser_
 
asynUser * pasynUserSyncIO_
 
asynInterface * pasynInterface_
 
double timeout_
 
char * portName_
 
int addr_
 
char * asynInterfaceType_
 
char * drvInfo_
 
void * drvPvt
 
void * interruptPvt_
 

Detailed Description

Class for asyn port clients to communicate on the asynOctet interface.

Constructor & Destructor Documentation

asynOctetClient::asynOctetClient ( const char *  portName,
int  addr,
const char *  drvInfo,
double  timeout = DEFAULT_TIMEOUT 
)
inline

Constructor for asynOctetClient class.

Parameters
[in]portNameThe name of the asyn port to connect to
[in]addrThe address on the asyn port to connect to
[in]drvInfoThe drvInfo string to identify which property of the port is being connected to
[in]timeoutThe default timeout for all communications between the client and the port driver
virtual asynOctetClient::~asynOctetClient ( )
inlinevirtual

Destructor for asynOctetClient class.

Disconnects from port, frees resources.

Member Function Documentation

virtual asynStatus asynOctetClient::flush ( )
inlinevirtual

Flushes the input buffer in the port driver.

virtual asynStatus asynOctetClient::getInputEos ( char *  eos,
int  eosSize,
int *  eosLen 
)
inlinevirtual

Gets the input end-of-string terminator from the driver.

Parameters
[out]eosThe input EOS string
[out]eosSizeThe maximum size of the EOS string
[out]eosLenThe actual size of the EOS string
virtual asynStatus asynOctetClient::getOutputEos ( char *  eos,
int  eosSize,
int *  eosLen 
)
inlinevirtual

Gets the output end-of-string terminator from the driver.

Parameters
[out]eosThe output EOS string
[out]eosSizeThe maximum size of the EOS string
[out]eosLenThe actual size of the EOS string
virtual asynStatus asynOctetClient::read ( char *  buffer,
size_t  bufferLen,
size_t *  nActual,
int *  eomReason 
)
inlinevirtual

Reads a char buffer from the port driver.

Parameters
[out]bufferThe characters read from the port driver
[in]bufferLenThe size of the buffer
[out]nActualThe number of characters actually read
[out]eomReasonThe end of message reason, i.e. why the read terminated
virtual asynStatus asynOctetClient::registerInterruptUser ( interruptCallbackOctet  pCallback)
inlinevirtual

Registers an interruptCallbackOctet function that the driver will call when there is a new value.

Parameters
[in]pCallbackThe address of the callback function
virtual asynStatus asynOctetClient::setInputEos ( const char *  eos,
int  eosLen 
)
inlinevirtual

Sets the input end-of-string terminator in the driver.

Parameters
[in]eosThe input EOS string
[in]eosLenThe size of the EOS string
virtual asynStatus asynOctetClient::setOutputEos ( const char *  eos,
int  eosLen 
)
inlinevirtual

Sets the output end-of-string terminator in the driver.

Parameters
[in]eosThe output EOS string
[in]eosLenThe size of the EOS string
virtual asynStatus asynOctetClient::write ( const char *  buffer,
size_t  bufferLen,
size_t *  nActual 
)
inlinevirtual

Writes a char buffer to the port driver.

Parameters
[in]bufferThe characters to write to the port driver
[in]bufferLenThe size of the buffer
[out]nActualThe number of characters actually written
virtual asynStatus asynOctetClient::writeRead ( const char *  writeBuffer,
size_t  writeBufferLen,
char *  readBuffer,
size_t  readBufferLen,
size_t *  nBytesOut,
size_t *  nBytesIn,
int *  eomReason 
)
inlinevirtual

Writes a char buffer to the port driver and reads the response as an atomic operation.

Parameters
[in]writeBufferThe characters to write to the port driver
[in]writeBufferLenThe size of the write buffer
[out]readBufferThe characters read from the port driver
[in]readBufferLenThe size of the read buffer
[out]nBytesOutThe number of characters actually written
[out]nBytesInThe number of characters actually read
[out]eomReasonThe end of message reason, i.e. why the read terminated

The documentation for this class was generated from the following file: