37 signal(SIGINT, SIG_DFL);
63 fprintf(stderr,
"Error 0x%X initialising uploader\n", iErr);
77 fprintf(stderr,
"Out of memory allocating data buffer.\n");
82 memset(
Modes.icao_cache, 0,
sizeof(uint32_t) * MODES_ICAO_CACHE_LEN * 2);
85 if ( (
Modes.fUserLat > 90.0)
86 || (
Modes.fUserLat < -90.0)
87 || (
Modes.fUserLon > 360.0)
88 || (
Modes.fUserLon < -180.0) ) {
90 }
else if (
Modes.fUserLon > 180.0) {
91 Modes.fUserLon -= 360.0;
99 if ((
Modes.fUserLat != 0.0) || (
Modes.fUserLon != 0.0)) {
115 fprintf(stderr,
"Error 0x%X initialising uploader\n", iErr);
124 "-----------------------------------------------------------------------------\n"
126 "-----------------------------------------------------------------------------\n"
127 "--net-bo-ipaddr <IPv4> TCP Beast output listen IPv4 (default: 127.0.0.1)\n"
128 "--net-bo-port <port> TCP Beast output listen port (default: 30005)\n"
129 "--quiet Disable output to stdout. Use for daemon applications\n"
130 "--help Show this help\n"
136 int main(
int argc,
char **argv) {
146 for (j = 1; j < argc; j++) {
147 int more = ((j + 1) < argc);
149 if (!strcmp(argv[j],
"--net-bo-port") && more) {
150 Modes.net_input_beast_port = atoi(argv[++j]);
151 }
else if (!strcmp(argv[j],
"--net-bo-ipaddr") && more) {
152 strcpy(
ppup1090.net_input_beast_ipaddr, argv[++j]);
153 }
else if (!strcmp(argv[j],
"--quiet")) {
155 }
else if (!strcmp(argv[j],
"--help")) {
159 fprintf(stderr,
"Unknown or not enough arguments for option '%s'.\n\n", argv[j]);
170 fprintf(stderr,
"Failed to connect to %s:%d\n",
ppup1090.net_input_beast_ipaddr,
Modes.net_input_beast_port);
189 c = (
struct client *) malloc(
sizeof(*c));
195 if (
Modes.maxfd < fd) {
200 while (!
Modes.exit) {
void interactiveRemoveStaleAircrafts(void)
int anetTcpConnect(char *err, char *addr, int port)
void sigintHandler(int dummy)
#define MODES_ICAO_CACHE_LEN
int decodeBinMessage(struct client *c, char *p)
struct _coaa1090 coaa1090
#define MODES_USER_LATITUDE_DFLT
void modesInitErrorInfo()
void modesReadFromClient(struct client *c, char *sep, int(*handler)(struct client *, char *))
#define MODES_USER_LONGITUDE_DFLT
#define MODES_INTERACTIVE_DISPLAY_TTL
int initCOAA(struct _coaa1090 coaa1090)
int main(int argc, char *argv[])
void ppup1090InitConfig(void)
#define MODES_INTERACTIVE_DELETE_TTL
#define MODES_DUMP1090_VERSION
#define MODES_USER_LATLON_VALID
#define MODES_NET_OUTPUT_BEAST_PORT
#define PPUP1090_NET_OUTPUT_IP_ADDRESS