26 public yarp::dev::ICanBus,
27 public yarp::dev::ImplementCanBufferFactory<roboticslab::SocketCanMessage, struct can_frame>,
32 bool open(yarp::os::Searchable& config)
override;
33 bool close()
override;
36 bool canSetBaudRate(
unsigned int rate)
override;
37 bool canGetBaudRate(
unsigned int * rate)
override;
38 bool canIdAdd(
unsigned int id)
override;
39 bool canIdDelete(
unsigned int id)
override;
40 bool canRead(yarp::dev::CanBuffer & msgs,
unsigned int size,
unsigned int * read,
bool wait =
false)
override;
41 bool canWrite(
const yarp::dev::CanBuffer & msgs,
unsigned int size,
unsigned int * sent,
bool wait =
false)
override;
44 enum io_operation { READ, WRITE };
46 bool waitUntilTimeout(io_operation op,
bool * bufferReady);
47 void interpretErrorFrame(
const struct can_frame * msg);
49 int socketDescriptor {0};
50 std::vector<struct can_filter> filters;