Electronics and Software
Engineering Innovation
BMeasure-lib 1.1.0

#include <CommsUsb.h>

Inheritance diagram for BMeasureApi::CommsUsb:
BComms

Public Member Functions

 CommsUsb ()
 
 ~CommsUsb ()
 
BError connect (BString device)
 
BError disconnect ()
 
BUInt readAvailable ()
 
BError read (void *data, BUInt32 num, BUInt32 &nTrans)
 
BError write (const void *data, BUInt32 num, BUInt32 &nTrans)
 
BError wait (BUInt32 eventSet, BTimeout timeout=-1, BUInt32 num=1)
 
- Public Member Functions inherited from BComms
 BComms ()
 
virtual ~BComms ()
 
virtual BError init ()
 
virtual BError setPacketMode (Bool packetMode)
 
virtual Bool packetMode ()
 
virtual BError setTimeout (BTimeout timeoutUs)
 
virtual BError connect (const char *resource)
 
virtual Bool isConnected ()
 
virtual BError 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 (BEventWaitSet events, BTimeout timeoutUs=BTimeoutForever, BUInt32 num=1)
 
virtual void eventQueue (BEventQueue *eventQueue, BInt32 event, BUInt num=1)
 

Private Member Functions

BError readChunk (BTimeout timeout)
 

Private Attributes

BString odevice
 
libusb_context * ocontext
 
libusb_device_handle * odev
 
char obuffer [102400]
 
BUInt onum
 
Bool oterminated
 
Bool oterminating
 
Bool ousbDisconnected
 

Additional Inherited Members

- Public Types inherited from BComms
enum  Flush
 
- Public Attributes inherited from BComms
 FlushRead
 
 FlushWrite
 
 FlushReadWrite
 
- Protected Attributes inherited from BComms
Bool oconnected
 
Bool opacketMode
 
BTimeout otimeout
 
BEventQueueoeventQueue
 
BInt32 oevent
 
BUInt oeventNum
 

Constructor & Destructor Documentation

◆ CommsUsb()

BMeasureApi::CommsUsb::CommsUsb ( )

◆ ~CommsUsb()

BMeasureApi::CommsUsb::~CommsUsb ( )

Member Function Documentation

◆ connect()

BError BMeasureApi::CommsUsb::connect ( BString  device)

◆ disconnect()

BError BMeasureApi::CommsUsb::disconnect ( )
virtual

Reimplemented from BComms.

◆ read()

BError BMeasureApi::CommsUsb::read ( void *  data,
BUInt32  num,
BUInt32 nTrans 
)
virtual

Implements BComms.

◆ readAvailable()

BUInt BMeasureApi::CommsUsb::readAvailable ( )
virtual

Reimplemented from BComms.

◆ readChunk()

BError BMeasureApi::CommsUsb::readChunk ( BTimeout  timeout)
private

◆ wait()

BError BMeasureApi::CommsUsb::wait ( BUInt32  eventSet,
BTimeout  timeout = -1,
BUInt32  num = 1 
)

◆ write()

BError BMeasureApi::CommsUsb::write ( const void *  data,
BUInt32  num,
BUInt32 nTrans 
)
virtual

Implements BComms.

Member Data Documentation

◆ obuffer

char BMeasureApi::CommsUsb::obuffer[102400]
private

◆ ocontext

libusb_context* BMeasureApi::CommsUsb::ocontext
private

◆ odev

libusb_device_handle* BMeasureApi::CommsUsb::odev
private

◆ odevice

BString BMeasureApi::CommsUsb::odevice
private

◆ onum

BUInt BMeasureApi::CommsUsb::onum
private

◆ oterminated

Bool BMeasureApi::CommsUsb::oterminated
private

◆ oterminating

Bool BMeasureApi::CommsUsb::oterminating
private

◆ ousbDisconnected

Bool BMeasureApi::CommsUsb::ousbDisconnected
private

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