Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
SocketCanSettings.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_MODEL_COMMS_SOCKETCANSETTINGS_HPP_
2#define IV_SRC_MODEL_COMMS_SOCKETCANSETTINGS_HPP_
3
5
7{
8
9enum class eBoardType
10{
11 Usb,
12 UsbFd,
13 UsbPro,
14 UsbX6,
16};
17
19{
24};
25
26enum class eBaudRate
27{
28 BR5,
29 BR10,
30 BR20,
31 BR50,
32 BR100,
33 BR125,
34 BR250,
35 BR500,
36 BR1000,
37 First = BR5,
38 Last = BR1000
39};
40
42{
44 UsbDeviceSettings(iv::model::comms::socketcan::eBoardType boardType, std::string device, uint32_t hwPort,
48 UsbDeviceSettings(UsbDeviceSettings &&other) noexcept;
50
53
54 bool load(const iv::file::xml::node &node);
55 bool save(iv::file::xml::node &node) const;
56
58 std::string _interface;
60
61private:
62 struct Keys
63 {
64 static constexpr std::string_view socketCanBoardType {"BoardType"};
65 static constexpr std::string_view socketCanDevice {"Device"};
66 static constexpr std::string_view socketCanHwPort {"HwPort"};
67 static constexpr std::string_view socketCanOperationMode {"OperationMode"};
68 static constexpr std::string_view socketCanBusTimingRegister {"BusTimingRegister"};
69 };
70
72 {
73 static constexpr std::string string {};
74 static constexpr std::string interface {"can0"};
75 };
76};
77
79{
82 iv::types::ipAddress gatewayAddress, iv::types::ipPort gatewayPort);
86
89
90 bool load(const iv::file::xml::node &node);
91 bool save(iv::file::xml::node &node) const;
92
93 iv::types::ipAddress _stationAddress;//IP address for reception of can packets from gateway
94 iv::types::ipPort _stationPort; //Port for reception of can packets from gateway
95 iv::types::ipAddress _gatewayAddress;//IP address of the gateway used to send packets to can bus
96 iv::types::ipPort _gatewayPort; //Port used to send packets to can bus
97
98private:
99 struct Keys
100 {
101 static constexpr std::string_view stationIpAddress {"StationIpAddress"};
102 static constexpr std::string_view stationPort {"StationPort"};
103 static constexpr std::string_view gatewayIpAddress {"GatewayIpAddress"};
104 static constexpr std::string_view gatewayPort {"GatewayPort"};
105 };
106};
107
108}// namespace iv::model::comms::socketcan
109
110#endif//IV_SRC_MODEL_COMMS_SOCKETCANSETTINGS_HPP_
Definition xmlFile.hpp:15
Definition SocketCanSettings.cpp:8
eOperationMode
Definition SocketCanSettings.hpp:19
eBoardType
Definition SocketCanSettings.hpp:10
eBaudRate
Definition SocketCanSettings.hpp:27
uint16_t ipPort
Definition types.hpp:41
std::string ipAddress
Definition types.hpp:40
static constexpr std::string_view stationPort
Definition SocketCanSettings.hpp:102
static constexpr std::string_view gatewayPort
Definition SocketCanSettings.hpp:104
static constexpr std::string_view gatewayIpAddress
Definition SocketCanSettings.hpp:103
static constexpr std::string_view stationIpAddress
Definition SocketCanSettings.hpp:101
Definition SocketCanSettings.hpp:79
iv::types::ipPort _gatewayPort
Definition SocketCanSettings.hpp:96
PCanEthGatewaySettings & operator=(const PCanEthGatewaySettings &other)
Definition SocketCanSettings.cpp:100
bool load(const iv::file::xml::node &node)
Definition SocketCanSettings.cpp:126
PCanEthGatewaySettings()
Definition SocketCanSettings.cpp:78
iv::types::ipAddress _stationAddress
Definition SocketCanSettings.hpp:93
PCanEthGatewaySettings(const PCanEthGatewaySettings &other)
iv::types::ipAddress _gatewayAddress
Definition SocketCanSettings.hpp:95
iv::types::ipPort _stationPort
Definition SocketCanSettings.hpp:94
bool save(iv::file::xml::node &node) const
Definition SocketCanSettings.cpp:135
Definition SocketCanSettings.hpp:63
static constexpr std::string_view socketCanBusTimingRegister
Definition SocketCanSettings.hpp:68
static constexpr std::string_view socketCanOperationMode
Definition SocketCanSettings.hpp:67
static constexpr std::string_view socketCanHwPort
Definition SocketCanSettings.hpp:66
static constexpr std::string_view socketCanBoardType
Definition SocketCanSettings.hpp:64
static constexpr std::string_view socketCanDevice
Definition SocketCanSettings.hpp:65
Definition SocketCanSettings.hpp:42
UsbDeviceSettings & operator=(const UsbDeviceSettings &other)
Definition SocketCanSettings.cpp:33
UsbDeviceSettings()
Definition SocketCanSettings.cpp:10
std::string _interface
Definition SocketCanSettings.hpp:58
iv::model::comms::socketcan::eBoardType _boardType
Definition SocketCanSettings.hpp:57
bool load(const iv::file::xml::node &node)
Definition SocketCanSettings.cpp:57
iv::model::comms::socketcan::eBaudRate _busTimingRegister
Definition SocketCanSettings.hpp:59
UsbDeviceSettings(const UsbDeviceSettings &other)
bool save(iv::file::xml::node &node) const
Definition SocketCanSettings.cpp:69