22#include <yarp/dev/DeviceDriver.h>
23#include <yarp/dev/CanBusInterface.h>
54 memcpy(
msg, tmp.msg,
sizeof(PLXCAN_MSG));
58 virtual unsigned int getId()
const
64 virtual void setLen(
unsigned char len)
67 virtual void setId(
unsigned int id)
70 virtual const unsigned char *
getData()
const
77 {
return (
unsigned char *)
msg; }
80 {
return (
const unsigned char *)
msg; }
85 msg=(PLXCAN_MSG *)(b);
103 PLXCAN_HANDLE *handle;
111 virtual bool canIdAdd(
unsigned int id);
114 virtual bool canRead(CanBuffer &msgs,
119 virtual bool canWrite(
const CanBuffer &msgs,
128 virtual bool open(yarp::os::Searchable &par);
129 virtual bool close();
132 virtual CanBuffer createBuffer(
int elem)
134 return CanBufferFactoryImpl<PlxCanMessage, PLXCAN_MSG>::createBuffer(elem);
137 virtual void destroyBuffer(CanBuffer &buffer)
140 CanBufferFactoryImpl<PlxCanMessage, PLXCAN_MSG>::destroyBuffer(buffer);
virtual unsigned char * getData()
virtual const unsigned char * getPointer() const
virtual void setBuffer(unsigned char *b)
virtual void setLen(unsigned char len)
virtual CanMessage & operator=(const CanMessage &l)
virtual unsigned char getLen() const
virtual unsigned char * getPointer()
virtual void setId(unsigned int id)
virtual const unsigned char * getData() const
virtual unsigned int getId() const
pcan : implements yarp::dev::ICanBus for a "plx based" can bus device (cfw pc104 card).
virtual bool canRead(CanBuffer &msgs, unsigned int size, unsigned int *read, bool wait=false)
virtual bool open(yarp::os::Searchable &par)
virtual bool canSetBaudRate(unsigned int rate)
virtual bool canIdDelete(unsigned int id)
virtual bool canGetErrors(CanErrors &errs)
virtual bool canIdAdd(unsigned int id)
virtual bool canGetBaudRate(unsigned int *rate)
virtual bool canWrite(const CanBuffer &msgs, unsigned int size, unsigned int *sent, bool wait=false)
Copyright (C) 2008 RobotCub Consortium.