-
Notifications
You must be signed in to change notification settings - Fork 7
/
QnetTypeDefs.h
163 lines (159 loc) · 4.68 KB
/
QnetTypeDefs.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
#pragma once
/*
* Copyright 2017-2021 by Thomas Early, N7TAE
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
// for communicating with the g2 gateway on the internal port
#pragma pack(push, 1) // used internally by Icom stacks
using SDSTR = struct dstr_tag
{
unsigned char pkt_id[4]; // 0 "DSTR"
unsigned short counter; // 4
unsigned char flag[3]; // 6 { 0x73, 0x12, 0x00 }
unsigned char remaining; // 9 the number of bytes left in the packet
union
{
struct
{
unsigned char mycall[8]; // 10
unsigned char rpt[8]; // 18
} spkt; // total 26
struct
{
unsigned char icm_id; // 10
unsigned char dst_rptr_id; // 11
unsigned char snd_rptr_id; // 12
unsigned char snd_term_id; // 13
unsigned short streamid; // 14
unsigned char ctrl; // 16 sequence number hdr=0, voice%21, end|=0x40
union
{
struct
{
unsigned char flag[3]; // 17
unsigned char r2[8]; // 20
unsigned char r1[8]; // 28
unsigned char ur[8]; // 36
unsigned char my[8]; // 44
unsigned char nm[4]; // 52
unsigned char pfcs[2]; // 56
} hdr; // total 58
union
{
struct
{
unsigned char voice[9]; // 17
unsigned char text[3]; // 26
} vasd; // total 29
struct
{
unsigned char UNKNOWN[3]; // 17 not sure what this is, but g2_ doesn't seem to need it
unsigned char voice[9]; // 20
unsigned char text[3]; // 29
} vasd1; // total 32
};
};
} vpkt;
};
};
#pragma pack(pop)
// for the g2 external port and between QnetGateway programs
#pragma pack(push, 1)
using SDSVT = struct dsvt_tag
{
unsigned char title[4]; // 0 "DSVT"
unsigned char config; // 4 0x10 is hdr 0x20 is vasd
unsigned char flaga[3]; // 5 zeros
unsigned char id; // 8 0x20
unsigned char flagb[3]; // 9 0x0 0x1 (A:0x3 B:0x1 C:0x2)
unsigned short streamid;// 12
unsigned char ctrl; // 14 hdr: 0x80 vsad: framecounter (mod 21)
union
{
struct // index
{
unsigned char flag[3]; // 15
unsigned char rpt1[8]; // 18
unsigned char rpt2[8]; // 26
unsigned char urcall[8];// 34
unsigned char mycall[8];// 42
unsigned char sfx[4]; // 50
unsigned char pfcs[2]; // 54
} hdr; // total 56
struct
{
unsigned char voice[9]; // 15
unsigned char text[3]; // 24
} vasd; // voice and slow data total 27
struct
{
unsigned char voice[9]; // 15
unsigned char textend[6]; // 24
} vend; // voice and end seq total 32 (for DPlus)
};
};
#pragma pack(pop)
// for mmdvm
#pragma pack(push, 1)
using SDSRP = struct dsrp_tag // offset size
{
unsigned char title[4]; // "DSRP" 0
unsigned char tag; // Poll : 0xA 4
// Header : busy ? 0x22 : 0x20
// Voice : busy ? 0x23 : 0x21
union
{
unsigned char poll_msg[59]; // space for text 5 variable, max is 64, including trailing null
struct
{
unsigned short id; // random id number 5
unsigned char seq; // 0x0 7
unsigned char flag[3]; // 0x80 Dstar Data 8
// 0x40 Dstar Repeater
// 0x01 Dstar Relay Unavailable
unsigned char r2[8]; // Repeater 2 11
unsigned char r1[8]; // Repeater 1 19
unsigned char ur[8]; // Your Call 27
unsigned char my[8]; // My Call 35
unsigned char nm[4]; // Name 43
unsigned char pfcs[2]; // checksum 47 49
} header;
struct
{
unsigned short id; // random id number 5
unsigned char seq; // sequence from 0 to 0x14 7
// if end then sequence |= 0x40
unsigned char err; // # of errors? 8
unsigned char ambe[12]; // voice + slow data 9 21
} voice;
struct
{
unsigned short id; // random id number 5
unsigned char seq; // sequence from 0 to 0x14 7
// if end then sequence |= 0x40
unsigned char err; // # of errors? 8
unsigned char ambe[15]; // voice + slow data 9 24
} endvoice;
};
};
#pragma pack(pop)
#pragma pack(push, 1)
using SLINKFAMILY = struct link_family_tag
{
char title[4];
int family[3];
};
#pragma pack(pop)