|
yarp-devices
|
A thread that deals with CAN reads. More...
#include <CanRxTxThreads.hpp>
Public Member Functions | |
| CanReaderThread (const std::string &id, double delay, unsigned int bufferSize) | |
| Constructor. | |
| void | registerHandle (ICanBusSharer *p) |
| Map CAN node ids with handles. | |
| const std::vector< ICanBusSharer * > & | getHandles () const |
| Retrieve collection of handles to wrapped CAN devices. | |
| void | attachCanNotifier (ICanMessageNotifier *canMessageNotifier) |
| Attach custom CAN message responder handle. | |
| void | run () override |
Public Member Functions inherited from roboticslab::CanReaderWriterThread | |
| CanReaderWriterThread (const std::string &type, const std::string &id, double delay, unsigned int bufferSize) | |
| Constructor. | |
| ~CanReaderWriterThread () override=default | |
| Virtual destructor. | |
| bool | threadInit () override |
| Invoked by the thread right before it is started. | |
| void | threadRelease () override |
| Invoked by the thread right after it is started. | |
| void | beforeStart () override |
| Invoked by the caller right before the thread is started. | |
| void | afterStart (bool success) override |
| Invoked by the caller right before the thread is joined. | |
| void | onStop () override |
| Callback on thread stop. | |
| void | setCanHandles (yarp::dev::ICanBus *iCanBus, yarp::dev::ICanBufferFactory *iCanBufferFactory) |
| Configure CAN interface handles. | |
| void | attachDumpWriter (yarp::os::Contactable *dumpPort, yarp::os::PortWriterBuffer< yarp::os::Bottle > *dumpWriter, std::mutex *dumpMutex) |
| Attach YARP port writer for CAN message dumping. | |
| void | attachBusLoadMonitor (ICanMessageNotifier *busLoadMonitor) |
| Attach CAN bus load monitor. | |
Private Attributes | |
| std::vector< ICanBusSharer * > | handles |
| std::unordered_map< unsigned int, ICanBusSharer * > | canIdToHandle |
| ICanMessageNotifier * | canMessageNotifier |
Additional Inherited Members | |
Static Protected Member Functions inherited from roboticslab::CanReaderWriterThread | |
| static void | dumpMessage (const can_message &msg, yarp::os::Bottle &b) |
| Dump a CAN message to a YARP bottle. | |
Protected Attributes inherited from roboticslab::CanReaderWriterThread | |
| yarp::dev::ICanBus * | iCanBus |
| yarp::dev::ICanBufferFactory * | iCanBufferFactory |
| yarp::dev::CanBuffer | canBuffer |
| yarp::os::Contactable * | dumpPort |
| yarp::os::PortWriterBuffer< yarp::os::Bottle > * | dumpWriter |
| std::mutex * | dumpMutex |
| yarp::os::Stamp | lastStamp |
| ICanMessageNotifier * | busLoadMonitor |
| unsigned int | bufferSize |
| double | delay |
Messages are forwarded to each raw subdevice given the CAN node ID.