yarp-devices
|
Message broker of a CAN bus with YARP port interfaces. More...
#include <SingleBusBroker.hpp>
Public Member Functions | |
SingleBusBroker (const std::string &name) | |
Constructor, passes string identifier of the CAN bus. | |
~SingleBusBroker () override | |
Destructor. | |
bool | configure (const yarp::os::Searchable &config) |
Configure this CAN bus. | |
bool | registerDevice (yarp::dev::PolyDriver *driver) |
Register CAN handles associated to the input device driver. | |
bool | clearFilters () |
Clear CAN acceptance filters. | |
bool | startThreads () |
Start CAN read/write threads. | |
bool | stopThreads () |
Stop CAN read/write threads. | |
CanReaderThread * | getReader () const |
Get handle of the CAN RX thread. | |
CanWriterThread * | getWriter () const |
Get handle. | |
std::string | getName () const |
Retrieve string identifier for this CAN bus. | |
void | onRead (yarp::os::Bottle &b) override |
Callback on incoming remote CAN commands. | |
Private Member Functions | |
bool | createPorts (const std::string &prefix) |
Open remote CAN interface ports. | |
Private Attributes | |
std::string | name |
CanReaderThread * | readerThread |
CanWriterThread * | writerThread |
yarp::dev::ICanBus * | iCanBus |
yarp::dev::ICanBufferFactory * | iCanBufferFactory |
yarp::os::Port | dumpPort |
yarp::os::PortWriterBuffer< yarp::os::Bottle > | dumpWriter |
std::mutex | dumpMutex |
yarp::os::Port | sendPort |
yarp::os::PortReaderBuffer< yarp::os::Bottle > | commandReader |
yarp::os::RpcServer | sdoPort |
SdoReplier | sdoReplier |
yarp::os::Port | busLoadPort |
BusLoadMonitor * | busLoadMonitor |
Instantiates and orchestrates independent CAN read/write threads and manages message buffers. Outgoing messages are loaded into a queue and processed in batches, incoming messages are forwarded to registered listeners.
CAN traffic is interfaced via optional YARP ports to allow remote access. This includes an output dump port, an input command port, and an RPC service for confirmed SDO transfers.