INFM HIL Interface
Interface between Artery simulation and DuTs
SimComHandler.h
1
28#ifndef SIM_TO_DUT_INTERFACE_SIMCOMHANDLER_H
29#define SIM_TO_DUT_INTERFACE_SIMCOMHANDLER_H
30
31#include "../Events/SimEvent.h"
32#include "../SystemConfig.h"
33#include "../SimToDuTInterface.h"
34#include <zmq.hpp>
35
36namespace sim_interface {
37 // Forward declaration to avoid looping
38 class SimToDuTInterface;
39
47 public:
48
67 SimComHandler(SimToDuTInterface *interface, const SystemConfig &config);
68
74
88 void sendEventToSim(const SimEvent &simEvent);
89
108 void receive();
109
145 void getConfig();
146
155 RESTDummyConnector,
156 CANConnector,
157 V2XConnector,
158 Invalid_Connector
159 };
160
165 connectorType resolveConnectorTypeForSwitch(std::string connectorTypeS);
166
170 void run();
171
176
181
186
190 void close();
191
192
193 private:
199 void sendEventToInterface(const SimEvent &simEvent);
200
201 zmq::socket_t socketSimSub_;
202 zmq::socket_t socketSimPub_;
203 zmq::socket_t socketSimSubConfig_;
204 std::string socketSimAddressSub;
205 std::string socketSimAddressPub;
206 std::string socketSimAddressReceiverConfig;
207 std::thread simComHandlerThread;
208 bool stopThread = true;
209 SimToDuTInterface *interface;
210 };
211}
212
213#endif //SIM_TO_DUT_INTERFACE_SIMCOMHANDLER_H
Handler between interface and simulation. Responsible for sending/receiving SimEvents to/from the sim...
Definition: SimComHandler.h:46
void sendEventToSim(const SimEvent &simEvent)
connectorType resolveConnectorTypeForSwitch(std::string connectorTypeS)
SimComHandler(SimToDuTInterface *interface, const SystemConfig &config)
connectorType
Definition: SimComHandler.h:154
Event object used to communicate between simulation and DuTs.
Definition: SimEvent.h:47
An interface between a simulation and multiple DuT devices.
Definition: SimToDuTInterface.h:42
Contains the config for the SimComHandler, the SimToDuTInterface and the Logger.
Definition: SystemConfig.h:40
Definition: CANConnector.cpp:29