forked from PiInTheSky/lora-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.h
104 lines (88 loc) · 1.84 KB
/
global.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
#include <curses.h>
#define BUFFERS 8
struct TThreadArguments
{
int Index;
};
struct TSSDVPacket
{
unsigned char Packet[256];
char InUse;
char Callsign[7];
};
struct TSSDVPacketArray
{
struct TSSDVPacket Packets[16];
};
struct TSSDVPacketArrays
{
struct TSSDVPacketArray Packets[BUFFERS];
};
struct TSSDVPackets
{
int ImageNumber;
int HighestPacket;
bool Packets[1024];
};
struct TLoRaDevice
{
int InUse;
int DIO0;
int DIO5;
char Frequency[16];
double activeFreq;
bool AFC;
int SpeedMode;
int Power;
int PayloadLength;
int ImplicitOrExplicit;
int ErrorCoding;
int Bandwidth;
int SpreadingFactor;
int LowDataRateOptimize;
int CurrentBandwidth;
WINDOW *Window;
unsigned int TelemetryCount, SSDVCount, BadCRCCount, UnknownCount;
int Sending;
char Telemetry[256];
char Payload[16], Time[12];
unsigned int Counter, LastCounter;
unsigned long Seconds;
double Longitude, Latitude;
unsigned int Altitude, PreviousAltitude;
unsigned int Satellites;
unsigned long LastPositionAt;
time_t LastPacketAt;
float AscentRate;
time_t ReturnToCallingModeAt;
int InCallingMode;
int ActivityLED;
// Normal (non TDM) uplink
int UplinkTime;
int UplinkCycle;
// SSDV Packet Log
struct TSSDVPackets SSDVPackets[3];
};
struct TConfig
{
char Tracker[16];
int EnableHabitat;
int EnableSSDV;
int EnableTelemetryLogging;
int CallingTimeout;
char SSDVJpegFolder[100];
char ftpServer[100];
char ftpUser[32];
char ftpPassword[32];
char ftpFolder[64];
struct TLoRaDevice LoRaDevices[2];
int NetworkLED;
int InternetLED;
int ServerPort;
float latitude, longitude;
char SMSFolder[64];
char antenna[64];
};
extern struct TConfig Config;
extern struct TSSDVPacketArrays SSDVPacketArrays;
void LogMessage(const char *format, ...);