BDS Public
Beamlib 3.3.4
This is the Beam C++ class library.
Loading...
Searching...
No Matches

A base class for communications classes having a generic API. More...

#include <BComms.h>

Public Types

enum  Flush { FlushRead , FlushWrite , FlushReadWrite }
 

Public Member Functions

 BComms ()
 
virtual ~BComms ()
 
virtual BError init ()
 
virtual void close ()
 
virtual const char * name ()
 The name of this interface.
 
virtual BUInt32 byteRate ()
 The byte rate of this interface.
 
virtual BError setPacketMode (Bool packetMode)
 Set packet mode.
 
virtual Bool packetMode ()
 Device is in packet mode.
 
virtual BError setTimeout (BTimeout timeoutUs)
 Set communication timeout.
 
virtual BError connect (const char *resource)
 Create a connection.
 
virtual Bool isConnected ()
 
virtual BError disconnect ()
 Disconnect.
 
virtual void flush (Flush flush)
 
virtual BUInt writeAvailable ()
 
virtual BError write (const void *data, BUInt32 nBytes, BUInt32 &nTrans)=0
 
virtual BError writeChunks (const BDataChunk *chunks, BUInt nChunks, BUInt32 &nTrans)
 
virtual BUInt readAvailable ()
 
virtual BError read (void *data, BUInt32 num, BUInt32 &nTrans)=0
 
virtual BError wait (BUInt32 eventSet, BTimeout timeoutUs=BTimeoutForever, BUInt32 num=1)
 
virtual void eventQueue (BEventQueue *eventQueue, BUInt32 event, BUInt32 eventSet, BUInt num=1)
 
virtual void eventEnable (Bool on)
 Enable events to be sent.
 

Protected Attributes

Bool oconnected
 
Bool opacketMode
 
BTimeout otimeout
 
BEventQueueoeventQueue
 
Bool oeventEnabled
 
BUInt32 oevent
 
BUInt32 oeventSet
 
BUInt oeventNum
 

Detailed Description

A base class for communications classes having a generic API.

Member Enumeration Documentation

◆ Flush

Enumerator
FlushRead 
FlushWrite 
FlushReadWrite 

Constructor & Destructor Documentation

◆ BComms()

BComms::BComms ( )

◆ ~BComms()

BComms::~BComms ( )
virtual

Member Function Documentation

◆ init()

BError BComms::init ( )
virtual

◆ close()

void BComms::close ( )
virtual

◆ name()

const char * BComms::name ( )
virtual

The name of this interface.

◆ byteRate()

BUInt32 BComms::byteRate ( )
virtual

The byte rate of this interface.

◆ setPacketMode()

BError BComms::setPacketMode ( Bool  packetMode)
virtual

Set packet mode.

◆ packetMode()

Bool BComms::packetMode ( )
virtual

Device is in packet mode.

◆ setTimeout()

BError BComms::setTimeout ( BTimeout  timeoutUs)
virtual

Set communication timeout.

◆ connect()

BError BComms::connect ( const char *  resource)
virtual

Create a connection.

◆ isConnected()

Bool BComms::isConnected ( )
virtual

◆ disconnect()

BError BComms::disconnect ( )
virtual

Disconnect.

◆ flush()

void BComms::flush ( Flush  flush)
virtual

◆ writeAvailable()

BUInt BComms::writeAvailable ( )
virtual

◆ write()

virtual BError BComms::write ( const void *  data,
BUInt32  nBytes,
BUInt32 nTrans 
)
pure virtual

◆ writeChunks()

BError BComms::writeChunks ( const BDataChunk chunks,
BUInt  nChunks,
BUInt32 nTrans 
)
virtual

◆ readAvailable()

BUInt BComms::readAvailable ( )
virtual

◆ read()

virtual BError BComms::read ( void *  data,
BUInt32  num,
BUInt32 nTrans 
)
pure virtual

◆ wait()

BError BComms::wait ( BUInt32  eventSet,
BTimeout  timeoutUs = BTimeoutForever,
BUInt32  num = 1 
)
virtual

◆ eventQueue()

void BComms::eventQueue ( BEventQueue eventQueue,
BUInt32  event,
BUInt32  eventSet,
BUInt  num = 1 
)
virtual

◆ eventEnable()

void BComms::eventEnable ( Bool  on)
virtual

Enable events to be sent.

Member Data Documentation

◆ oconnected

Bool BComms::oconnected
protected

◆ opacketMode

Bool BComms::opacketMode
protected

◆ otimeout

BTimeout BComms::otimeout
protected

◆ oeventQueue

BEventQueue* BComms::oeventQueue
protected

◆ oeventEnabled

Bool BComms::oeventEnabled
protected

◆ oevent

BUInt32 BComms::oevent
protected

◆ oeventSet

BUInt32 BComms::oeventSet
protected

◆ oeventNum

BUInt BComms::oeventNum
protected

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