32#ifndef ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V1_3_1_SETTERS_H
33#define ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V1_3_1_SETTERS_H
37#include <GeographicLib/UTMUPS.hpp>
48inline void setItsPduHeader(ItsPduHeader& header,
const uint8_t message_id,
const uint32_t station_id,
49 const uint8_t protocol_version = 0) {
51 throwIfOutOfRange(message_id, ItsPduHeader::MESSAGE_ID_MIN, ItsPduHeader::MESSAGE_ID_MAX,
"MessageID");
52 header.message_id = message_id;
53 throwIfOutOfRange(protocol_version, ItsPduHeader::PROTOCOL_VERSION_MIN, ItsPduHeader::PROTOCOL_VERSION_MAX,
55 header.protocol_version = protocol_version;
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.