etsi_its_messages v3.5.0
Loading...
Searching...
No Matches
spatem_ts_utils.h File Reference

Utility functions for the ETSI ITS SPATEM. More...

#include <ctime>

Go to the source code of this file.

Enumerations

enum  time_mark_value_interpretation { normal , undefined , over_an_hour , leap_second }

Functions

uint64_t etsi_its_spatem_ts_msgs::access::getUnixSecondsOfYear (const uint64_t unixSecond)
 Get the unix seconds of the beginning of a year that corresponds to a given unix timestamp.
uint64_t etsi_its_spatem_ts_msgs::access::getUnixNanosecondsFromMinuteOfTheYear (const MinuteOfTheYear &moy, const uint64_t unix_nanoseconds_estimate)
 Get the unix nanoseconds from MinuteOfTheYear object.
float etsi_its_spatem_ts_msgs::access::interpretTimeIntervalConfidenceAsFloat (const uint16_t encoded_probability)
 Interprets the TimeIntervalConfidence type as a float value (see etsi definition).
std::array< float, 4 > etsi_its_spatem_ts_msgs::access::interpretMovementPhaseStateAsColor (const uint8_t value)
 Interprets the MovementPhaseState type as a color (see etsi definition).
time_mark_value_interpretation etsi_its_spatem_ts_msgs::access::interpretTimeMarkValueType (const uint16_t time)
 Interprets the type of a TimeMark message See etsi ASNI1 - IS TS 103 301 documentation for for the encoding of "TimeMark".
int64_t etsi_its_spatem_ts_msgs::access::interpretTimeMarkDeltaTimeAsNanoSeconds (const uint16_t time, const uint64_t nanosec)
 Calculates the delta between a TimeMark and a given unix timestamp in nanoseconds.
float etsi_its_spatem_ts_msgs::access::interpretTimeMarkDeltaTimeValueAsSeconds (const uint16_t time, const int32_t seconds, const uint32_t nanosec)
 Calculates the delta between a TimeMark and a given timestamp.
std::string etsi_its_spatem_ts_msgs::access::parseTimeMarkValueToString (const uint16_t time, const int32_t seconds, const uint32_t nanosec)
 Converts a value from message type TimeMarkValue into a string representation.

Detailed Description

Utility functions for the ETSI ITS SPATEM.

Definition in file spatem_ts_utils.h.

Enumeration Type Documentation

◆ time_mark_value_interpretation

enum etsi_its_spatem_ts_msgs::access::time_mark_value_interpretation

Definition at line 29 of file spatem_ts_utils.h.

Function Documentation

◆ getUnixNanosecondsFromMinuteOfTheYear()

uint64_t etsi_its_spatem_ts_msgs::access::getUnixNanosecondsFromMinuteOfTheYear ( const MinuteOfTheYear & moy,
const uint64_t unix_nanoseconds_estimate )
inline

Get the unix nanoseconds from MinuteOfTheYear object.

Parameters
moygiven MinuteOfTheYear object
unix_nanoseconds_estimateunix timestamp to derive the current year from in nanoseconds
Returns
uint64_t unix timestamp according to the given MinuteOfTheYear in nanoseconds

Definition at line 61 of file spatem_ts_utils.h.

◆ getUnixSecondsOfYear()

uint64_t etsi_its_spatem_ts_msgs::access::getUnixSecondsOfYear ( const uint64_t unixSecond)
inline

Get the unix seconds of the beginning of a year that corresponds to a given unix timestamp.

Parameters
unixSecondtimestamp that defines the year for that the unix seconds for the beginning of the year should be derived
Returns
uint64_t unix seconds of the beginning of the year

Definition at line 37 of file spatem_ts_utils.h.

◆ interpretMovementPhaseStateAsColor()

std::array< float, 4 > etsi_its_spatem_ts_msgs::access::interpretMovementPhaseStateAsColor ( const uint8_t value)
inline

Interprets the MovementPhaseState type as a color (see etsi definition).

Parameters
valueEncoded color value from msg type MovementPhaseState
Returns
4-dimensional array with color values as follows: r, g, b, a, each of these values within a range between [0, 1]

Definition at line 135 of file spatem_ts_utils.h.

◆ interpretTimeIntervalConfidenceAsFloat()

float etsi_its_spatem_ts_msgs::access::interpretTimeIntervalConfidenceAsFloat ( const uint16_t encoded_probability)
inline

Interprets the TimeIntervalConfidence type as a float value (see etsi definition).

Parameters
encoded_probabilityValue from msg type TimeIntervalConfidence
Returns
confidence as float value [0, 1]

Definition at line 72 of file spatem_ts_utils.h.

◆ interpretTimeMarkDeltaTimeAsNanoSeconds()

int64_t etsi_its_spatem_ts_msgs::access::interpretTimeMarkDeltaTimeAsNanoSeconds ( const uint16_t time,
const uint64_t nanosec )
inline

Calculates the delta between a TimeMark and a given unix timestamp in nanoseconds.

Parameters
timeTimeMark value since the start of the last full hour in 0.1 seconds
nanosecUnix timestamp in nanoseconds
Returns
Delta time between the timestamp and the given TimeMark in nanoseconds

Definition at line 210 of file spatem_ts_utils.h.

◆ interpretTimeMarkDeltaTimeValueAsSeconds()

float etsi_its_spatem_ts_msgs::access::interpretTimeMarkDeltaTimeValueAsSeconds ( const uint16_t time,
const int32_t seconds,
const uint32_t nanosec )
inline

Calculates the delta between a TimeMark and a given timestamp.

Parameters
timeTimeMark value since the start of the last full hour in 0.1 seconds
secondsseconds of current timestamp
nanosecnanoseconds of current timestamp [0, 999999999]
Returns
Delta time between the timestamp and the given TimeMark in seconds

Definition at line 235 of file spatem_ts_utils.h.

◆ interpretTimeMarkValueType()

time_mark_value_interpretation etsi_its_spatem_ts_msgs::access::interpretTimeMarkValueType ( const uint16_t time)
inline

Interprets the type of a TimeMark message See etsi ASNI1 - IS TS 103 301 documentation for for the encoding of "TimeMark".

Parameters
timeThe value inside the TimeMark message
Returns
Type as time_mark_value_interpretation

Definition at line 184 of file spatem_ts_utils.h.

◆ parseTimeMarkValueToString()

std::string etsi_its_spatem_ts_msgs::access::parseTimeMarkValueToString ( const uint16_t time,
const int32_t seconds,
const uint32_t nanosec )
inline

Converts a value from message type TimeMarkValue into a string representation.

Parameters
timeTime in 0.1 seconds until the next change occours in the future, counting from the last started hour
secondsseconds of current timestamp
nanosecnanoseconds of current timestamp [0, 999999999]
Returns
Decoded String representation of the encoded time

Definition at line 250 of file spatem_ts_utils.h.