etsi_its_messages v3.4.0
Loading...
Searching...
No Matches
denm_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#pragma once
10
12
13namespace etsi_its_denm_msgs::access {
14
16
18
21 *
22 * @param denm DENM-Message to set the ItsPduHeader
23 * @param station_id
24 * @param protocol_version
25 */
26inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
27 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
29
34
35 */
36inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
37 if (denm.denm.location_is_present) {
38 denm.denm.location.event_position_heading_is_present = presence_of_heading;
39 } else {
40 throw std::invalid_argument("LocationContainer is not present!");
41 }
42}
43
44
51 * @param value Heading value in degree as decimal number
52 * @param confidence standard deviation of heading in degree as decimal number (default: infinity, mapping to HeadingConfidence::UNAVAILABLE)
53 */
54inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
55 if (denm.denm.location_is_present) {
56 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
57 setIsHeadingPresent(denm, true);
58 } else {
59 throw std::invalid_argument("LocationContainer is not present!");
60 }
61}
63} // namespace etsi_its_denm_msgs::access
Setter functions for the ETSI ITS Common Data Dictionary (CDD) v1.3.1.
File containing constants that are used in the context of ETIS ITS Messages.
void setHeading(DENM &denm, const double heading_val, const double confidence=std::numeric_limits< double >::infinity())
Set the Heading for a DENM.
void setHeadingCDD(Heading &heading, const double value, double confidence=std::numeric_limits< double >::infinity())
Set the Heading object.
void setIsHeadingPresent(DENM &denm, bool presence_of_heading)
Set the IsHeadingPresent object for DENM.
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.
Common setter functions for the ETSI ITS DENM (EN and TS).