26 #ifndef __SOCKETCANH__
27 #define __SOCKETCANH__
29 #include <yarp/dev/DeviceDriver.h>
30 #include <yarp/dev/CanBusInterface.h>
33 #include <sys/types.h>
34 #include <sys/socket.h>
35 #include <linux/can.h>
36 #include <linux/can/raw.h>
41 class SocketCanMessage;
48 struct can_frame *
msg;
63 memcpy(
msg,
tmp.msg,
sizeof(
struct can_frame));
67 virtual unsigned int getId()
const
68 {
return msg->can_id;}
71 {
return msg->can_dlc;}
73 virtual void setLen(
unsigned char len)
76 virtual void setId(
unsigned int id)
79 virtual const unsigned char *
getData()
const
86 {
return (
unsigned char *)
msg; }
89 {
return (
const unsigned char *)
msg; }
119 virtual bool canIdAdd(
unsigned int id);
122 virtual bool canRead(CanBuffer &msgs,
127 virtual bool canWrite(
const CanBuffer &msgs,
133 virtual bool open(yarp::os::Searchable &par);
134 virtual bool close();
virtual CanMessage & operator=(const CanMessage &l)
virtual const unsigned char * getPointer() const
virtual unsigned char getLen() const
virtual const unsigned char * getData() const
virtual void setLen(unsigned char len)
virtual unsigned char * getData()
virtual void setId(unsigned int id)
virtual ~SocketCanMessage()
virtual unsigned int getId() const
virtual void setBuffer(unsigned char *b)
virtual unsigned char * getPointer()
socketcan : implements yarp::dev::ICanBus for a linux socketcan.
virtual bool canIdAdd(unsigned int id)
virtual bool canRead(CanBuffer &msgs, unsigned int size, unsigned int *read, bool wait=false)
virtual bool canWrite(const CanBuffer &msgs, unsigned int size, unsigned int *sent, bool wait=false)
virtual bool open(yarp::os::Searchable &par)
virtual bool canIdDelete(unsigned int id)
virtual bool canSetBaudRate(unsigned int rate)
virtual bool canGetBaudRate(unsigned int *rate)
bool read(yarp::os::Searchable &cfgtotal, pc104Data &pc104data)
Copyright (C) 2008 RobotCub Consortium.