alt_imagenex
AltRaw.hpp
Go to the documentation of this file.
1 #ifndef ALT_IMAGENEX_ALTRAW_HPP
2 #define ALT_IMAGENEX_ALTRAW_HPP
3 
4 namespace alt_imagenex {
5  namespace raw {
6 
7 #define ALT_CMD_LEN 0x1B
8 #define ALT_HEADER1 0xFE
9 #define ALT_HEADER2 0x44
10 #define ALT_TERM 0xFD
11 #define ALT_HEAD_ID 0x10
12 #define ALT_LOGF 0x01
13 #define ALT_ABSORPTION 0x0A
14 #define ALT_DATA_POINTS 0x32
15 #define ALT_DATA_BITS 0x08
16 #define ALT_FREQ 0x1F
17 #define ALT_REPLY_START 0x49
18 #define ALT_REPLY_G 0x47
19 #define ALT_REPLY_P 0x50
20 #define ALT_REPLY_TERM 0xFC
21 #define ALT_REPLY_LEN 0x0D
22 #define ALT_REPLY_LEN_ECHO 0x201
23 
24 #define ALT_SAMPLE_INT 0.000013333
25 #define ALT_DEFAULT_SV 1500
26 
27 
28 
29  struct AltSwitchCmd{
30  uint8_t header1;
31  uint8_t header2;
32  uint8_t headId;
33  uint8_t range;
34  uint8_t reserved0;
35  uint8_t hold;
36  uint8_t reserved1;
37  uint8_t reserved2;
38  uint8_t startGain;
39  uint8_t logf;
40  uint8_t absorption;
41  uint8_t reserved3;
42  uint8_t reserved4;
43  uint8_t reserved5;
44  uint8_t pulseLength;
45  uint8_t profMinRange;
46  uint8_t extTrigger;
47  uint8_t reserved6;
48  uint8_t reserved7;
49  uint8_t dataPoints;
50  uint8_t dataBits;
51  uint8_t reserved8;
52  uint8_t profile;
53  uint8_t reserved9;
54  uint8_t switchDelay;
55  uint8_t frequency;
56  uint8_t term;
61  range(1),
62  reserved0(0),
63  hold(0),
64  reserved1(0),
65  reserved2(0),
66  startGain(6),
67  logf(ALT_LOGF),
69  reserved3(0),
70  reserved4(0),
71  reserved5(0),
72  pulseLength(1),
73  profMinRange(0),
74  extTrigger(0),
75  reserved6(0),
76  reserved7(0),
79  reserved8(0),
80  profile(1),
81  reserved9(0),
82  switchDelay(0),
84  term(ALT_TERM)
85  {}
86 
87  AltSwitchCmd & operator>>(std::vector<uint8_t>& msg)
88  {
89  msg.resize(ALT_CMD_LEN);
90  msg[0] = header1;
91  msg[1] = header2;
92  msg[2] = headId;
93  msg[3] = range;
94  msg[4] = reserved0;
95  msg[5] = hold;
96  msg[6] = reserved1;
97  msg[7] = reserved2;
98  msg[8] = startGain;
99  msg[9] = logf;
100  msg[10] = absorption;
101  msg[11] = reserved3;
102  msg[12] = reserved4;
103  msg[13] = reserved5;
104  msg[14] = pulseLength;
105  msg[15] = profMinRange;
106  msg[16] = extTrigger;
107  msg[17] = reserved6;
108  msg[18] = reserved7;
109  msg[19] = dataPoints;
110  msg[20] = dataBits;
111  msg[21] = reserved8;
112  msg[22] = profile;
113  msg[23] = reserved9;
114  msg[24] = switchDelay;
115  msg[25] = frequency;
116  msg[26] = term;
117  return *this;
118  }
119  };
120 
121 
122  }
123 }
124 
125 
126 #endif
uint8_t headId
Definition: AltRaw.hpp:32
#define ALT_TERM
Definition: AltRaw.hpp:10
uint8_t reserved2
Definition: AltRaw.hpp:37
AltSwitchCmd & operator>>(std::vector< uint8_t > &msg)
Definition: AltRaw.hpp:87
#define ALT_CMD_LEN
Definition: AltRaw.hpp:7
uint8_t switchDelay
Definition: AltRaw.hpp:54
#define ALT_ABSORPTION
Definition: AltRaw.hpp:13
uint8_t extTrigger
Definition: AltRaw.hpp:46
Definition: AltRaw.hpp:29
uint8_t header1
Definition: AltRaw.hpp:30
uint8_t absorption
Definition: AltRaw.hpp:40
#define ALT_HEADER1
Definition: AltRaw.hpp:8
uint8_t term
Definition: AltRaw.hpp:56
uint8_t range
Definition: AltRaw.hpp:33
uint8_t reserved6
Definition: AltRaw.hpp:47
uint8_t reserved3
Definition: AltRaw.hpp:41
uint8_t reserved0
Definition: AltRaw.hpp:34
uint8_t header2
Definition: AltRaw.hpp:31
uint8_t reserved9
Definition: AltRaw.hpp:53
#define ALT_HEADER2
Definition: AltRaw.hpp:9
uint8_t reserved1
Definition: AltRaw.hpp:36
uint8_t reserved7
Definition: AltRaw.hpp:48
uint8_t dataPoints
Definition: AltRaw.hpp:49
uint8_t hold
Definition: AltRaw.hpp:35
#define ALT_HEAD_ID
Definition: AltRaw.hpp:11
#define ALT_FREQ
Definition: AltRaw.hpp:16
uint8_t logf
Definition: AltRaw.hpp:39
#define ALT_DATA_POINTS
Definition: AltRaw.hpp:14
uint8_t reserved4
Definition: AltRaw.hpp:42
uint8_t profMinRange
Definition: AltRaw.hpp:45
#define ALT_LOGF
Definition: AltRaw.hpp:12
uint8_t frequency
Definition: AltRaw.hpp:55
#define ALT_DATA_BITS
Definition: AltRaw.hpp:15
uint8_t pulseLength
Definition: AltRaw.hpp:44
AltSwitchCmd()
Definition: AltRaw.hpp:57
uint8_t reserved5
Definition: AltRaw.hpp:43
uint8_t startGain
Definition: AltRaw.hpp:38
uint8_t profile
Definition: AltRaw.hpp:52
uint8_t reserved8
Definition: AltRaw.hpp:51
uint8_t dataBits
Definition: AltRaw.hpp:50