15#ifndef __SHARED_CAN_BUS_H__
16#define __SHARED_CAN_BUS_H__
19#include <condition_variable>
21#include <yarp/os/Time.h>
22#include <yarp/os/Log.h>
23#include <yarp/dev/DeviceDriver.h>
24#include <yarp/dev/CanBusInterface.h>
33 class CanBusAccessPoint;
52 public ICanBufferFactory,
109 yWarning(
"Set baud rate not allowed from CanBusAccessPoint implementation\n");
113 virtual bool canIdAdd(
unsigned int id);
116 virtual bool canRead(CanBuffer &msgs,
unsigned int size,
unsigned int *nmsg,
bool wait=
false)
131 for (
unsigned int i=0; i<
nRecv && i<size; ++i)
149 virtual bool canWrite(
const CanBuffer &msgs,
unsigned int size,
unsigned int *sent,
bool wait=
false);
162 virtual bool open(yarp::os::Searchable& config);
163 virtual bool close();
#define UNREQ
Copyright (C) 2012 RobotCub Consortium.
sharedcan : implements ICanBus interface for multiple access from a single access can driver (for exa...
virtual bool canSetBaudRate(unsigned int rate)
virtual void destroyBuffer(CanBuffer &msgs)
virtual bool open(yarp::os::Searchable &config)
virtual bool canGetBaudRate(unsigned int *rate)
SharedCanBus * mSharedPhysDevice
virtual bool canRead(CanBuffer &msgs, unsigned int size, unsigned int *nmsg, bool wait=false)
bool hasId(unsigned int id)
virtual bool canIdAdd(unsigned int id)
bool pushReadMsg(CanMessage &msg)
std::condition_variable cv_waitRead
virtual bool canWrite(const CanBuffer &msgs, unsigned int size, unsigned int *sent, bool wait=false)
virtual bool canIdDelete(unsigned int id)
virtual CanBuffer createBuffer(int nmessage)
Copyright (C) 2008 RobotCub Consortium.