Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
f44130ba33
|
|
@ -1 +0,0 @@
|
||||||
dump1090.exe --interactive --net --net-ro-size 500 --net-ro-rate 5
|
|
||||||
Binary file not shown.
Binary file not shown.
1
anet.c
1
anet.c
|
|
@ -165,6 +165,7 @@ static int anetTcpGenericConnect(char *err, char *addr, int port, int flags)
|
||||||
if ((s = anetCreateSocket(err,AF_INET)) == ANET_ERR)
|
if ((s = anetCreateSocket(err,AF_INET)) == ANET_ERR)
|
||||||
return ANET_ERR;
|
return ANET_ERR;
|
||||||
|
|
||||||
|
memset(&sa,0,sizeof(sa));
|
||||||
sa.sin_family = AF_INET;
|
sa.sin_family = AF_INET;
|
||||||
sa.sin_port = htons((uint16_t)port);
|
sa.sin_port = htons((uint16_t)port);
|
||||||
if (inet_aton(addr, (void*)&sa.sin_addr) == 0) {
|
if (inet_aton(addr, (void*)&sa.sin_addr) == 0) {
|
||||||
|
|
|
||||||
BIN
coaa1090.obj
BIN
coaa1090.obj
Binary file not shown.
Binary file not shown.
|
|
@ -1 +0,0 @@
|
||||||
dump1090.exe --interactive --net --net-ro-port 30002 --net-beast --mlat
|
|
||||||
|
|
@ -68,6 +68,7 @@ void modesInitConfig(void) {
|
||||||
// Now initialise things that should not be 0/NULL to their defaults
|
// Now initialise things that should not be 0/NULL to their defaults
|
||||||
Modes.gain = MODES_MAX_GAIN;
|
Modes.gain = MODES_MAX_GAIN;
|
||||||
Modes.freq = MODES_DEFAULT_FREQ;
|
Modes.freq = MODES_DEFAULT_FREQ;
|
||||||
|
Modes.ppm_error = MODES_DEFAULT_PPM;
|
||||||
Modes.check_crc = 1;
|
Modes.check_crc = 1;
|
||||||
Modes.net_heartbeat_rate = MODES_NET_HEARTBEAT_RATE;
|
Modes.net_heartbeat_rate = MODES_NET_HEARTBEAT_RATE;
|
||||||
Modes.net_output_sbs_port = MODES_NET_OUTPUT_SBS_PORT;
|
Modes.net_output_sbs_port = MODES_NET_OUTPUT_SBS_PORT;
|
||||||
|
|
@ -89,6 +90,7 @@ void modesInitConfig(void) {
|
||||||
void modesInit(void) {
|
void modesInit(void) {
|
||||||
int i, q;
|
int i, q;
|
||||||
|
|
||||||
|
pthread_mutex_init(&Modes.pDF_mutex,NULL);
|
||||||
pthread_mutex_init(&Modes.data_mutex,NULL);
|
pthread_mutex_init(&Modes.data_mutex,NULL);
|
||||||
pthread_cond_init(&Modes.data_cond,NULL);
|
pthread_cond_init(&Modes.data_cond,NULL);
|
||||||
|
|
||||||
|
|
|
||||||
BIN
dump1090.exe
BIN
dump1090.exe
Binary file not shown.
21
dump1090.h
21
dump1090.h
|
|
@ -37,7 +37,7 @@
|
||||||
// MinorVer changes when additional features are added, but not for bug fixes (range 00-99)
|
// MinorVer changes when additional features are added, but not for bug fixes (range 00-99)
|
||||||
// DayDate & Year changes for all changes, including for bug fixes. It represent the release date of the update
|
// DayDate & Year changes for all changes, including for bug fixes. It represent the release date of the update
|
||||||
//
|
//
|
||||||
#define MODES_DUMP1090_VERSION "1.08.2705.14"
|
#define MODES_DUMP1090_VERSION "1.09.0608.14"
|
||||||
|
|
||||||
// ============================= Include files ==========================
|
// ============================= Include files ==========================
|
||||||
|
|
||||||
|
|
@ -78,6 +78,7 @@
|
||||||
#define MODES_USER_LONGITUDE_DFLT (0.0)
|
#define MODES_USER_LONGITUDE_DFLT (0.0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MODES_DEFAULT_PPM 52
|
||||||
#define MODES_DEFAULT_RATE 2000000
|
#define MODES_DEFAULT_RATE 2000000
|
||||||
#define MODES_DEFAULT_FREQ 1090000000
|
#define MODES_DEFAULT_FREQ 1090000000
|
||||||
#define MODES_DEFAULT_WIDTH 1000
|
#define MODES_DEFAULT_WIDTH 1000
|
||||||
|
|
@ -233,6 +234,16 @@ struct aircraft {
|
||||||
struct aircraft *next; // Next aircraft in our linked list
|
struct aircraft *next; // Next aircraft in our linked list
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct stDF {
|
||||||
|
struct stDF *pNext; // Pointer to next item in the linked list
|
||||||
|
struct stDF *pPrev; // Pointer to previous item in the linked list
|
||||||
|
struct aircraft *pAircraft; // Pointer to the Aircraft structure for this DF
|
||||||
|
time_t seen; // Dos/UNIX Time at which the this packet was received
|
||||||
|
uint64_t llTimestamp; // Timestamp at which the this packet was received
|
||||||
|
uint32_t addr; // Timestamp at which the this packet was received
|
||||||
|
unsigned char msg[MODES_LONG_MSG_BYTES]; // the binary
|
||||||
|
} tDF;
|
||||||
|
|
||||||
// Program global state
|
// Program global state
|
||||||
struct { // Internal state
|
struct { // Internal state
|
||||||
pthread_t reader_thread;
|
pthread_t reader_thread;
|
||||||
|
|
@ -324,6 +335,12 @@ struct { // Internal state
|
||||||
// Interactive mode
|
// Interactive mode
|
||||||
struct aircraft *aircrafts;
|
struct aircraft *aircrafts;
|
||||||
uint64_t interactive_last_update; // Last screen update in milliseconds
|
uint64_t interactive_last_update; // Last screen update in milliseconds
|
||||||
|
time_t last_cleanup_time; // Last cleanup time in seconds
|
||||||
|
|
||||||
|
// DF List mode
|
||||||
|
int bEnableDFLogging; // Set to enable DF Logging
|
||||||
|
pthread_mutex_t pDF_mutex; // Mutex to synchronize pDF access
|
||||||
|
struct stDF *pDF; // Pointer to DF list
|
||||||
|
|
||||||
// Statistics
|
// Statistics
|
||||||
unsigned int stat_valid_preamble;
|
unsigned int stat_valid_preamble;
|
||||||
|
|
@ -436,6 +453,8 @@ struct aircraft* interactiveReceiveData(struct modesMessage *mm, struct client *
|
||||||
void interactiveShowData(void);
|
void interactiveShowData(void);
|
||||||
void interactiveRemoveStaleAircrafts(void);
|
void interactiveRemoveStaleAircrafts(void);
|
||||||
int decodeBinMessage (struct client *c, char *p);
|
int decodeBinMessage (struct client *c, char *p);
|
||||||
|
struct aircraft *interactiveFindAircraft(uint32_t addr);
|
||||||
|
struct stDF *interactiveFindDF (uint32_t addr);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Functions exported from net_io.c
|
// Functions exported from net_io.c
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
## Fill in name of program here.
|
## Fill in name of program here.
|
||||||
PROG="dump1090"
|
PROG="dump1090"
|
||||||
PROG_PATH="/home/pi/dump1090"
|
PROG_PATH="/home/pi/dump1090"
|
||||||
PROG_ARGS="--quiet --net --net-ro-size 500 --net-ro-rate 5"
|
PROG_ARGS="--quiet --net --net-ro-size 500 --net-ro-rate 5 --net-buffer 5"
|
||||||
PIDFILE="/var/run/dump1090.pid"
|
PIDFILE="/var/run/dump1090.pid"
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
|
|
||||||
118
interactive.c
118
interactive.c
|
|
@ -42,6 +42,87 @@ static uint64_t mstime(void) {
|
||||||
return mst;
|
return mst;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
//=========================================================================
|
||||||
|
//
|
||||||
|
// Add a new DF structure to the interactive mode linked list
|
||||||
|
//
|
||||||
|
void interactiveCreateDF(struct aircraft *a, struct modesMessage *mm) {
|
||||||
|
struct stDF *pDF = (struct stDF *) malloc(sizeof(*pDF));
|
||||||
|
|
||||||
|
if (pDF) {
|
||||||
|
// Default everything to zero/NULL
|
||||||
|
memset(pDF, 0, sizeof(*pDF));
|
||||||
|
|
||||||
|
// Now initialise things
|
||||||
|
pDF->seen = a->seen;
|
||||||
|
pDF->llTimestamp = mm->timestampMsg;
|
||||||
|
pDF->addr = mm->addr;
|
||||||
|
pDF->pAircraft = a;
|
||||||
|
memcpy(pDF->msg, mm->msg, MODES_LONG_MSG_BYTES);
|
||||||
|
|
||||||
|
if (!pthread_mutex_lock(&Modes.pDF_mutex)) {
|
||||||
|
if ((pDF->pNext = Modes.pDF)) {
|
||||||
|
Modes.pDF->pPrev = pDF;
|
||||||
|
}
|
||||||
|
Modes.pDF = pDF;
|
||||||
|
pthread_mutex_unlock(&Modes.pDF_mutex);
|
||||||
|
} else {
|
||||||
|
free(pDF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Remove stale DF's from the interactive mode linked list
|
||||||
|
//
|
||||||
|
void interactiveRemoveStaleDF(time_t now) {
|
||||||
|
struct stDF *pDF = NULL;
|
||||||
|
struct stDF *prev = NULL;
|
||||||
|
|
||||||
|
// Only fiddle with the DF list if we gain possession of the mutex
|
||||||
|
// If we fail to get the mutex we'll get another chance to tidy the
|
||||||
|
// DF list in a second or so.
|
||||||
|
if (!pthread_mutex_trylock(&Modes.pDF_mutex)) {
|
||||||
|
pDF = Modes.pDF;
|
||||||
|
while(pDF) {
|
||||||
|
if ((now - pDF->seen) > Modes.interactive_delete_ttl) {
|
||||||
|
if (Modes.pDF == pDF) {
|
||||||
|
Modes.pDF = NULL;
|
||||||
|
} else {
|
||||||
|
prev->pNext = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// All DF's in the list from here onwards will be time
|
||||||
|
// expired, so delete them all
|
||||||
|
while (pDF) {
|
||||||
|
prev = pDF; pDF = pDF->pNext;
|
||||||
|
free(prev);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
prev = pDF; pDF = pDF->pNext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock (&Modes.pDF_mutex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct stDF *interactiveFindDF(uint32_t addr) {
|
||||||
|
struct stDF *pDF = NULL;
|
||||||
|
|
||||||
|
if (!pthread_mutex_lock(&Modes.pDF_mutex)) {
|
||||||
|
pDF = Modes.pDF;
|
||||||
|
while(pDF) {
|
||||||
|
if (pDF->addr == addr) {
|
||||||
|
pthread_mutex_unlock (&Modes.pDF_mutex);
|
||||||
|
return (pDF);
|
||||||
|
}
|
||||||
|
pDF = pDF->pNext;
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock (&Modes.pDF_mutex);
|
||||||
|
}
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
//
|
||||||
//========================= Interactive mode ===============================
|
//========================= Interactive mode ===============================
|
||||||
//
|
//
|
||||||
// Return a new aircraft structure for the interactive mode linked list
|
// Return a new aircraft structure for the interactive mode linked list
|
||||||
|
|
@ -315,6 +396,11 @@ struct aircraft *interactiveReceiveData(struct modesMessage *mm, struct client *
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we are Logging DF's, and it's not a Mode A/C
|
||||||
|
if ((Modes.bEnableDFLogging) && (mm->msgtype < 32)) {
|
||||||
|
interactiveCreateDF(a,mm);
|
||||||
|
}
|
||||||
|
|
||||||
return (a);
|
return (a);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|
@ -428,7 +514,7 @@ void interactiveShowData(void) {
|
||||||
snprintf(strFl, 6, "%5d", altitude);
|
snprintf(strFl, 6, "%5d", altitude);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%06x %-4s %-4s %-8s %5s %3s %3s %7s %8s %3d %5d %2d\n",
|
printf("%06X %-4s %-4s %-8s %5s %3s %3s %7s %8s %3d %5d %2d\n",
|
||||||
a->addr, strMode, strSquawk, a->flight, strFl, strGs, strTt,
|
a->addr, strMode, strSquawk, a->flight, strFl, strGs, strTt,
|
||||||
strLat, strLon, signalAverage, msgs, (int)(now - a->seen));
|
strLat, strLon, signalAverage, msgs, (int)(now - a->seen));
|
||||||
}
|
}
|
||||||
|
|
@ -449,22 +535,24 @@ void interactiveRemoveStaleAircrafts(void) {
|
||||||
struct aircraft *prev = NULL;
|
struct aircraft *prev = NULL;
|
||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
|
|
||||||
while(a) {
|
// Only do cleanup once per second
|
||||||
if ((now - a->seen) > Modes.interactive_delete_ttl) {
|
if (Modes.last_cleanup_time != now) {
|
||||||
struct aircraft *next = a->next;
|
Modes.last_cleanup_time = now;
|
||||||
// Remove the element from the linked list, with care
|
|
||||||
// if we are removing the first element
|
|
||||||
|
|
||||||
if (!prev)
|
interactiveRemoveStaleDF(now);
|
||||||
Modes.aircrafts = next;
|
|
||||||
else
|
|
||||||
prev->next = next;
|
|
||||||
|
|
||||||
free(a);
|
while(a) {
|
||||||
a = next;
|
if ((now - a->seen) > Modes.interactive_delete_ttl) {
|
||||||
} else {
|
// Remove the element from the linked list, with care
|
||||||
prev = a;
|
// if we are removing the first element
|
||||||
a = a->next;
|
if (!prev) {
|
||||||
|
Modes.aircrafts = a->next; free(a); a = Modes.aircrafts;
|
||||||
|
} else {
|
||||||
|
prev->next = a->next; free(a); a = prev->next;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
prev = a; a = a->next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
132
mode_s.c
132
mode_s.c
|
|
@ -907,6 +907,10 @@ void decodeModesMessage(struct modesMessage *mm, unsigned char *msg) {
|
||||||
mm->crcok = ICAOAddressWasRecentlySeen(mm->addr = mm->crc);
|
mm->crcok = ICAOAddressWasRecentlySeen(mm->addr = mm->crc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we're checking CRC and the CRC is invalid, then we can't trust any
|
||||||
|
// of the data contents, so save time and give up now.
|
||||||
|
if ((Modes.check_crc) && (!mm->crcok)) { return;}
|
||||||
|
|
||||||
// Fields for DF0, DF16
|
// Fields for DF0, DF16
|
||||||
if (mm->msgtype == 0 || mm->msgtype == 16) {
|
if (mm->msgtype == 0 || mm->msgtype == 16) {
|
||||||
if (msg[0] & 0x04) { // VS Bit
|
if (msg[0] & 0x04) { // VS Bit
|
||||||
|
|
@ -982,32 +986,6 @@ void decodeModesMessage(struct modesMessage *mm, unsigned char *msg) {
|
||||||
|
|
||||||
mm->flight[8] = '\0';
|
mm->flight[8] = '\0';
|
||||||
|
|
||||||
} else if (metype >= 5 && metype <= 18) { // Position Message
|
|
||||||
mm->raw_latitude = ((msg[6] & 3) << 15) | (msg[7] << 7) | (msg[8] >> 1);
|
|
||||||
mm->raw_longitude = ((msg[8] & 1) << 16) | (msg[9] << 8) | (msg[10]);
|
|
||||||
mm->bFlags |= (mm->msg[6] & 0x04) ? MODES_ACFLAGS_LLODD_VALID
|
|
||||||
: MODES_ACFLAGS_LLEVEN_VALID;
|
|
||||||
if (metype >= 9) { // Airborne
|
|
||||||
int AC12Field = ((msg[5] << 4) | (msg[6] >> 4)) & 0x0FFF;
|
|
||||||
mm->bFlags |= MODES_ACFLAGS_AOG_VALID;
|
|
||||||
if (AC12Field) {// Only attempt to decode if a valid (non zero) altitude is present
|
|
||||||
mm->bFlags |= MODES_ACFLAGS_ALTITUDE_VALID;
|
|
||||||
mm->altitude = decodeAC12Field(AC12Field, &mm->unit);
|
|
||||||
}
|
|
||||||
} else { // Ground
|
|
||||||
int movement = ((msg[4] << 4) | (msg[5] >> 4)) & 0x007F;
|
|
||||||
mm->bFlags |= MODES_ACFLAGS_AOG_VALID | MODES_ACFLAGS_AOG;
|
|
||||||
if ((movement) && (movement < 125)) {
|
|
||||||
mm->bFlags |= MODES_ACFLAGS_SPEED_VALID;
|
|
||||||
mm->velocity = decodeMovementField(movement);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg[5] & 0x08) {
|
|
||||||
mm->bFlags |= MODES_ACFLAGS_HEADING_VALID;
|
|
||||||
mm->heading = ((((msg[5] << 4) | (msg[6] >> 4)) & 0x007F) * 45) >> 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (metype == 19) { // Airborne Velocity Message
|
} else if (metype == 19) { // Airborne Velocity Message
|
||||||
|
|
||||||
// Presumably airborne if we get an Airborne Velocity Message
|
// Presumably airborne if we get an Airborne Velocity Message
|
||||||
|
|
@ -1076,23 +1054,62 @@ void decodeModesMessage(struct modesMessage *mm, unsigned char *msg) {
|
||||||
mm->heading = ((((msg[5] & 0x03) << 8) | msg[6]) * 45) >> 7;
|
mm->heading = ((((msg[5] & 0x03) << 8) | msg[6]) * 45) >> 7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (mm->metype == 23) { // Test metype squawk field
|
|
||||||
if (mm->mesub == 7) { // (see 1090-WP-15-20)
|
} else if (metype >= 5 && metype <= 22) { // Position Message
|
||||||
|
mm->raw_latitude = ((msg[6] & 3) << 15) | (msg[7] << 7) | (msg[8] >> 1);
|
||||||
|
mm->raw_longitude = ((msg[8] & 1) << 16) | (msg[9] << 8) | (msg[10]);
|
||||||
|
mm->bFlags |= (mm->msg[6] & 0x04) ? MODES_ACFLAGS_LLODD_VALID
|
||||||
|
: MODES_ACFLAGS_LLEVEN_VALID;
|
||||||
|
if (metype >= 9) { // Airborne
|
||||||
|
int AC12Field = ((msg[5] << 4) | (msg[6] >> 4)) & 0x0FFF;
|
||||||
|
mm->bFlags |= MODES_ACFLAGS_AOG_VALID;
|
||||||
|
if (AC12Field) {// Only attempt to decode if a valid (non zero) altitude is present
|
||||||
|
mm->bFlags |= MODES_ACFLAGS_ALTITUDE_VALID;
|
||||||
|
mm->altitude = decodeAC12Field(AC12Field, &mm->unit);
|
||||||
|
}
|
||||||
|
} else { // Ground
|
||||||
|
int movement = ((msg[4] << 4) | (msg[5] >> 4)) & 0x007F;
|
||||||
|
mm->bFlags |= MODES_ACFLAGS_AOG_VALID | MODES_ACFLAGS_AOG;
|
||||||
|
if ((movement) && (movement < 125)) {
|
||||||
|
mm->bFlags |= MODES_ACFLAGS_SPEED_VALID;
|
||||||
|
mm->velocity = decodeMovementField(movement);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msg[5] & 0x08) {
|
||||||
|
mm->bFlags |= MODES_ACFLAGS_HEADING_VALID;
|
||||||
|
mm->heading = ((((msg[5] << 4) | (msg[6] >> 4)) & 0x007F) * 45) >> 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (metype == 23) { // Test metype squawk field
|
||||||
|
if (mesub == 7) { // (see 1090-WP-15-20)
|
||||||
int ID13Field = (((msg[5] << 8) | msg[6]) & 0xFFF1)>>3;
|
int ID13Field = (((msg[5] << 8) | msg[6]) & 0xFFF1)>>3;
|
||||||
if (ID13Field) {
|
if (ID13Field) {
|
||||||
mm->bFlags |= MODES_ACFLAGS_SQUAWK_VALID;
|
mm->bFlags |= MODES_ACFLAGS_SQUAWK_VALID;
|
||||||
mm->modeA = decodeID13Field(ID13Field);
|
mm->modeA = decodeID13Field(ID13Field);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (mm->metype == 28) { // Emergency status squawk field
|
|
||||||
if (mm->mesub == 1) {
|
} else if (metype == 24) { // Reserved for Surface System Status
|
||||||
|
|
||||||
|
} else if (metype == 28) { // Extended Squitter Aircraft Status
|
||||||
|
if (mesub == 1) { // Emergency status squawk field
|
||||||
int ID13Field = (((msg[5] << 8) | msg[6]) & 0x1FFF);
|
int ID13Field = (((msg[5] << 8) | msg[6]) & 0x1FFF);
|
||||||
if (ID13Field) {
|
if (ID13Field) {
|
||||||
mm->bFlags |= MODES_ACFLAGS_SQUAWK_VALID;
|
mm->bFlags |= MODES_ACFLAGS_SQUAWK_VALID;
|
||||||
mm->modeA = decodeID13Field(ID13Field);
|
mm->modeA = decodeID13Field(ID13Field);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
} else if (metype == 29) { // Aircraft Trajectory Intent
|
||||||
|
|
||||||
|
} else if (metype == 30) { // Aircraft Operational Coordination
|
||||||
|
|
||||||
|
} else if (metype == 31) { // Aircraft Operational Status
|
||||||
|
|
||||||
|
} else { // Other metypes
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fields for DF20, DF21 Comm-B
|
// Fields for DF20, DF21 Comm-B
|
||||||
|
|
@ -1268,20 +1285,6 @@ void displayModesMessage(struct modesMessage *mm) {
|
||||||
printf(" Aircraft Type : %c%d\n", ('A' + 4 - mm->metype), mm->mesub);
|
printf(" Aircraft Type : %c%d\n", ('A' + 4 - mm->metype), mm->mesub);
|
||||||
printf(" Identification : %s\n", mm->flight);
|
printf(" Identification : %s\n", mm->flight);
|
||||||
|
|
||||||
//} else if (mm->metype >= 5 && mm->metype <= 8) { // Surface position
|
|
||||||
|
|
||||||
} else if (mm->metype >= 9 && mm->metype <= 18) { // Airborne position Baro
|
|
||||||
printf(" F flag : %s\n", (mm->msg[6] & 0x04) ? "odd" : "even");
|
|
||||||
printf(" T flag : %s\n", (mm->msg[6] & 0x08) ? "UTC" : "non-UTC");
|
|
||||||
printf(" Altitude : %d feet\n", mm->altitude);
|
|
||||||
if (mm->bFlags & MODES_ACFLAGS_LATLON_VALID) {
|
|
||||||
printf(" Latitude : %f\n", mm->fLat);
|
|
||||||
printf(" Longitude: %f\n", mm->fLon);
|
|
||||||
} else {
|
|
||||||
printf(" Latitude : %d (not decoded)\n", mm->raw_latitude);
|
|
||||||
printf(" Longitude: %d (not decoded)\n", mm->raw_longitude);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (mm->metype == 19) { // Airborne Velocity
|
} else if (mm->metype == 19) { // Airborne Velocity
|
||||||
if (mm->mesub == 1 || mm->mesub == 2) {
|
if (mm->mesub == 1 || mm->mesub == 2) {
|
||||||
printf(" EW status : %s\n", (mm->bFlags & MODES_ACFLAGS_EWSPEED_VALID) ? "Valid" : "Unavailable");
|
printf(" EW status : %s\n", (mm->bFlags & MODES_ACFLAGS_EWSPEED_VALID) ? "Valid" : "Unavailable");
|
||||||
|
|
@ -1305,7 +1308,17 @@ void displayModesMessage(struct modesMessage *mm) {
|
||||||
printf(" Unrecognized ME subtype: %d subtype: %d\n", mm->metype, mm->mesub);
|
printf(" Unrecognized ME subtype: %d subtype: %d\n", mm->metype, mm->mesub);
|
||||||
}
|
}
|
||||||
|
|
||||||
//} else if (mm->metype >= 20 && mm->metype <= 22) { // Airborne position GNSS
|
} else if (mm->metype >= 5 && mm->metype <= 22) { // Airborne position Baro
|
||||||
|
printf(" F flag : %s\n", (mm->msg[6] & 0x04) ? "odd" : "even");
|
||||||
|
printf(" T flag : %s\n", (mm->msg[6] & 0x08) ? "UTC" : "non-UTC");
|
||||||
|
printf(" Altitude : %d feet\n", mm->altitude);
|
||||||
|
if (mm->bFlags & MODES_ACFLAGS_LATLON_VALID) {
|
||||||
|
printf(" Latitude : %f\n", mm->fLat);
|
||||||
|
printf(" Longitude: %f\n", mm->fLon);
|
||||||
|
} else {
|
||||||
|
printf(" Latitude : %d (not decoded)\n", mm->raw_latitude);
|
||||||
|
printf(" Longitude: %d (not decoded)\n", mm->raw_longitude);
|
||||||
|
}
|
||||||
|
|
||||||
} else if (mm->metype == 28) { // Extended Squitter Aircraft Status
|
} else if (mm->metype == 28) { // Extended Squitter Aircraft Status
|
||||||
if (mm->mesub == 1) {
|
if (mm->mesub == 1) {
|
||||||
|
|
@ -1343,20 +1356,6 @@ void displayModesMessage(struct modesMessage *mm) {
|
||||||
printf(" Aircraft Type : %c%d\n", ('A' + 4 - mm->metype), mm->mesub);
|
printf(" Aircraft Type : %c%d\n", ('A' + 4 - mm->metype), mm->mesub);
|
||||||
printf(" Identification : %s\n", mm->flight);
|
printf(" Identification : %s\n", mm->flight);
|
||||||
|
|
||||||
//} else if (mm->metype >= 5 && mm->metype <= 8) { // Surface position
|
|
||||||
|
|
||||||
} else if (mm->metype >= 9 && mm->metype <= 18) { // Airborne position Baro
|
|
||||||
printf(" F flag : %s\n", (mm->msg[6] & 0x04) ? "odd" : "even");
|
|
||||||
printf(" T flag : %s\n", (mm->msg[6] & 0x08) ? "UTC" : "non-UTC");
|
|
||||||
printf(" Altitude : %d feet\n", mm->altitude);
|
|
||||||
if (mm->bFlags & MODES_ACFLAGS_LATLON_VALID) {
|
|
||||||
printf(" Latitude : %f\n", mm->fLat);
|
|
||||||
printf(" Longitude: %f\n", mm->fLon);
|
|
||||||
} else {
|
|
||||||
printf(" Latitude : %d (not decoded)\n", mm->raw_latitude);
|
|
||||||
printf(" Longitude: %d (not decoded)\n", mm->raw_longitude);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (mm->metype == 19) { // Airborne Velocity
|
} else if (mm->metype == 19) { // Airborne Velocity
|
||||||
if (mm->mesub == 1 || mm->mesub == 2) {
|
if (mm->mesub == 1 || mm->mesub == 2) {
|
||||||
printf(" EW status : %s\n", (mm->bFlags & MODES_ACFLAGS_EWSPEED_VALID) ? "Valid" : "Unavailable");
|
printf(" EW status : %s\n", (mm->bFlags & MODES_ACFLAGS_EWSPEED_VALID) ? "Valid" : "Unavailable");
|
||||||
|
|
@ -1380,7 +1379,17 @@ void displayModesMessage(struct modesMessage *mm) {
|
||||||
printf(" Unrecognized ME subtype: %d subtype: %d\n", mm->metype, mm->mesub);
|
printf(" Unrecognized ME subtype: %d subtype: %d\n", mm->metype, mm->mesub);
|
||||||
}
|
}
|
||||||
|
|
||||||
//} else if (mm->metype >= 20 && mm->metype <= 22) { // Airborne position GNSS
|
} else if (mm->metype >= 5 && mm->metype <= 22) { // Ground or Airborne position, Baro or GNSS
|
||||||
|
printf(" F flag : %s\n", (mm->msg[6] & 0x04) ? "odd" : "even");
|
||||||
|
printf(" T flag : %s\n", (mm->msg[6] & 0x08) ? "UTC" : "non-UTC");
|
||||||
|
printf(" Altitude : %d feet\n", mm->altitude);
|
||||||
|
if (mm->bFlags & MODES_ACFLAGS_LATLON_VALID) {
|
||||||
|
printf(" Latitude : %f\n", mm->fLat);
|
||||||
|
printf(" Longitude: %f\n", mm->fLon);
|
||||||
|
} else {
|
||||||
|
printf(" Latitude : %d (not decoded)\n", mm->raw_latitude);
|
||||||
|
printf(" Longitude: %d (not decoded)\n", mm->raw_longitude);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printf(" Unrecognized ME type: %d subtype: %d\n", mm->metype, mm->mesub);
|
printf(" Unrecognized ME type: %d subtype: %d\n", mm->metype, mm->mesub);
|
||||||
|
|
@ -2035,7 +2044,6 @@ void decodeCPR(struct aircraft *a, int fflag, int surface) {
|
||||||
surface_rlat = Modes.fUserLat;
|
surface_rlat = Modes.fUserLat;
|
||||||
surface_rlon = Modes.fUserLon;
|
surface_rlon = Modes.fUserLon;
|
||||||
} else {
|
} else {
|
||||||
surface_rlat = Modes.fUserLat;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rlat0 += floor(surface_rlat / 90.0) * 90.0; // Move from 1st quadrant to our quadrant
|
rlat0 += floor(surface_rlat / 90.0) * 90.0; // Move from 1st quadrant to our quadrant
|
||||||
|
|
|
||||||
32
net_io.c
32
net_io.c
|
|
@ -374,9 +374,19 @@ void modesSendSBSOutput(struct modesMessage *mm) {
|
||||||
p += sprintf(p, ",");
|
p += sprintf(p, ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Field 13 and 14 are the ground Speed and Heading (if we have them)
|
// Field 13 is the ground Speed (if we have it)
|
||||||
if (mm->bFlags & MODES_ACFLAGS_NSEWSPD_VALID) {p += sprintf(p, ",%d,%d", mm->velocity, mm->heading);}
|
if (mm->bFlags & MODES_ACFLAGS_SPEED_VALID) {
|
||||||
else {p += sprintf(p, ",,");}
|
p += sprintf(p, ",%d", mm->velocity);
|
||||||
|
} else {
|
||||||
|
p += sprintf(p, ",");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field 14 is the ground Heading (if we have it)
|
||||||
|
if (mm->bFlags & MODES_ACFLAGS_HEADING_VALID) {
|
||||||
|
p += sprintf(p, ",%d", mm->heading);
|
||||||
|
} else {
|
||||||
|
p += sprintf(p, ",");
|
||||||
|
}
|
||||||
|
|
||||||
// Fields 15 and 16 are the Lat/Lon (if we have it)
|
// Fields 15 and 16 are the Lat/Lon (if we have it)
|
||||||
if (mm->bFlags & MODES_ACFLAGS_LATLON_VALID) {p += sprintf(p, ",%1.5f,%1.5f", mm->fLat, mm->fLon);}
|
if (mm->bFlags & MODES_ACFLAGS_LATLON_VALID) {p += sprintf(p, ",%1.5f,%1.5f", mm->fLat, mm->fLon);}
|
||||||
|
|
@ -462,16 +472,20 @@ int decodeBinMessage(struct client *c, char *p) {
|
||||||
int msgLen = 0;
|
int msgLen = 0;
|
||||||
int j;
|
int j;
|
||||||
char ch;
|
char ch;
|
||||||
|
char * ptr;
|
||||||
unsigned char msg[MODES_LONG_MSG_BYTES];
|
unsigned char msg[MODES_LONG_MSG_BYTES];
|
||||||
struct modesMessage mm;
|
struct modesMessage mm;
|
||||||
MODES_NOTUSED(c);
|
MODES_NOTUSED(c);
|
||||||
memset(&mm, 0, sizeof(mm));
|
memset(&mm, 0, sizeof(mm));
|
||||||
|
|
||||||
if ((*p == '1') && (Modes.mode_ac)) { // skip ModeA/C unless user enables --modes-ac
|
ch = *p++; /// Get the message type
|
||||||
|
if (0x1A == ch) {p++;}
|
||||||
|
|
||||||
|
if ((ch == '1') && (Modes.mode_ac)) { // skip ModeA/C unless user enables --modes-ac
|
||||||
msgLen = MODEAC_MSG_BYTES;
|
msgLen = MODEAC_MSG_BYTES;
|
||||||
} else if (*p == '2') {
|
} else if (ch == '2') {
|
||||||
msgLen = MODES_SHORT_MSG_BYTES;
|
msgLen = MODES_SHORT_MSG_BYTES;
|
||||||
} else if (*p == '3') {
|
} else if (ch == '3') {
|
||||||
msgLen = MODES_LONG_MSG_BYTES;
|
msgLen = MODES_LONG_MSG_BYTES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -479,8 +493,10 @@ int decodeBinMessage(struct client *c, char *p) {
|
||||||
// Mark messages received over the internet as remote so that we don't try to
|
// Mark messages received over the internet as remote so that we don't try to
|
||||||
// pass them off as being received by this instance when forwarding them
|
// pass them off as being received by this instance when forwarding them
|
||||||
mm.remote = 1;
|
mm.remote = 1;
|
||||||
for (j = 0; j < 7; j++) { // Skip the message type and timestamp
|
|
||||||
ch = *p++;
|
ptr = (char*) &mm.timestampMsg;
|
||||||
|
for (j = 0; j < 6; j++) { // Grab the timestamp (big endian format)
|
||||||
|
ptr[5-j] = ch = *p++;
|
||||||
if (0x1A == ch) {p++;}
|
if (0x1A == ch) {p++;}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
11
ppup1090.c
11
ppup1090.c
|
|
@ -51,6 +51,7 @@ void ppup1090InitConfig(void) {
|
||||||
// Now initialise things that should not be 0/NULL to their defaults
|
// Now initialise things that should not be 0/NULL to their defaults
|
||||||
Modes.check_crc = 1;
|
Modes.check_crc = 1;
|
||||||
Modes.quiet = 1;
|
Modes.quiet = 1;
|
||||||
|
Modes.bEnableDFLogging = 1;
|
||||||
strcpy(ppup1090.net_input_beast_ipaddr,PPUP1090_NET_OUTPUT_IP_ADDRESS);
|
strcpy(ppup1090.net_input_beast_ipaddr,PPUP1090_NET_OUTPUT_IP_ADDRESS);
|
||||||
Modes.net_input_beast_port = MODES_NET_OUTPUT_BEAST_PORT;
|
Modes.net_input_beast_port = MODES_NET_OUTPUT_BEAST_PORT;
|
||||||
Modes.interactive_delete_ttl = MODES_INTERACTIVE_DELETE_TTL;
|
Modes.interactive_delete_ttl = MODES_INTERACTIVE_DELETE_TTL;
|
||||||
|
|
@ -71,6 +72,10 @@ void ppup1090Init(void) {
|
||||||
|
|
||||||
int iErr;
|
int iErr;
|
||||||
|
|
||||||
|
pthread_mutex_init(&Modes.pDF_mutex,NULL);
|
||||||
|
pthread_mutex_init(&Modes.data_mutex,NULL);
|
||||||
|
pthread_cond_init(&Modes.data_cond,NULL);
|
||||||
|
|
||||||
// Allocate the various buffers used by Modes
|
// Allocate the various buffers used by Modes
|
||||||
if ( NULL == (Modes.icao_cache = (uint32_t *) malloc(sizeof(uint32_t) * MODES_ICAO_CACHE_LEN * 2)))
|
if ( NULL == (Modes.icao_cache = (uint32_t *) malloc(sizeof(uint32_t) * MODES_ICAO_CACHE_LEN * 2)))
|
||||||
{
|
{
|
||||||
|
|
@ -104,6 +109,7 @@ void ppup1090Init(void) {
|
||||||
modesInitErrorInfo();
|
modesInitErrorInfo();
|
||||||
|
|
||||||
// Setup the uploader - read the user paramaters from the coaa.h header file
|
// Setup the uploader - read the user paramaters from the coaa.h header file
|
||||||
|
coaa1090.ppIPAddr = ppup1090.net_pp_ipaddr;
|
||||||
coaa1090.fUserLat = MODES_USER_LATITUDE_DFLT;
|
coaa1090.fUserLat = MODES_USER_LATITUDE_DFLT;
|
||||||
coaa1090.fUserLon = MODES_USER_LONGITUDE_DFLT;
|
coaa1090.fUserLon = MODES_USER_LONGITUDE_DFLT;
|
||||||
strcpy(coaa1090.strAuthCode,STR(USER_AUTHCODE));
|
strcpy(coaa1090.strAuthCode,STR(USER_AUTHCODE));
|
||||||
|
|
@ -126,6 +132,7 @@ void showHelp(void) {
|
||||||
"-----------------------------------------------------------------------------\n"
|
"-----------------------------------------------------------------------------\n"
|
||||||
"--net-bo-ipaddr <IPv4> TCP Beast output listen IPv4 (default: 127.0.0.1)\n"
|
"--net-bo-ipaddr <IPv4> TCP Beast output listen IPv4 (default: 127.0.0.1)\n"
|
||||||
"--net-bo-port <port> TCP Beast output listen port (default: 30005)\n"
|
"--net-bo-port <port> TCP Beast output listen port (default: 30005)\n"
|
||||||
|
"--net-pp-ipaddr <IPv4> Plane Plotter LAN IPv4 Address (default: 0.0.0.0)\n"
|
||||||
"--quiet Disable output to stdout. Use for daemon applications\n"
|
"--quiet Disable output to stdout. Use for daemon applications\n"
|
||||||
"--help Show this help\n"
|
"--help Show this help\n"
|
||||||
);
|
);
|
||||||
|
|
@ -185,6 +192,8 @@ int main(int argc, char **argv) {
|
||||||
Modes.net_input_beast_port = atoi(argv[++j]);
|
Modes.net_input_beast_port = atoi(argv[++j]);
|
||||||
} else if (!strcmp(argv[j],"--net-bo-ipaddr") && more) {
|
} else if (!strcmp(argv[j],"--net-bo-ipaddr") && more) {
|
||||||
strcpy(ppup1090.net_input_beast_ipaddr, argv[++j]);
|
strcpy(ppup1090.net_input_beast_ipaddr, argv[++j]);
|
||||||
|
} else if (!strcmp(argv[j],"--net-pp-ipaddr") && more) {
|
||||||
|
inet_aton(argv[++j], (void *)&ppup1090.net_pp_ipaddr);
|
||||||
} else if (!strcmp(argv[j],"--quiet")) {
|
} else if (!strcmp(argv[j],"--quiet")) {
|
||||||
ppup1090.quiet = 1;
|
ppup1090.quiet = 1;
|
||||||
} else if (!strcmp(argv[j],"--help")) {
|
} else if (!strcmp(argv[j],"--help")) {
|
||||||
|
|
@ -199,7 +208,7 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Try to comply with the Copyright license conditions for binary distribution
|
// Try to comply with the Copyright license conditions for binary distribution
|
||||||
if (!Modes.quiet) {showCopyright();}
|
if (!ppup1090.quiet) {showCopyright();}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Initialization
|
// Initialization
|
||||||
|
|
|
||||||
19
ppup1090.h
19
ppup1090.h
|
|
@ -45,6 +45,9 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <netinet/tcp.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
@ -69,19 +72,21 @@
|
||||||
|
|
||||||
// Program global state
|
// Program global state
|
||||||
struct { // Internal state
|
struct { // Internal state
|
||||||
int quiet;
|
int quiet;
|
||||||
// Networking
|
// Networking
|
||||||
char net_input_beast_ipaddr[32]; // IPv4 address or network name of server/RPi
|
uint32_t net_pp_ipaddr; // IPv4 address of PP instance
|
||||||
|
char net_input_beast_ipaddr[32]; // IPv4 address or network name of server/RPi
|
||||||
} ppup1090;
|
} ppup1090;
|
||||||
|
|
||||||
|
|
||||||
// COAA Initialisation structure
|
// COAA Initialisation structure
|
||||||
struct _coaa1090 {
|
struct _coaa1090 {
|
||||||
double fUserLat;
|
uint32_t ppIPAddr;
|
||||||
double fUserLon;
|
double fUserLat;
|
||||||
char strAuthCode[16];
|
double fUserLon;
|
||||||
char strRegNo[16];
|
char strAuthCode[16];
|
||||||
char strVersion[16];
|
char strRegNo[16];
|
||||||
|
char strVersion[16];
|
||||||
} coaa1090;
|
} coaa1090;
|
||||||
|
|
||||||
// ======================== function declarations =========================
|
// ======================== function declarations =========================
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
#!/bin/bash
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
#
|
||||||
|
# Provides: dump1090
|
||||||
|
# Required-Start: $remote_fs
|
||||||
|
# Required-Stop: $remote_fs
|
||||||
|
# Default-Start: 2 3 4 5
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Short-Description: dump1090 initscript
|
||||||
|
|
||||||
|
#
|
||||||
|
### END INIT INFO
|
||||||
|
## Fill in name of program here.
|
||||||
|
PROG="dump1090"
|
||||||
|
PROG_PATH="/home/pi/dump1090"
|
||||||
|
PROG_ARGS="--quiet --net --net-ro-size 500 --net-ro-rate 5 --net-buffer 5"
|
||||||
|
PIDFILE="/var/run/dump1090.pid"
|
||||||
|
PROG2="ppup1090"
|
||||||
|
PROG2_ARGS="--quiet --net-pp-addr 192.168.1.64"
|
||||||
|
PIDFILE2="/var/run/$PROG2.pid"
|
||||||
|
DELAY=5
|
||||||
|
|
||||||
|
start() {
|
||||||
|
if [ -e $PIDFILE ]; then
|
||||||
|
## Program is running, exit with error.
|
||||||
|
echo "Error! $PROG is currently running!" 1>&2
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
## Change from /dev/null to something like /var/log/$PROG if you want to save output.
|
||||||
|
cd $PROG_PATH
|
||||||
|
./$PROG $PROG_ARGS 2>&1 >/dev/null &
|
||||||
|
echo "$PROG started, waiting $DELAY seconds"
|
||||||
|
touch $PIDFILE
|
||||||
|
sleep $DELAY
|
||||||
|
echo "Attempting to start $PROG2.."
|
||||||
|
./$PROG2 $PROG2_ARGS 2>1 >/dev/null &
|
||||||
|
echo "$PROG2 started"
|
||||||
|
touch $PIDFILE2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
if [ -e $PIDFILE ]; then
|
||||||
|
## Program is running, so stop it
|
||||||
|
echo "$PROG is running"
|
||||||
|
killall $PROG2
|
||||||
|
killall $PROG
|
||||||
|
rm -f $PIDFILE2
|
||||||
|
rm -f $PIDFILE
|
||||||
|
echo "$PROG stopped"
|
||||||
|
else
|
||||||
|
## Program is not running, exit with error.
|
||||||
|
echo "Error! $PROG not started!" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
## Check to see if we are running as root first.
|
||||||
|
## Found at http://www.cyberciti.biz/tips/shell-root-user-check-script.html
|
||||||
|
if [ "$(id -u)" != "0" ]; then
|
||||||
|
echo "This script must be run as root" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
reload|restart|force-reload)
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
**)
|
||||||
|
echo "Usage: $0 {start|stop|reload}" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
#
|
||||||
|
|
||||||
16
view1090.c
16
view1090.c
|
|
@ -83,6 +83,21 @@ void view1090InitConfig(void) {
|
||||||
//
|
//
|
||||||
void view1090Init(void) {
|
void view1090Init(void) {
|
||||||
|
|
||||||
|
pthread_mutex_init(&Modes.pDF_mutex,NULL);
|
||||||
|
pthread_mutex_init(&Modes.data_mutex,NULL);
|
||||||
|
pthread_cond_init(&Modes.data_cond,NULL);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
if ( (!Modes.wsaData.wVersion)
|
||||||
|
&& (!Modes.wsaData.wHighVersion) ) {
|
||||||
|
// Try to start the windows socket support
|
||||||
|
if (WSAStartup(MAKEWORD(2,1),&Modes.wsaData) != 0)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "WSAStartup returned Error\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Allocate the various buffers used by Modes
|
// Allocate the various buffers used by Modes
|
||||||
if ( NULL == (Modes.icao_cache = (uint32_t *) malloc(sizeof(uint32_t) * MODES_ICAO_CACHE_LEN * 2)))
|
if ( NULL == (Modes.icao_cache = (uint32_t *) malloc(sizeof(uint32_t) * MODES_ICAO_CACHE_LEN * 2)))
|
||||||
{
|
{
|
||||||
|
|
@ -262,6 +277,7 @@ int main(int argc, char **argv) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Try to comply with the Copyright license conditions for binary distribution
|
// Try to comply with the Copyright license conditions for binary distribution
|
||||||
if (!Modes.quiet) {showCopyright();}
|
if (!Modes.quiet) {showCopyright();}
|
||||||
|
#define MSG_DONTWAIT 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue