ecuTypes.h
Go to the documentation of this file.
1 
4 
7 #pragma once
8 
9 #include <string>
10 #include <vector>
11 #include <boost/system/error_code.hpp>
12 
18 namespace dpyEcu {
19 
21 struct Protocol
22 {
23  std::string name;
24  std::string version;
25 };
26 
28 struct Parameter
29 {
30  std::string timestamp;
31  std::string id;
32  std::string value;
33  std::string units;
34 };
35 
38 {
39  uint32_t timestamp;
40  bool is_remote;
41  bool is_ext;
42  bool is_error;
43  uint32_t id;
44  uint32_t data_size;
45  std::string data;
46 };
47 
50 {
51  RESET = 0, //<! Reset filters
52  ADD = 1, //<! Add filter
53  REMOVE = 2 //<! Remove filter
54 };
55 
58 {
59  STANDARD = 0, //<! Standard frame
60  EXTENDED = 1, //<! Extended frame
61  J1939 = 2, //<! J1939 frame
62  CUSTOM = 3 //<! CUSTOM frame
63 };
64 
67 {
68  NA = 0,
69  ENABLE = 1,
70  DISABLE = 2,
71 };
72 
75  uint32_t baudrate;
77 };
78 
79 /*
80  * @brief Structure containing ECU information
81  */
82 struct ECUInfoConf {
83  std::string type;
84  std::string interface="";
85  int baud;
86  CANBusResistor canBusResistor = dpyEcu::CANBusResistor::NA;
88  int timeout_ms;
90  int usleep;
91 };
92 
95 {
97  uint32_t can_id;
98  uint32_t can_mask;
99 };
100 
101 //-----------------------------Alarm event -----------------------------//
102 
105 {
108 };
109 
111 struct Alarm
112 {
114  std::string parameterId;
115  int32_t threshold;
116 };
117 
120 {
123 };
124 
125 }
CANBusIdType id_type
CAN bus frame type.
Definition: ecuTypes.h:96
bool is_ext
Frame type (STD or EXT)
Definition: ecuTypes.h:41
std::string timestamp
timestamp of the info requested
Definition: ecuTypes.h:30
Alarm info.
Definition: ecuTypes.h:111
CAN BUS configuration structure.
Definition: ecuTypes.h:74
std::string value
value obtained
Definition: ecuTypes.h:32
uint32_t can_id
CAN Bus ID.
Definition: ecuTypes.h:97
std::string data
CAN Frame data.
Definition: ecuTypes.h:45
uint32_t id
CAN Frame ID field (usually represented as a hex number)).
Definition: ecuTypes.h:43
Parameter parameterInfo
information of the parameter
Definition: ecuTypes.h:122
ECU Protocol info.
Definition: ecuTypes.h:21
CANBusResistor canBusResistor
CAN bus resistor.
Definition: ecuTypes.h:76
bool is_error
CAN Frame Error State Indicator.
Definition: ecuTypes.h:42
uint32_t timestamp
Frame timestamp.
Definition: ecuTypes.h:39
bool is_remote
Frame type (DATA or REMOTE)
Definition: ecuTypes.h:40
std::string type
ECU type (serial_socket, can_socket, serial_port)
Definition: ecuTypes.h:83
uint32_t baudrate
CAN bus Baudrate.
Definition: ecuTypes.h:75
int max_lenth_buff
Gpio default value.
Definition: ecuTypes.h:87
Can bus filter structure.
Definition: ecuTypes.h:94
Parameter information.
Definition: ecuTypes.h:28
Alarm when the state of the param changes.
Definition: ecuTypes.h:106
int usleep
Gpio default value.
Definition: ecuTypes.h:90
CANBusIdType
CAN bus frame type.
Definition: ecuTypes.h:57
AlarmType
Type of ECU alarm.
Definition: ecuTypes.h:104
int baud
Gpio default value.
Definition: ecuTypes.h:85
CANBusResistor
CAN bus frame type.
Definition: ecuTypes.h:66
uint32_t can_mask
CAN Bus Mask.
Definition: ecuTypes.h:98
Deepsy ECU namespace that includes the different enums, structs or method signatures that should be u...
Definition: ecuApi.h:14
std::string version
version
Definition: ecuTypes.h:24
It contains the CAN Bus Frame structure.
Definition: ecuTypes.h:37
int update_time_s
Gpio default value.
Definition: ecuTypes.h:89
Alarm event.
Definition: ecuTypes.h:119
std::string units
units obtained
Definition: ecuTypes.h:33
std::string name
name of the protocol
Definition: ecuTypes.h:23
Definition: ecuTypes.h:82
int32_t threshold
threshold set
Definition: ecuTypes.h:115
std::string id
identifier of the parameter
Definition: ecuTypes.h:31
AlarmType type
Type of the alarm.
Definition: ecuTypes.h:113
std::string parameterId
ID of the parameter.
Definition: ecuTypes.h:114
Alarm alarmInfo
information of the alarm
Definition: ecuTypes.h:121
Alarm set by threshold.
Definition: ecuTypes.h:107
CANBusFilterOperation
CAN bus filter operation.
Definition: ecuTypes.h:49
uint32_t data_size
CAN Frame data size.
Definition: ecuTypes.h:44
int timeout_ms
Gpio default value.
Definition: ecuTypes.h:88