-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheasycomm-response-types.h
230 lines (203 loc) · 4.88 KB
/
easycomm-response-types.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
/**
* Responses are issued by the controller to the host.
*
* Easycomm 1, 2 and 3 references:
* - description https://github.com/Hamlib/Hamlib/blob/master/rotators/easycomm/easycomm.txt
* - implementation details https://github.com/Hamlib/Hamlib/blob/master/rotators/easycomm/easycomm.c
*/
#include "easycomm-types.h"
#include <inttypes.h>
#include <stdbool.h>
/**
* example: "AZaaa.a ELeee.e UPuuuuuuuuu UUU DNddddddddd DDD"
* standard: Easycomm 1
*/
typedef struct EasycommResponseSingleLine
{
EasycommCommandId commandId;
float azimuth;
float elevation;
EasycommFrequency uplinkFrequency;
EasycommFrequency downlinkFrequency;
char modeUp[4];
char modeDown[4];
} EasycommResponseSingleLine;
/**
* example: "AZaaa.a"
* standard: Easycomm 2
*/
typedef struct EasycommResponseAzimuth
{
float azimuth;
} EasycommResponseAzimuth;
/**
* example: "ELeee.e"
* standard: Easycomm 2
*/
typedef struct EasycommResponseElevation
{
float elevation;
} EasycommResponseElevation;
/**
* example: "UPfff"
* standard: Easycomm 2
*/
typedef struct EasycommResponseUplinkFrequency
{
EasycommFrequency frequency;
} EasycommResponseUplinkFrequency;
/**
* example: "DNfff"
* standard: Easycomm 2
*/
typedef struct EasycommResponseDownlinkFrequency
{
EasycommFrequency frequency;
} EasycommResponseDownlinkFrequency;
/**
* example: "UMmmm"
* standard: Easycomm 2
*/
typedef struct EasycommResponseUplinkMode
{
char mode[4];
} EasycommResponseUplinkMode;
/**
* example: "DMmmm"
* standard: Easycomm 2
*/
typedef struct EasycommResponseDownlinkMode
{
char mode[4];
} EasycommResponseDownlinkMode;
/**
* example: "DRnnn"
* standard: Easycomm 2
*/
typedef struct EasycommResponseDownlinkRadio
{
uint16_t number;
} EasycommResponseDownlinkRadio;
/**
* example: "URnnn"
* standard: Easycomm 2
*/
typedef struct EasycommResponseUplinkRadio
{
uint16_t number;
} EasycommResponseUplinkRadio;
/**
* example: "IPnnn"
* standard: Easycomm 2
*/
typedef struct EasycommResponseDigitalInput
{
uint16_t number;
bool value;
} EasycommResponseDigitalInput;
/**
* example: "ANnnn"
* standard: Easycomm 2
*/
typedef struct EasycommResponseAnalogueInput
{
uint16_t number;
uint16_t value;
} EasycommResponseAnalogueInput;
/**
* example: "VEnnn.nnn"
* standard: Easycomm 2
*/
typedef struct EasycommResponseVersion
{
uint8_t minor;
uint8_t major;
} EasycommResponseVersion;
/**
* example: "ALtextnospaces"
* standard: Easycomm 2
*/
typedef struct EasycommResponseAlarm
{
char message[33];
} EasycommResponseAlarm;
/**
* example: "VLnnn"
* standard: Easycomm 3
*/
typedef struct EasycommResponseVelocityLeft
{
uint16_t milliDegSecond;
} EasycommResponseVelocityLeft;
/**
* example: "VRnnn"
* standard: Easycomm 3
*/
typedef struct EasycommResponseVelocityRight
{
uint16_t milliDegSecond;
} EasycommResponseVelocityRight;
/**
* example: "VUnnn"
* standard: Easycomm 3
*/
typedef struct EasycommResponseVelocityUp
{
uint16_t milliDegSecond;
} EasycommResponseVelocityUp;
/**
* example: "VDnnn"
* standard: Easycomm 3
*/
typedef struct EasycommResponseVelocityDown
{
uint16_t milliDegSecond;
} EasycommResponseVelocityDown;
/**
* current time: [y]{1,2}:[m]{1,2}:[d]{1,2}:[M]{1,2}:[h]{1,2}:[s]{1,2}
* example: "STyy:mm:dd:hh:MM:ss"
* standard: Easycomm 2
*/
typedef struct EasycommResponseTime
{
EasycommCommandId commandId;
uint8_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t minute;
uint8_t second;
} EasycommResponseTime;
/**
* example: "CRnnn,vvv"
* standard: Easycomm 3
*/
typedef struct EasycommResponseConfigRegister
{
uint16_t registerNumber;
EasycommConfigRegisterValue value;
} EasycommResponseConfigRegister;
/**
* example: "GSn"
* standard: Easycomm 3
*/
typedef struct EasycommResponseStatusRegister
{
EasycommStatusRegister status;
} EasycommResponseStatusRegister;
/**
* example: "GEn"
* standard: Easycomm 3
*/
typedef struct EasycommResponseErrorRegister
{
EasycommErrorRegister status;
} EasycommResponseErrorRegister;
#ifdef __cplusplus
}
#endif