-
Notifications
You must be signed in to change notification settings - Fork 45
/
discovered.h
126 lines (112 loc) · 2.96 KB
/
discovered.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
/* Copyright (C)
* 2018 - John Melton, G0ORX/N6LYT
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef DISCOVERED_H
#define DISCOVERED_H
#include <netinet/in.h>
#ifdef SOAPYSDR
#include <SoapySDR/Device.h>
#endif
#define MAX_DEVICES 16
#define OLD_DEVICE_METIS 0
#define OLD_DEVICE_HERMES 1
#define OLD_DEVICE_GRIFFIN 2
#define OLD_DEVICE_ANGELIA 4
#define OLD_DEVICE_ORION 5
#define OLD_DEVICE_HERMES_LITE 6
#define OLD_DEVICE_ORION2 10
#define NEW_DEVICE_ATLAS 0
#define NEW_DEVICE_HERMES 1
#define NEW_DEVICE_HERMES2 2
#define NEW_DEVICE_ANGELIA 3
#define NEW_DEVICE_ORION 4
#define NEW_DEVICE_ORION2 5
#define NEW_DEVICE_HERMES_LITE 6
enum {
DEVICE_UNKNOWN=-1
,DEVICE_METIS=0
,DEVICE_HERMES
,DEVICE_HERMES2
,DEVICE_ANGELIA
,DEVICE_ORION
,DEVICE_ORION2
,DEVICE_HERMES_LITE
,DEVICE_HERMES_LITE2
#ifdef SOAPYSDR
,DEVICE_SOAPYSDR
#endif
};
#define STATE_AVAILABLE 2
#define STATE_SENDING 3
#define PROTOCOL_1 0
#define PROTOCOL_2 1
#ifdef SOAPYSDR
#define PROTOCOL_SOAPYSDR 2
#endif
struct _DISCOVERED {
int protocol;
int device;
char name[64];
char software_version[128];
int status;
int supported_receivers;
int supported_transmitters;
int adcs;
double frequency_min;
double frequency_max;
union {
struct network {
unsigned char mac_address[6];
int address_length;
struct sockaddr_in address;
int interface_length;
struct sockaddr_in interface_address;
struct sockaddr_in interface_netmask;
char interface_name[64];
} network;
#ifdef SOAPYSDR
struct soapy {
int rtlsdr_count;
int sdrplay_count;
int sample_rate;
size_t rx_channels;
size_t rx_gains;
char **rx_gain;
SoapySDRRange *rx_range;
gboolean rx_has_automatic_gain;
gboolean rx_has_automatic_dc_offset_correction;
size_t rx_antennas;
char **rx_antenna;
size_t tx_channels;
size_t tx_gains;
char **tx_gain;
SoapySDRRange *tx_range;
size_t tx_antennas;
char **tx_antenna;
size_t sensors;
char **sensor;
gboolean has_temp;
char address[32];
} soapy;
#endif
} info;
};
typedef struct _DISCOVERED DISCOVERED;
extern int devices;
extern DISCOVERED discovered[MAX_DEVICES];
#endif