INFM HIL Interface
Interface between Artery simulation and DuTs
BmwCodec.h
1
28#ifndef SIM_TO_DUT_INTERFACE_BMWCODEC_H
29#define SIM_TO_DUT_INTERFACE_BMWCODEC_H
30
31// Project includes
32#include "CodecUtilities.h"
33#include "../CANConnectorCodec.h"
34
35// System includes
36#include <map>
37
41#define V_VEHCOG_SCALING 0.015625
42#define V_VEHCOG_OFFSET 0
43#define VYAWVEH_SCALING 0.005
44#define VYAWVEH_OFFSET -163.84
45#define ACLNYCOG_SCALING 0.002
46#define ACLNYCOG_OFFSET -65
47#define ACLNXCOG_SCALING 0.002
48#define ACLNXCOG_OFFSET -65
49
53#define ST_LONGNAVI_SCALING 0.00000008
54#define ST_LONGNAVI_OFFSET 0
55#define ST_LATNAVI_SCALING 0.00000008
56#define ST_LATNAVI_OFFSET 0
57
61#define ST_HGNAVI_SCALING 1
62#define ST_HGNAVI_OFFSET 0
63#define ST_HDG_HRZTLABSL_SCALING 1.5
64#define ST_HDG_HRZTLABSL_OFFSET 0
65#define DVCOVEH_SCALING 1
66#define DVCOVEH_OFFSET 0
67
71#define GESCHWINDIGKEIT_SENDOPERATION "GESCHWINDIGKEIT"
72
76#define GPS_LOCA_SENDOPERATION "GPS_LOCA"
77
81#define GPS_LOCB_SENDOPERATION "GPS_LOCB"
82
86#define LICHTER_SENDOPERATION "LICHTER"
87
89
95 class BmwCodec : public CANConnectorCodec {
96
97 public:
98
102 BmwCodec();
103
111 std::pair<std::vector<__u8>, std::string> convertSimEventToFrame(SimEvent event) override;
112
121 std::vector<SimEvent> convertFrameToSimEvent(struct canfd_frame frame, bool isCanfd) override;
122
123 private:
124
132 std::pair<std::vector<__u8>, std::string> encodeGeschwindigkeit(SimEvent event);
133
141 std::pair<std::vector<__u8>, std::string> encodeGPS_LOCA(SimEvent event);
142
150 std::pair<std::vector<__u8>, std::string> encodeGPS_LOCB(SimEvent event);
151
159 std::pair<std::vector<__u8>, std::string> encodeLichter(SimEvent event);
160
167 std::vector<SimEvent> decodeGeschwindigkeit(struct canfd_frame frame, bool isCanfd);
168
175 std::vector<SimEvent> decodeGPS_LOCA(struct canfd_frame frame, bool isCanfd);
176
183 std::vector<SimEvent> decodeGPS_LOCB(struct canfd_frame frame, bool isCanfd);
184
191 std::vector<SimEvent> decodeLichter(struct canfd_frame frame, bool isCanfd);
192
193 bool hostIsBigEndian;
194 std::map<std::string, double> cachedSimEventValues;
195 };
196
197}
198
199#endif //SIM_TO_DUT_INTERFACE_BMWCODEC_H
Event object used to communicate between simulation and DuTs.
Definition: SimEvent.h:47
Implements the Codec for the BMW DuT.
Definition: BmwCodec.h:95
BmwCodec()
Definition: BmwCodec.cpp:33
std::pair< std::vector< __u8 >, std::string > convertSimEventToFrame(SimEvent event) override
Definition: BmwCodec.cpp:54
std::vector< SimEvent > convertFrameToSimEvent(struct canfd_frame frame, bool isCanfd) override
Definition: BmwCodec.cpp:76
The CAN Connector Codec defines the interface that each codec implementation must fulfill.
Definition: CANConnectorCodec.h:44
Definition: CANConnector.cpp:29