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 "network_manager.h"
10#include <memory>
11
12namespace vsdk::comms {
17
49public:
54 explicit can_adapter(std::string_view name);
55 ~can_adapter() noexcept = default;
56
60 can_adapter(const can_adapter& other);
64 can_adapter& operator=(const can_adapter& other);
65
69 can_adapter(can_adapter&& other) noexcept = default;
73 can_adapter& operator=(can_adapter&& other) noexcept = default;
74
78 static std::vector<can_adapter> list_adapters();
79
83 std::string name() const;
84
93 bool start();
94
101 bool start(uint32_t default_bitrate);
102
108 bool stop();
109
113 bool restart();
114
119
125 bool set_bitrate(uint32_t bitrate);
126
130 uint32_t get_bitrate();
131
138
145 bool set_config(const can_parameters& param);
146
147private:
148 std::unique_ptr<can_adapter_interface> _impl;
149};
150
151
152} // namespace vsdk::comms
153
154#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:72
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_status
CAN Bus status values.
Definition can_common.h:46
Any entities that belong to the comms library.
Definition can_adapter.h:12
The network_manager interface.
CAN interface configuration parameters.
Definition can_adapter_interface.h:37