35#ifndef ETSI_ITS_MSGS_UTILS_IMPL_CAM_CAM_UTILS_H
36#define ETSI_ITS_MSGS_UTILS_IMPL_CAM_CAM_UTILS_H
46 const TimestampIts& timestamp_estimate) {
48 t_its.value = std::floor(timestamp_estimate.value / 65536) * 65536 + generation_delta_time.value;
49 throwIfOutOfRange(t_its.value, TimestampIts::MIN, TimestampIts::MAX,
"TimestampIts");
62 const GenerationDeltaTime& generation_delta_time,
const TimestampIts& timestamp_estimate,
63 const uint16_t n_leap_seconds = etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end()->second) {
65 return t_its.value * 1e6 + etsi_its_msgs::UNIX_SECONDS_2004 * 1e9 - n_leap_seconds * 1e9;
76 const GenerationDeltaTime& generation_delta_time,
const uint64_t unix_timestamp_estimate,
77 const uint16_t n_leap_seconds = etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end()->second) {
uint64_t getUnixNanosecondsFromGenerationDeltaTime(const GenerationDeltaTime &generation_delta_time, const TimestampIts ×tamp_estimate, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end() ->second)
Get the Unix-Nanoseconds from a given GenerationDeltaTime object.
TimestampIts getTimestampITSFromGenerationDeltaTime(const GenerationDeltaTime &generation_delta_time, const TimestampIts ×tamp_estimate)
Get the TimestampITS from a given GenerationDeltaTime object.
Sanity-check functions etc. for the ETSI ITS Common Data Dictionary (CDD)
void setTimestampITS(TimestampIts ×tamp_its, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end() ->second)
Set the TimestampITS object.
File containing constants that are used in the context of ETIS ITS Messages.