yarp-devices
SocketCanMessage.hpp
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 #ifndef __SOCKET_CAN_MESSAGE__
4 #define __SOCKET_CAN_MESSAGE__
5 
6 #include <linux/can.h>
7 
8 #include <yarp/dev/CanBusInterface.h>
9 
10 namespace roboticslab
11 {
12 
17 class SocketCanMessage : public yarp::dev::CanMessage
18 {
19 public:
20  SocketCanMessage() : message(nullptr)
21  {}
22 
23  yarp::dev::CanMessage & operator=(const yarp::dev::CanMessage & l) override;
24 
25  unsigned int getId() const override;
26  unsigned char getLen() const override;
27  void setLen(unsigned char len) override;
28  void setId(unsigned int id) override;
29  const unsigned char * getData() const override;
30  unsigned char * getData() override;
31  unsigned char * getPointer() override;
32  const unsigned char * getPointer() const override;
33  void setBuffer(unsigned char * buf) override;
34 
35 private:
36  struct can_frame * message;
37 };
38 
39 } // namespace roboticslab
40 
41 #endif // __SOCKET_CAN_MESSAGE__
YARP wrapper for SocketCAN messages.
Definition: SocketCanMessage.hpp:18
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:6