Remove dead tracking code related to the removed PlanePlotter feed.
This commit is contained in:
parent
76474f58ab
commit
43ec58c78e
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -1,6 +1,7 @@
|
|||
dump1090-mutability (1.10.3010.14mu-9) UNRELEASED; urgency=medium
|
||||
|
||||
* Fix warnings. Add -Werror so they break the build in future.
|
||||
* Remove dead tracking code related to the removed PlanePlotter feed.
|
||||
|
||||
-- Oliver Jowett <oliver@mutability.co.uk> Sun, 04 Jan 2015 20:08:01 +0000
|
||||
|
||||
|
|
|
@ -94,7 +94,6 @@ void modesInitConfig(void) {
|
|||
void modesInit(void) {
|
||||
int i, q;
|
||||
|
||||
pthread_mutex_init(&Modes.pDF_mutex,NULL);
|
||||
pthread_mutex_init(&Modes.data_mutex,NULL);
|
||||
pthread_cond_init(&Modes.data_cond,NULL);
|
||||
|
||||
|
|
16
dump1090.h
16
dump1090.h
|
@ -250,16 +250,6 @@ struct aircraft {
|
|||
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;
|
||||
|
||||
// Common stats for non-phase-corrected vs phase-corrected cases
|
||||
struct demod_stats {
|
||||
unsigned int demodulated0;
|
||||
|
@ -383,11 +373,6 @@ struct { // Internal state
|
|||
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
|
||||
unsigned int stat_preamble_no_correlation;
|
||||
unsigned int stat_preamble_not_quiet;
|
||||
|
@ -487,7 +472,6 @@ void interactiveShowData(void);
|
|||
void interactiveRemoveStaleAircrafts(void);
|
||||
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
|
||||
|
|
|
@ -41,87 +41,7 @@ static uint64_t mstime(void) {
|
|||
mst += tv.tv_usec/1000;
|
||||
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 ===============================
|
||||
//
|
||||
|
@ -396,11 +316,6 @@ struct aircraft *interactiveReceiveData(struct modesMessage *mm) {
|
|||
}
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
//
|
||||
|
@ -539,8 +454,6 @@ void interactiveRemoveStaleAircrafts(void) {
|
|||
if (Modes.last_cleanup_time != now) {
|
||||
Modes.last_cleanup_time = now;
|
||||
|
||||
interactiveRemoveStaleDF(now);
|
||||
|
||||
while(a) {
|
||||
if ((now - a->seen) > Modes.interactive_delete_ttl) {
|
||||
// Remove the element from the linked list, with care
|
||||
|
|
|
@ -82,7 +82,6 @@ void view1090InitConfig(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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue