-
Notifications
You must be signed in to change notification settings - Fork 0
/
SubTimeFrameHeader.h
75 lines (60 loc) · 1.84 KB
/
SubTimeFrameHeader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef SubTimeFrameHeader_h
#define SubTimeFrameHeader_h
#include <cstdint>
namespace SubTimeFrame {
// This format is temporary and should be updated.
namespace v0 {
// "DAEH-FTS" : little endian of "STF-HEAD"
constexpr uint64_t MAGIC {0x444145482d465453};
//constexpr uint32_t TDC64H {0x48434454};
//constexpr uint32_t TDC64L {0x4c434454};
constexpr uint32_t TDC64H {2};
constexpr uint32_t TDC64H_V1 {2};
constexpr uint32_t TDC64L {3};
constexpr uint32_t TDC64L_V1 {1};
constexpr uint32_t TDC64L_V2 {3};
constexpr uint32_t TDC64H_V3 {5};
constexpr uint32_t TDC64L_V3 {6};
constexpr uint32_t FLT_TDC {0x0000'1000};
constexpr uint32_t NULDEV {0};
struct Header {
uint64_t magic {MAGIC};
uint32_t timeFrameId {0};
uint32_t reserved {0};
uint32_t femType {0};
uint32_t femId {0};
uint32_t length {0};
uint32_t numMessages {0};
uint64_t timeSec {0};
uint64_t timeUSec {0};
};
} // namespace v0
inline namespace v1 {
// " EMITBUS" : little endian of "SUBTIME "
constexpr uint64_t MAGIC {0x00454d4954425553};
constexpr uint32_t TDC64H {2};
constexpr uint32_t TDC64H_V1 {2};
constexpr uint32_t TDC64L {3};
constexpr uint32_t TDC64L_V1 {1};
constexpr uint32_t TDC64L_V2 {3};
//constexpr uint32_t TDC64H_V3 {4};
//constexpr uint32_t TDC64L_V3 {5};
constexpr uint32_t TDC64H_V3 {5};
constexpr uint32_t TDC64L_V3 {6};
constexpr uint32_t FLT_TDC {0x0000'1000};
constexpr uint32_t NULDEV {0};
struct Header {
uint64_t magic {MAGIC};
uint32_t length {0};
uint16_t hLength {48};
uint16_t type {0};
uint32_t timeFrameId {0};
uint32_t femType {0};
uint32_t femId {0};
uint32_t numMessages {0};
uint64_t timeSec {0};
uint64_t timeUSec {0};
};
} // namespace v1
} // namespace SubTimeFrame
#endif