yarp-devices
ICanBusSharer.hpp
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 #ifndef __I_CAN_BUS_SHARER_HPP__
4 #define __I_CAN_BUS_SHARER_HPP__
5 
6 #include <vector>
7 
8 #include "ICanMessageNotifier.hpp"
9 #include "ICanSenderDelegate.hpp"
10 
11 namespace roboticslab
12 {
13 
25 {
26 public:
28  virtual ~ICanBusSharer() = default;
29 
31  virtual unsigned int getId() = 0;
32 
34  virtual std::vector<unsigned int> getAdditionalIds()
35  { return {}; }
36 
38  virtual bool initialize() = 0;
39 
41  virtual bool finalize() = 0;
42 
44  virtual bool registerSender(ICanSenderDelegate * sender) = 0;
45 
47  virtual bool synchronize(double timestamp) = 0;
48 };
49 
50 } // namespace roboticslab
51 
52 #endif // __I_CAN_BUS_SHARER_HPP__
Abstract base for a CAN bus sharer.
Definition: ICanBusSharer.hpp:25
virtual bool registerSender(ICanSenderDelegate *sender)=0
Pass a handle to a CAN sender delegate instance.
virtual bool finalize()=0
Finalize CAN node communications.
virtual bool initialize()=0
Perform CAN node initialization.
virtual bool synchronize(double timestamp)=0
Perform synchronized action on CAN master's request.
virtual std::vector< unsigned int > getAdditionalIds()
Retrieve more associated CAN node IDs, if any.
Definition: ICanBusSharer.hpp:34
virtual ~ICanBusSharer()=default
Destructor.
virtual unsigned int getId()=0
Retrieve CAN node ID.
Implementation-agnostic consumer for RX CAN transfers.
Definition: ICanMessageNotifier.hpp:22
Implementation-agnostic consumer for TX CAN transfers.
Definition: ICanSenderDelegate.hpp:22
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:6