Setter functions for the ETSI ITS Common Data Dictionary (CDD) v2.1.1.
More...
Go to the source code of this file.
|
void | setStationId (StationId &station_id, const uint32_t id_value) |
| Set the Station Id object.
|
|
void | setItsPduHeader (ItsPduHeader &header, const uint8_t message_id, const uint32_t station_id, const uint8_t protocol_version=0) |
| Set the Its Pdu Header object.
|
|
void | setStationType (TrafficParticipantType &station_type, const uint8_t value) |
| Set the Station Type.
|
|
void | setLongitudinalAccelerationValue (AccelerationValue &accel, const double value) |
| Set the LongitudinalAccelerationValue object.
|
|
void | setLongitudinalAcceleration (AccelerationComponent &accel, const double value) |
| Set the LongitudinalAcceleration object.
|
|
void | setLateralAccelerationValue (AccelerationValue &accel, const double value) |
| Set the LateralAccelerationValue object.
|
|
void | setLateralAcceleration (AccelerationComponent &accel, const double value) |
| Set the LateralAcceleration object.
|
|
Setter functions for the ETSI ITS Common Data Dictionary (CDD) v2.1.1.
Definition in file cdd_v2-1-1_setters.h.
◆ setItsPduHeader()
void setItsPduHeader |
( |
ItsPduHeader & | header, |
|
|
const uint8_t | message_id, |
|
|
const uint32_t | station_id, |
|
|
const uint8_t | protocol_version = 0 ) |
|
inline |
Set the Its Pdu Header object.
- Parameters
-
header | ItsPduHeader to be set |
message_id | ID of the message |
station_id | |
protocol_version | |
Definition at line 59 of file cdd_v2-1-1_setters.h.
60 {
63 header.message_id.value = message_id;
64 throwIfOutOfRange(protocol_version, OrdinalNumber1B::MIN, OrdinalNumber1B::MAX,
"ProtocolVersion");
65 header.protocol_version.value = protocol_version;
66}
void setStationId(StationId &station_id, const uint32_t id_value)
Set the Station Id object.
void throwIfOutOfRange(const T1 &val, const T2 &min, const T2 &max, const std::string val_desc)
Throws an exception if a given value is out of a defined range.
◆ setLateralAcceleration()
void setLateralAcceleration |
( |
AccelerationComponent & | accel, |
|
|
const double | value ) |
|
inline |
Set the LateralAcceleration object.
AccelerationConfidence is set to UNAVAILABLE
- Parameters
-
accel | object to set |
value | LaterallAccelerationValue in m/s^2 as decimal number (left is positive) |
Definition at line 134 of file cdd_v2-1-1_setters.h.
134 {
135 accel.confidence.value = AccelerationConfidence::UNAVAILABLE;
137}
void setLateralAccelerationValue(AccelerationValue &accel, const double value)
Set the LateralAccelerationValue object.
◆ setLateralAccelerationValue()
void setLateralAccelerationValue |
( |
AccelerationValue & | accel, |
|
|
const double | value ) |
|
inline |
Set the LateralAccelerationValue object.
- Parameters
-
accel | object to set |
value | LateralAccelerationValue in m/s^2 as decimal number (left is positive) |
Definition at line 115 of file cdd_v2-1-1_setters.h.
115 {
116 int64_t accel_val = (int64_t)std::round(value * 1e1);
117 if (accel_val >= AccelerationValue::MIN && accel_val <= AccelerationValue::MAX) {
118 accel.value = accel_val;
119 } else if (accel_val < AccelerationValue::MIN) {
120 accel.value = AccelerationValue::MIN;
121 } else if (accel_val > AccelerationValue::MAX) {
122 accel.value = AccelerationValue::MAX - 1;
123 }
124}
◆ setLongitudinalAcceleration()
void setLongitudinalAcceleration |
( |
AccelerationComponent & | accel, |
|
|
const double | value ) |
|
inline |
Set the LongitudinalAcceleration object.
AccelerationConfidence is set to UNAVAILABLE
- Parameters
-
accel | object to set |
value | LongitudinalAccelerationValue in m/s^2 as decimal number (braking is negative) |
Definition at line 104 of file cdd_v2-1-1_setters.h.
104 {
105 accel.confidence.value = AccelerationConfidence::UNAVAILABLE;
107}
void setLongitudinalAccelerationValue(AccelerationValue &accel, const double value)
Set the LongitudinalAccelerationValue object.
◆ setLongitudinalAccelerationValue()
void setLongitudinalAccelerationValue |
( |
AccelerationValue & | accel, |
|
|
const double | value ) |
|
inline |
Set the LongitudinalAccelerationValue object.
- Parameters
-
accel | object to set |
value | LongitudinalAccelerationValue in m/s^2 as decimal number (braking is negative) |
Definition at line 85 of file cdd_v2-1-1_setters.h.
85 {
86 int64_t accel_val = (int64_t)std::round(value * 1e1);
87 if (accel_val >= AccelerationValue::MIN && accel_val <= AccelerationValue::MAX) {
88 accel.value = accel_val;
89 } else if (accel_val < AccelerationValue::MIN) {
90 accel.value = AccelerationValue::MIN;
91 } else if (accel_val > AccelerationValue::MAX) {
92 accel.value = AccelerationValue::MAX - 1;
93 }
94}
◆ setStationId()
void setStationId |
( |
StationId & | station_id, |
|
|
const uint32_t | id_value ) |
|
inline |
Set the Station Id object.
- Parameters
-
Definition at line 46 of file cdd_v2-1-1_setters.h.
46 {
48 station_id.value = id_value;
49}
◆ setStationType()
void setStationType |
( |
TrafficParticipantType & | station_type, |
|
|
const uint8_t | value ) |
|
inline |
Set the Station Type.
- Parameters
-
Definition at line 74 of file cdd_v2-1-1_setters.h.
74 {
75 throwIfOutOfRange(value, TrafficParticipantType::MIN, TrafficParticipantType::MAX,
"StationType");
76 station_type.value = value;
77}