aera.h
Go to the documentation of this file.
1 // AERA extension for dump1090
2 //
3 // Copyright (C) 2013-14 by Andreas Lang <andreas.lang3@student.kit.edu>
4 // Version 1.1 - 02.07.2014
5 //
6 #ifndef __AERA_H
7 #define __AERA_H
8 
9 // ============================= Include files ==========================
10 
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <unistd.h>
14 #include <sys/types.h>
15 #include <sys/socket.h>
16 #include <netinet/in.h>
17 #include <netdb.h>
18 #include <fcntl.h>
19 #include <sys/time.h>
20 
21 // ============================= #defines ===============================
22 
23 #define AERA_DEG_TO_RAD 0.017453292519943295769236907684886 // PI/180
24 #define AERA_EARTH_RADIUS_IN_METERS 6372797.560856 // Earth's quatratic mean radius for WGS-84
25 #define AERA_STATION_LATITUDE -35.108405932 // Coordinates of CRS
26 #define AERA_STATION_LONGITUDE -69.533337772 // Coordinates of CRS
27 #define AERA_STATION_ALTITUDE 1559.49 // Altitude of CRS
28 
29 #ifndef AERA_STATION_LATITUDE // For testing in Karlsruhe
30  #define AERA_STATION_LATITUDE 49.094644 // Coordinates of KIT, Karlsruhe
31  #define AERA_STATION_LONGITUDE 8.433219 // Coordinates of KIT, Karlsruhe
32  #define AERA_STATION_ALTITUDE 115. // Altitude of KIT, Karlsruhe
33 #endif
34 
35 /* difference between UTC and GPS time 315964800 =
36 3600 sec/hour x 24 hours/day x (365 days/year x 8 years + 366 days/year x 2 years+ 5 days) - 16 Leap Seconds till 31.12.2013 */
37 #define AERA_UTC_TO_GPS 315964800 + 16
38 
39 // ======================== variable declarations =========================
40 
41 int aeraSocketFD2, *aeraSocketFD, aeraSocketInit, aeraSocketReconnectTime; // variables for socket connection
42 
43 // ======================== function declarations =========================
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 //
50 // Functions exported from aera.c
51 //
52 uint64_t mstime(void);
53 double aeraCalcGroundDistance(double lat1, double lon1, double lat2, double lon2);
54 double aeraCalcCorrectedAltitude(double alt1, double alt2, double groundDistance);
55 double aeraCalcAzimuth(double lat1, double lon1, double lat2, double lon2);
56 void aera(struct modesMessage *mm);
57 void aeraWriteLogfile(char *message);
58 int aeraConnectToSocket(int *aeraSocketFD, char host[], int port);
59 int aeraWriteToSocket(int *aeraSocketFD, unsigned char *socketMessage, int length);
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif // __AERA_H
constexpr double mm
Definition: AugerUnits.h:113
int * aeraSocketFD
Definition: aera.h:41
int aeraSocketFD2
Definition: aera.h:41
uint64_t mstime(void)
Definition: aera.c:12
void aeraWriteLogfile(char *logMessage)
Definition: aera.c:223
double aeraCalcAzimuth(double lat1, double lon1, double lat2, double lon2)
Definition: aera.c:76
double aeraCalcGroundDistance(double lat1, double lon1, double lat2, double lon2)
Definition: aera.c:24
double aeraCalcCorrectedAltitude(double alt1, double alt2, double groundDistance)
Definition: aera.c:38
int aeraWriteToSocket(int *aeraSocketFD, unsigned char *socketMessage, int length)
Definition: aera.c:285
int aera
Definition: dump1090.h:272
int aeraSocketReconnectTime
Definition: aera.h:41
int aeraConnectToSocket(int *aeraSocketFD, char host[], int port)
Definition: aera.c:236
int aeraSocketInit
Definition: aera.h:41

, generated on Tue Sep 26 2023.