-
Notifications
You must be signed in to change notification settings - Fork 0
/
DCS.h
116 lines (94 loc) · 2.12 KB
/
DCS.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
#ifndef DCS_H
#define DCS_H
#include <stdint.h>
#include <endian.h>
#include "DStar.h"
#ifdef __cplusplus
extern "C"
{
#endif
#pragma pack(push, 1)
#define DCS_DEFAULT_PORT 30051
#define DCS_BUFFER_SIZE 1024
#define DCS_FLAG_CLOSE 0x40
#define DCS_SIGN_LENGTH 4
#define DCS_NUMBER_SIZE 3
#define DCS_DATA_SIGN "0001"
#define DCS_STATUS_SIGN "EEEE"
#define DCS_LANGUAGE_DEFAULT 0x21
#define DCS_HTML_LENGTH 500
#define DCS_SHORT_DATA_SIZE sizeof(DCSData)
#define DCS_LONG_DATA_SIZE (DCS_SHORT_DATA_SIZE + DCS_HTML_LENGTH)
#define DCS_STATUS_ACK "ACK"
#define DCS_STATUS_NACK "NAK"
#define DCS_STATUS_LENGTH 3
#define DCS_DATA_VERSION htobe16(0x0100)
struct DCSData
{
char sign[DCS_SIGN_LENGTH];
struct DStarRoute route;
uint16_t session;
uint8_t sequence;
struct DStarDVFrame frame;
uint8_t number[DCS_NUMBER_SIZE];
uint16_t version;
uint8_t language;
char text[SLOW_DATA_TEXT_LENGTH];
uint8_t reserved[16];
};
struct DCSPoll
{
char reflectorCall[LONG_CALLSIGN_LENGTH];
uint8_t zero;
};
struct DCSPoll2
{
char reflectorCall[LONG_CALLSIGN_LENGTH];
uint8_t type;
char repeaterCall[LONG_CALLSIGN_LENGTH];
char repeaterModule;
uint8_t unknown[SHORT_CALLSIGN_LENGTH];
};
struct DCSPollReply
{
char repeaterCall[LONG_CALLSIGN_LENGTH];
char zero;
char reflectorCall[LONG_CALLSIGN_LENGTH];
};
struct DCSConnect
{
char repeaterCall[LONG_CALLSIGN_LENGTH];
char repeaterModule;
char reflectorModule;
char zero;
char reflectorCall[LONG_CALLSIGN_LENGTH];
};
struct DCSConnect2
{
char repeaterCall[LONG_CALLSIGN_LENGTH];
char repeaterModule;
char reflectorModule;
char zero;
char reflectorCall[LONG_CALLSIGN_LENGTH - 1];
char separator;
char description[DCS_HTML_LENGTH];
};
struct DCSConnectReply
{
char repeaterCall[LONG_CALLSIGN_LENGTH];
char repeaterModule;
char reflectorModule;
char status[DCS_STATUS_LENGTH];
char zero;
};
struct DCSStatus
{
char repeaterCall[LONG_CALLSIGN_LENGTH];
char status[26];
char zero;
};
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif