etsi_its_messages
v3.5.0
Toggle main menu visibility
Loading...
Searching...
No Matches
denm_utils.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_DENM_DENM_UTILS_H
10
#define ETSI_ITS_MSGS_UTILS_IMPL_DENM_DENM_UTILS_H
11
12
#include <
etsi_its_msgs_utils/impl/constants.h
>
13
21
inline
uint64_t
getUnixNanosecondsFromReferenceTime
(
const
TimestampIts& reference_time) {
22
double
unix_time_with_leap_seconds = reference_time.value * 1e-3 + etsi_its_msgs::UNIX_SECONDS_2004;
23
uint16_t n_leap_seconds =
24
etsi_its_msgs::getLeapSecondInsertionsSince2004
(
static_cast<
uint64_t
>
(unix_time_with_leap_seconds));
25
return
(unix_time_with_leap_seconds - n_leap_seconds) * 1e9;
26
}
27
28
#endif
// ETSI_ITS_MSGS_UTILS_IMPL_DENM_DENM_UTILS_H
constants.h
File containing constants that are used in the context of ETIS ITS Messages.
etsi_its_msgs::getLeapSecondInsertionsSince2004
uint16_t getLeapSecondInsertionsSince2004(const uint64_t unix_seconds)
Get the leap second insertions since 2004 for given unix seconds.
Definition
constants.h:37
getUnixNanosecondsFromReferenceTime
uint64_t getUnixNanosecondsFromReferenceTime(const TimestampIts &reference_time)
Get the Unix-Nanoseconds from a given ReferenceTime object.
Definition
denm_utils.h:21
etsi_its_msgs_utils
include
etsi_its_msgs_utils
impl
denm
denm_utils.h
Generated by
1.17.0