asyn  4-44-2
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:
asynParamClient

Public Member Functions

 asynOctetClient (const char *portName, int addr, const char *drvInfo, double timeout=DEFAULT_TIMEOUT)
 Constructor for asynOctetClient class. More...
 
 asynOctetClient (const char *portName, const char *drvInfo, int addr=0, double timeout=DEFAULT_TIMEOUT)
 
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 write (const char *buffer)
 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, void *userPvt=0)
 Registers an interruptCallbackOctet function that the driver will call when there is a new value. More...
 
- Public Member Functions inherited from asynParamClient
 asynParamClient (const char *portName, int addr, const char *asynInterfaceType, const char *drvInfo, double timeout)
 Constructor for asynParamClient class. More...
 
virtual ~asynParamClient ()
 Destructor for asynParamClient class Frees all allocated resources. More...
 
void setTimeout (double timeout)
 
void report (FILE *fp, int details)
 Reports the properties of this client. More...
 
char * getPortName ()
 
char * getAsynInterfaceType ()
 

Additional Inherited Members

- Protected Attributes inherited from asynParamClient
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() [1/2]

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

◆ asynOctetClient() [2/2]

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

◆ ~asynOctetClient()

virtual asynOctetClient::~asynOctetClient ( )
inlinevirtual

Destructor for asynOctetClient class.

Disconnects from port, frees resources.

Member Function Documentation

◆ flush()

virtual asynStatus asynOctetClient::flush ( )
inlinevirtual

Flushes the input buffer in the port driver.

◆ getInputEos()

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

◆ getOutputEos()

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

◆ read()

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

◆ registerInterruptUser()

virtual asynStatus asynOctetClient::registerInterruptUser ( interruptCallbackOctet  pCallback,
void *  userPvt = 0 
)
inlinevirtual

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

Parameters
[in]pCallbackThe address of the callback function
[in]userPvtThe user-defined pointer to be passed to the callback function

◆ setInputEos()

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

◆ setOutputEos()

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

◆ write() [1/2]

virtual asynStatus asynOctetClient::write ( const char *  buffer)
inlinevirtual

Writes a char buffer to the port driver.

Parameters
[in]bufferThe characters to write to the port driver

◆ write() [2/2]

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

◆ writeRead()

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: