Electronics and Software
Engineering Innovation
Beam-lib  2.15.1

#include <BoapMc.h>

Public Member Functions

 BoapMcComms (Bool threaded=0, BUInt rxQueueSize=4)
 
virtual ~BoapMcComms ()
 
void setCommsMode (Bool slave, BUInt txQueueSize)
 Sets slave mode. More...
 
void setComms (BComms &comms)
 Sets the communications interface to use. More...
 
void setComms (BComms *comms)
 Sets the communications interface to use. More...
 
void setAddress (BUInt8 addressTo, BUInt8 addressFrom)
 Sets the to and from addresses. More...
 
BUInt32 getApiVersion ()
 Returns the API version. More...
 
BUInt32 setTimeout (BUInt32 timeoutUs)
 Sets the call timeout returning the current value. More...
 
virtual BError processRx (BTimeout timeoutUs=BTimeoutForever)
 Process any RX packets queuing them as needed. More...
 
virtual BError processRequests (BTimeout timeoutUs=BTimeoutForever)
 Check and process all requests. More...
 
virtual BError processRequest (BTimeout timeoutUs=BTimeoutForever)
 Check and process any request. More...
 
virtual BError processPacket (BoapMcPacket &rx, BoapMcPacket &tx)
 Process a recieved packet. More...
 

Protected Member Functions

BError performCall ()
 Performs a RPC call to the remote side. More...
 
BError performSend ()
 Performs a RPC send to the remote side. More...
 
BError packetSend (BoapMcPacket &packet)
 Receives a packet. More...
 
BError packetRecv (BoapMcPacket &packet)
 Receives a packet. More...
 

Protected Attributes

Bool othreaded
 
BMutex olockCall
 Lock for RPC calls. Only one at a time. More...
 
BMutex olockTx
 Lock for TX. More...
 
BCommsocomms
 
BUInt32 oapiVersion
 
Bool oslave
 Set slave mode. More...
 
BUInt32 otimeout
 The timeout in us for calls. More...
 
BUInt8 oaddressTo
 
BUInt8 oaddressFrom
 
BoapMcPacket opacket
 Packet RX buffer. More...
 
BoapMcPacket opacketTx
 Packet TX buffer for calls. More...
 
BoapMcPacket opacketRx
 Packet RX buffer for calls. More...
 
BSemaphore opacketRxSema
 Wait RX semaphore. More...
 
BoapMcPacket opacketReqTx
 Packet TX buffer for requests. More...
 
BoapMcPacket opacketReqRx
 Packet RX buffer for requests. More...
 
BQueue< BoapMcPacketopacketReqQueue
 Packet RX buffer queue for requests. More...
 
BFifo< BoapMcPacketopacketTxQueue
 Packet TX Queue. More...
 
BSemaphoreCount opacketTxQueueWriteNum
 Packet TX Queue number. More...
 
BSemaphore opacketTxSema
 Wait for TX semaphore. More...
 

Constructor & Destructor Documentation

◆ BoapMcComms()

BoapMcComms::BoapMcComms ( Bool  threaded = 0,
BUInt  rxQueueSize = 4 
)

◆ ~BoapMcComms()

BoapMcComms::~BoapMcComms ( )
virtual

Member Function Documentation

◆ getApiVersion()

BUInt32 BoapMcComms::getApiVersion ( )

Returns the API version.

◆ packetRecv()

BError BoapMcComms::packetRecv ( BoapMcPacket packet)
protected

Receives a packet.

◆ packetSend()

BError BoapMcComms::packetSend ( BoapMcPacket packet)
protected

Receives a packet.

◆ performCall()

BError BoapMcComms::performCall ( )
protected

Performs a RPC call to the remote side.

◆ performSend()

BError BoapMcComms::performSend ( )
protected

Performs a RPC send to the remote side.

◆ processPacket()

BError BoapMcComms::processPacket ( BoapMcPacket rx,
BoapMcPacket tx 
)
virtual

Process a recieved packet.

◆ processRequest()

BError BoapMcComms::processRequest ( BTimeout  timeoutUs = BTimeoutForever)
virtual

Check and process any request.

◆ processRequests()

BError BoapMcComms::processRequests ( BTimeout  timeoutUs = BTimeoutForever)
virtual

Check and process all requests.

◆ processRx()

BError BoapMcComms::processRx ( BTimeout  timeoutUs = BTimeoutForever)
virtual

Process any RX packets queuing them as needed.

!!! This should wait on comms for timeoutUs !!!

◆ setAddress()

void BoapMcComms::setAddress ( BUInt8  addressTo,
BUInt8  addressFrom 
)

Sets the to and from addresses.

◆ setComms() [1/2]

void BoapMcComms::setComms ( BComms comms)

Sets the communications interface to use.

◆ setComms() [2/2]

void BoapMcComms::setComms ( BComms comms)

Sets the communications interface to use.

◆ setCommsMode()

void BoapMcComms::setCommsMode ( Bool  slave,
BUInt  txQueueSize 
)

Sets slave mode.

◆ setTimeout()

BUInt32 BoapMcComms::setTimeout ( BUInt32  timeoutUs)

Sets the call timeout returning the current value.

Member Data Documentation

◆ oaddressFrom

BUInt8 BoapMcComms::oaddressFrom
protected

◆ oaddressTo

BUInt8 BoapMcComms::oaddressTo
protected

◆ oapiVersion

BUInt32 BoapMcComms::oapiVersion
protected

◆ ocomms

BComms* BoapMcComms::ocomms
protected

◆ olockCall

BMutex BoapMcComms::olockCall
protected

Lock for RPC calls. Only one at a time.

◆ olockTx

BMutex BoapMcComms::olockTx
protected

Lock for TX.

◆ opacket

BoapMcPacket BoapMcComms::opacket
protected

Packet RX buffer.

◆ opacketReqQueue

BQueue<BoapMcPacket> BoapMcComms::opacketReqQueue
protected

Packet RX buffer queue for requests.

◆ opacketReqRx

BoapMcPacket BoapMcComms::opacketReqRx
protected

Packet RX buffer for requests.

◆ opacketReqTx

BoapMcPacket BoapMcComms::opacketReqTx
protected

Packet TX buffer for requests.

◆ opacketRx

BoapMcPacket BoapMcComms::opacketRx
protected

Packet RX buffer for calls.

◆ opacketRxSema

BSemaphore BoapMcComms::opacketRxSema
protected

Wait RX semaphore.

◆ opacketTx

BoapMcPacket BoapMcComms::opacketTx
protected

Packet TX buffer for calls.

◆ opacketTxQueue

BFifo<BoapMcPacket> BoapMcComms::opacketTxQueue
protected

Packet TX Queue.

◆ opacketTxQueueWriteNum

BSemaphoreCount BoapMcComms::opacketTxQueueWriteNum
protected

Packet TX Queue number.

◆ opacketTxSema

BSemaphore BoapMcComms::opacketTxSema
protected

Wait for TX semaphore.

◆ oslave

Bool BoapMcComms::oslave
protected

Set slave mode.

◆ othreaded

Bool BoapMcComms::othreaded
protected

◆ otimeout

BUInt32 BoapMcComms::otimeout
protected

The timeout in us for calls.


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