Veethree D7 SDK
Loading...
Searching...
No Matches
can_adapter.h
Go to the documentation of this file.
1
5#ifndef CAN_ADAPTER_H
6#define CAN_ADAPTER_H
7
9#include <memory>
10
11namespace vsdk::comms {
16
48public:
53 explicit can_adapter(std::string_view name);
54 ~can_adapter() noexcept = default;
55
59 can_adapter(const can_adapter& other);
63 can_adapter& operator=(const can_adapter& other);
64
68 can_adapter(can_adapter&& other) noexcept = default;
72 can_adapter& operator=(can_adapter&& other) noexcept = default;
73
77 static std::vector<can_adapter> list_adapters();
78
82 std::string name() const;
83
89 can_type type() const;
90
99 bool start();
100
107 bool start(uint32_t default_bitrate);
108
114 bool stop();
115
119 bool restart();
120
125
131 bool set_bitrate(uint32_t bitrate);
132
136 uint32_t get_bitrate();
137
144
151 bool set_config(const can_parameters& param);
152
153private:
154 std::unique_ptr<can_adapter_interface> _impl;
155};
156
157
158} // namespace vsdk::comms
159
160#endif // CAN_ADAPTER_H
CAN Adapter Interface.
Class for abstracting lower level interactions with the CAN interfaces. A concrete implementation may...
Definition can_adapter_interface.h:83
can_type type() const
Get the adapter type (physical or virtual)
bool start()
Bring the adapter up.
bool set_config(const can_parameters &param)
Set the configuration for this interface.
can_adapter(std::string_view name)
Constructor that uses the interface name.
bool stop()
Bring the adapter down.
bool restart()
Restart this interface.
uint32_t get_bitrate()
Get the current CAN bit rate.
void get_config(can_parameters &param)
Get the current configuration for this interface.
static std::vector< can_adapter > list_adapters()
Get all the CAN adapters.
can_status get_bus_state()
Get the current CAN Bus state.
std::string name() const
Get the adapter's name.
bool set_bitrate(uint32_t bitrate)
Set the CAN bit rate.
can_type
CAN adapter kinds.
Definition can_adapter_interface.h:38
can_status
CAN Bus status values.
Definition can_common.h:46
Any entities that belong to the comms library.
Definition can_adapter.h:11
CAN interface configuration parameters.
Definition can_adapter_interface.h:46