Utility functions for the ETSI ITS SPATEM.
More...
#include <ctime>
Go to the source code of this file.
|
| enum | time_mark_value_interpretation { normal
, undefined
, over_an_hour
, leap_second
} |
Utility functions for the ETSI ITS SPATEM.
Definition in file spatem_ts_utils.h.
◆ time_mark_value_interpretation
| enum etsi_its_spatem_ts_msgs::access::time_mark_value_interpretation |
◆ 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
-
| moy | given MinuteOfTheYear object |
| unix_nanoseconds_estimate | unix 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
-
| unixSecond | timestamp 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
-
| value | Encoded 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_probability | Value 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
-
| time | TimeMark value since the start of the last full hour in 0.1 seconds |
| nanosec | Unix 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
-
| time | TimeMark value since the start of the last full hour in 0.1 seconds |
| seconds | seconds of current timestamp |
| nanosec | nanoseconds 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
-
| time | The 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
-
| time | Time in 0.1 seconds until the next change occours in the future, counting from the last started hour |
| seconds | seconds of current timestamp |
| nanosec | nanoseconds of current timestamp [0, 999999999] |
- Returns
- Decoded String representation of the encoded time
Definition at line 250 of file spatem_ts_utils.h.