Vanetza
 
Loading...
Searching...
No Matches
basic_elements.hpp
1#ifndef BASIC_ELEMENTS_HPP_RALCTYHI
2#define BASIC_ELEMENTS_HPP_RALCTYHI
3
4#include <vanetza/common/clock.hpp>
5#include <vanetza/security/hashed_id.hpp>
6#include <cstdint>
7
8namespace vanetza
9{
10namespace security
11{
12namespace v2
13{
14
15using Time64 = uint64_t;
16using Time32 = uint32_t;
17
18/// Time64WithStandardDeviation specified in TS 103 097 v1.2.1, section 4.2.16
20{
21 Time64 time64;
22 uint8_t log_std_dev;
23};
24
25/**
26 * Convert time point to time stamp
27 * \param tp time point
28 * \return time stamp with second accuracy
29 */
30Time32 convert_time32(const Clock::time_point& tp);
31
32/**
33 * Convert time point to time stamp
34 * \param tp time point
35 * \return time stamp with microsecond accuracy
36 */
37Time64 convert_time64(const Clock::time_point& tp);
38
39} // namespace v2
40} // namespace security
41} // namespace vanetza
42
43#endif /* BASIC_ELEMENTS_HPP_RALCTYHI */
Time64WithStandardDeviation specified in TS 103 097 v1.2.1, section 4.2.16.