|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_DEV_CANBUSINTERFACE_H
11 #define YARP_DEV_CANBUSINTERFACE_H
23 class ICanBufferFactory;
28 template <
class M,
class T>
class ImplementCanBufferFactory;
60 virtual unsigned int getId()
const =0;
61 virtual unsigned char getLen()
const =0;
62 virtual void setLen(
unsigned char len) =0;
63 virtual void setId(
unsigned int id) =0;
64 virtual const unsigned char *
getData()
const =0;
118 template<
class M,
class IMPL>
131 std::memset(storage, 0,
sizeof(
IMPL)*elem);
133 for(
int k=0;k<elem;k++)
136 messages[k]->
setBuffer((
unsigned char *)(&storage[k]));
139 ret.resize(messages, elem);
151 yError(
"Warning trying to destroy non valid buffer\n");
156 msgs=
dynamic_cast<M *
>(m[0]);
158 if ((msgs==0)||(storage==0))
160 yError(
"Warning, troubles destroying memory\n");
203 #endif // YARP_DEV_CANBUSINTERFACE_H
virtual void setBuffer(unsigned char *)=0
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
virtual bool canWrite(const CanBuffer &msgs, unsigned int size, unsigned int *sent, bool wait=false)=0
virtual unsigned int getId() const =0
unsigned int txCanFifoOvr
void resize(CanMessage **d, int s)
virtual void destroyBuffer(CanBuffer &buffer)
Interface for a can bus device.
CanMessage & operator[](int k)
CanMessage ** getPointer()
virtual const unsigned char * getPointer() const =0
Implementation of a ICanBufferFactory.
virtual CanBuffer createBuffer(int elem)
unsigned int rxCanFifoOvr
const CanMessage & operator[](int k) const
virtual bool canRead(CanBuffer &msgs, unsigned int size, unsigned int *read, bool wait=false)=0
virtual const unsigned char * getData() const =0
const CanMessage *const * getPointer() const
virtual void setLen(unsigned char len)=0
virtual void setId(unsigned int id)=0
virtual ~ICanBufferFactory()
virtual CanBuffer createBuffer(int nmessage)=0
virtual void destroyBuffer(CanBuffer &msgs)=0
virtual unsigned char getLen() const =0
The main, catch-all namespace for YARP.
virtual ~ImplementCanBufferFactory()
virtual unsigned char * getData()=0
virtual bool canGetBaudRate(unsigned int *rate)=0
virtual bool canSetBaudRate(unsigned int rate)=0
virtual bool canIdAdd(unsigned int id)=0
virtual bool canIdDelete(unsigned int id)=0
virtual bool canGetErrors(yarp::dev::CanErrors &err)=0
virtual unsigned char * getPointer()=0
virtual CanMessage & operator=(const CanMessage &l)=0