Libbarrett  1.2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines
Public Member Functions | Static Public Attributes | Protected Attributes
barrett::bus::CANSocket Class Reference
Inheritance diagram for barrett::bus::CANSocket:
barrett::bus::CommunicationsBus

List of all members.

Public Member Functions

 CANSocket ()
 CANSocket (int port) throw (std::runtime_error)
virtual thread::RealTimeMutexgetMutex () const
virtual void open (int port) throw (std::logic_error, std::runtime_error)
virtual void close ()
virtual bool isOpen () const
virtual int send (int busId, const unsigned char *data, size_t len) const
virtual int receiveRaw (int &busId, unsigned char *data, size_t &len, bool blocking=true) const

Static Public Attributes

static const size_t MAX_MESSAGE_LEN = 8

Protected Attributes

thread::RealTimeMutex mutex
detail::can_handlehandle

Constructor & Destructor Documentation

The maximum length of a CANbus message. Make sure to update CommunicationsBus::MAX_MESSAGE_LEN! CANSocket() Constructors


Member Function Documentation

void barrett::bus::CANSocket::close ( ) [virtual]

close() method destorys socket communication port.

Implements barrett::bus::CommunicationsBus.

virtual thread::RealTimeMutex& barrett::bus::CANSocket::getMutex ( ) const [inline, virtual]

getMutex() method gets and locks interthread data exchange assuring nothing critical is happening in either thread.

Implements barrett::bus::CommunicationsBus.

bool barrett::bus::CANSocket::isOpen ( ) const [virtual]

isOpen() method returns a flag signifying socket Communication is open.

Implements barrett::bus::CommunicationsBus.

void barrett::bus::CANSocket::open ( int  port) throw (std::logic_error, std::runtime_error) [virtual]

open() method creates socket communication on a specific port.

Implements barrett::bus::CommunicationsBus.

int barrett::bus::CANSocket::receiveRaw ( int &  busId,
unsigned char *  data,
size_t &  len,
bool  blocking = true 
) const [virtual]

receiveRaw() method loads data from socket buffer in a realtime safe manner.

Implements barrett::bus::CommunicationsBus.

int barrett::bus::CANSocket::send ( int  busId,
const unsigned char *  data,
size_t  len 
) const [virtual]

send() method pushes data onto socket.

Implements barrett::bus::CommunicationsBus.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines