yarp-devices
PeakCanMessage.hpp
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 #ifndef __PEAK_CAN_MESSAGE__
4 #define __PEAK_CAN_MESSAGE__
5 
6 #include <yarp/dev/CanBusInterface.h>
7 
8 // upstream bug in the Peak API header, v8.5.1
9 #include <sys/time.h>
10 
11 #include <pcanfd.h>
12 
13 namespace roboticslab
14 {
15 
20 class PeakCanMessage : public yarp::dev::CanMessage
21 {
22 public:
24  ~PeakCanMessage() override;
25  yarp::dev::CanMessage & operator=(const yarp::dev::CanMessage & l) override;
26 
27  unsigned int getId() const override;
28  unsigned char getLen() const override;
29  void setLen(unsigned char len) override;
30  void setId(unsigned int id) override;
31  const unsigned char * getData() const override;
32  unsigned char * getData() override;
33  unsigned char * getPointer() override;
34  const unsigned char * getPointer() const override;
35  void setBuffer(unsigned char * buf) override;
36 
37 private:
38  struct pcanfd_msg * message;
39 };
40 
41 } // namespace roboticslab
42 
43 #endif // __PEAK_CAN_MESSAGE__
YARP wrapper for PeakCAN messages.
Definition: PeakCanMessage.hpp:21
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:6