etsi_its_messages v3.4.0
Loading...
Searching...
No Matches
cdd_v1-3-1_setters.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright Institute for Automotive Engineering (ika), RWTH Aachen University
3
8
9#ifndef ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V1_3_1_SETTERS_H
10#define ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V1_3_1_SETTERS_H
11
14#include <GeographicLib/UTMUPS.hpp>
15#include <cstring>
16
25inline void setItsPduHeader(ItsPduHeader& header, const uint8_t message_id, const uint32_t station_id,
26 const uint8_t protocol_version = 0) {
27 setStationId(header.station_id, station_id);
28 throwIfOutOfRange(message_id, ItsPduHeader::MESSAGE_ID_MIN, ItsPduHeader::MESSAGE_ID_MAX, "MessageID");
29 header.message_id = message_id;
30 throwIfOutOfRange(protocol_version, ItsPduHeader::PROTOCOL_VERSION_MIN, ItsPduHeader::PROTOCOL_VERSION_MAX,
31 "ProtocolVersion");
32 header.protocol_version = protocol_version;
33}
34
35#endif // ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V1_3_1_SETTERS_H
Common setter functions for the ETSI ITS Common Data Dictionary (CDD) v1.3.1, v2.1....
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.
Sanity-check functions etc.
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.
Definition checks.h:23