Classes | |
struct | Message |
class | MessageBuffer |
Public Member Functions | |
BusManager (CommunicationsBus *bus=NULL) | |
BusManager (int port) | |
const CommunicationsBus & | getUnderlyingBus () const |
virtual thread::Mutex & | getMutex () const |
virtual void | open (int port) |
virtual void | close () |
virtual bool | isOpen () const |
virtual int | send (int busId, const unsigned char *data, size_t len) const |
virtual int | receive (int expectedBusId, unsigned char *data, size_t &len, bool blocking=true, bool realtime=false) const |
virtual int | receiveRaw (int &busId, unsigned char *data, size_t &len, bool blocking=true) const |
Protected Member Functions | |
int | updateBuffers () const |
void | storeMessage (int busId, const unsigned char *data, size_t len) const |
bool | retrieveMessage (int busId, unsigned char *data, size_t &len) const |
Protected Attributes | |
CommunicationsBus * | bus |
bool | deleteBus |
barrett::bus::BusManager::BusManager | ( | CommunicationsBus * | bus = NULL | ) |
BusManager Constructors and Destructors
virtual void barrett::bus::BusManager::close | ( | ) | [inline, virtual] |
close Method destroys the communication port on CANBus
Implements barrett::bus::CommunicationsBus.
virtual thread::Mutex& barrett::bus::BusManager::getMutex | ( | ) | const [inline, virtual] |
Destructor
Implements barrett::bus::CommunicationsBus.
const CommunicationsBus& barrett::bus::BusManager::getUnderlyingBus | ( | ) | const [inline] |
getUnderlyingBus pointer returns bus.
virtual bool barrett::bus::BusManager::isOpen | ( | ) | const [inline, virtual] |
isOpen Method is flag for available communication on CANBus
Implements barrett::bus::CommunicationsBus.
virtual void barrett::bus::BusManager::open | ( | int | port | ) | [inline, virtual] |
Open Method creates the communication port on CANBus
Implements barrett::bus::CommunicationsBus.
int barrett::bus::BusManager::receive | ( | int | expectedBusId, |
unsigned char * | data, | ||
size_t & | len, | ||
bool | blocking = true , |
||
bool | realtime = false |
||
) | const [virtual] |
receive Method is thread safe way to update CANBus messages
Reimplemented from barrett::bus::CommunicationsBus.
virtual int barrett::bus::BusManager::receiveRaw | ( | int & | busId, |
unsigned char * | data, | ||
size_t & | len, | ||
bool | blocking = true |
||
) | const [inline, virtual] |
receiveRaw Method works the same as receive but is realtime safe
Implements barrett::bus::CommunicationsBus.
virtual int barrett::bus::BusManager::send | ( | int | busId, |
const unsigned char * | data, | ||
size_t | len | ||
) | const [inline, virtual] |
send Method
Implements barrett::bus::CommunicationsBus.