Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
IPCommunicationDriver.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_COMMS_IP_IPCOMMUNICATIONDRIVER_HPP_
2#define IV_SRC_COMMS_IP_IPCOMMUNICATIONDRIVER_HPP_
3
6#include "comms/ip/enums.hpp"
7
8#include <set>
9
10namespace iv::comms::ip
11{
12
14{
15public:
18 const iv::comms::ip::eIpNetworkRole &networkRole,
19 const std::set<iv::types::ipAddress> &validIPs);
20 ~IPCommunicationDriver() override;
21
22 void configure(const iv::model::comms::NetworkData &commConfig) override;
23
24 iv::comms::eResponse init() override;
25 iv::comms::eResponse end() override;
27 iv::comms::eResponse start() override;
28 iv::comms::eResponse stop() override;
29
30 [[nodiscard]] iv::comms::eResponse receive(std::vector<std::byte> &buffer, iv::types::ipAddress *ip,
31 iv::types::ipPort *port);
32 iv::comms::eResponse send(const std::vector<std::byte> &data, const iv::types::ipAddress &ip,
34
35 bool isOnline() override;
36
37 std::set<std::string> m_validIPs;
40
41private:
43
45
48
49 std::mutex m_driverMutex;
50
52};
53
54}// namespace iv::comms::ip
55
56#endif//IV_SRC_COMMS_IP_IPCOMMUNICATIONDRIVER_HPP_
Definition ICommunicationDriver.hpp:13
Definition IPCommunicationDriver.hpp:14
iv::comms::eResponse receive(std::vector< std::byte > &buffer, iv::types::ipAddress *ip, iv::types::ipPort *port)
Definition IPCommunicationDriver.cpp:190
iv::model::comms::net::eIpProtocolLayer m_protocolLayer
Definition IPCommunicationDriver.hpp:46
void configure(const iv::model::comms::NetworkData &commConfig) override
Definition IPCommunicationDriver.cpp:32
iv::comms::eResponse stop() override
Definition IPCommunicationDriver.cpp:172
std::set< std::string > m_validIPs
Definition IPCommunicationDriver.hpp:37
iv::comms::eResponse end() override
Definition IPCommunicationDriver.cpp:106
iv::comms::eResponse reconnect() override
Definition IPCommunicationDriver.cpp:113
iv::types::timestamp m_lastTimePacketReceived
Definition IPCommunicationDriver.hpp:42
bool isOnline() override
Definition IPCommunicationDriver.cpp:263
iv::comms::ip::ITransportProtocol * m_socketOpt
Definition IPCommunicationDriver.hpp:51
std::mutex m_driverMutex
Definition IPCommunicationDriver.hpp:49
~IPCommunicationDriver() override
Definition IPCommunicationDriver.cpp:23
iv::types::ipPort m_port
Definition IPCommunicationDriver.hpp:39
iv::types::ipAddress m_ip
Definition IPCommunicationDriver.hpp:38
IPCommunicationDriver(const iv::model::comms::net::eIpProtocolLayer &protocolLayer, const iv::comms::ip::eIpNetworkRole &networkRole, const std::set< iv::types::ipAddress > &validIPs)
iv::comms::ip::eIpNetworkRole m_networkRole
Definition IPCommunicationDriver.hpp:47
iv::comms::eResponse init() override
Definition IPCommunicationDriver.cpp:95
uint64_t m_readingRetriesWithoutData
Definition IPCommunicationDriver.hpp:44
iv::comms::eResponse start() override
Definition IPCommunicationDriver.cpp:149
iv::comms::eResponse send(const std::vector< std::byte > &data, const iv::types::ipAddress &ip, iv::types::ipPort port)
Definition IPCommunicationDriver.cpp:244
Definition ITransportProtocol.hpp:13
Definition enums.hpp:5
eIpNetworkRole
Definition enums.hpp:8
eResponse
Definition enums.hpp:285
eIpProtocolLayer
Definition IpSettings.hpp:11
uint64_t timestamp
Definition types.hpp:21
uint16_t ipPort
Definition types.hpp:41
std::string ipAddress
Definition types.hpp:40
Definition NetworkData.hpp:18