forked from g0orx/pihpsdr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiscovered.h
102 lines (87 loc) · 2.31 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
/* Copyright (C)
* 2015 - 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 LIMESDR
#include <SoapySDR/Device.h>
#endif
#define MAX_DEVICES 16
#define DEVICE_METIS 0
#define DEVICE_HERMES 1
#define DEVICE_GRIFFIN 2
#define DEVICE_ANGELIA 4
#define DEVICE_ORION 5
#define DEVICE_HERMES_LITE 6
// 8000DLE uses 10 as the device type in old protocol
#define DEVICE_ORION2 10
#ifdef USBOZY
#define DEVICE_OZY 7
#endif
#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
#ifdef LIMESDR
#define LIMESDR_USB_DEVICE 0
#endif
#ifdef RADIOBERRY
#define RADIOBERRY_SPI_DEVICE 100
#endif
#define STATE_AVAILABLE 2
#define STATE_SENDING 3
#define ORIGINAL_PROTOCOL 0
#define NEW_PROTOCOL 1
#ifdef LIMESDR
#define LIMESDR_PROTOCOL 2
#endif
#ifdef RADIOBERRY
#define RADIOBERRY_PROTOCOL 3
#endif
struct _DISCOVERED {
int protocol;
int device;
char name[64];
int software_version;
int status;
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 LIMESDR
struct soapy {
SoapySDRKwargs *args;
} soapy;
#endif
} info;
};
typedef struct _DISCOVERED DISCOVERED;
extern int selected_device;
extern int devices;
extern DISCOVERED discovered[MAX_DEVICES];
#endif