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 60 of file cdd_v2-1-1_setters.h.
61 {
63 throwIfOutOfRange(message_id, MessageId::MIN, MessageId::MAX, "MessageID");
64 header.message_id.value = message_id;
65 throwIfOutOfRange(protocol_version, OrdinalNumber1B::MIN, OrdinalNumber1B::MAX, "ProtocolVersion");
66 header.protocol_version.value = protocol_version;
67}
void setStationId(StationId &station_id, const uint32_t id_value)
Set the Station Id object.
◆ 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 135 of file cdd_v2-1-1_setters.h.
135 {
136 accel.confidence.value = AccelerationConfidence::UNAVAILABLE;
138}
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 116 of file cdd_v2-1-1_setters.h.
116 {
117 int64_t accel_val = (int64_t)std::round(value * 1e1);
118 if (accel_val >= AccelerationValue::MIN && accel_val <= AccelerationValue::MAX) {
119 accel.value = accel_val;
120 } else if (accel_val < AccelerationValue::MIN) {
121 accel.value = AccelerationValue::MIN;
122 } else if (accel_val > AccelerationValue::MAX) {
123 accel.value = AccelerationValue::MAX - 1;
124 }
125}
◆ 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 105 of file cdd_v2-1-1_setters.h.
105 {
106 accel.confidence.value = AccelerationConfidence::UNAVAILABLE;
108}
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 86 of file cdd_v2-1-1_setters.h.
86 {
87 int64_t accel_val = (int64_t)std::round(value * 1e1);
88 if (accel_val >= AccelerationValue::MIN && accel_val <= AccelerationValue::MAX) {
89 accel.value = accel_val;
90 } else if (accel_val < AccelerationValue::MIN) {
91 accel.value = AccelerationValue::MIN;
92 } else if (accel_val > AccelerationValue::MAX) {
93 accel.value = AccelerationValue::MAX - 1;
94 }
95}
◆ setStationId()
void setStationId |
( |
StationId & | station_id, |
|
|
const uint32_t | id_value ) |
|
inline |
Set the Station Id object.
- Parameters
-
Definition at line 47 of file cdd_v2-1-1_setters.h.
47 {
48 throwIfOutOfRange(id_value, StationId::MIN, StationId::MAX, "StationId");
49 station_id.value = id_value;
50}
◆ setStationType()
void setStationType |
( |
TrafficParticipantType & | station_type, |
|
|
const uint8_t | value ) |
|
inline |
Set the Station Type.
- Parameters
-
Definition at line 75 of file cdd_v2-1-1_setters.h.
75 {
76 throwIfOutOfRange(value, TrafficParticipantType::MIN, TrafficParticipantType::MAX, "StationType");
77 station_type.value = value;
78}