Skip to content

Commit

Permalink
make --devel=enableClientsJson work
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Oct 29, 2024
1 parent 0c87e59 commit 4f8a0b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mode_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ int decodeModesMessage(struct modesMessage *mm) {
}

// these are messages of general bad quality, treat them as garbage when garbage_ports is in use.
if ((Modes.netIngest || Modes.garbage_ports) && mm->remote && mm->timestamp == 0 && mm->msgtype != 18) {
if ((Modes.netIngest || Modes.garbage_ports) && mm->remote && mm->timestamp == 0 && (mm->msgtype != 18 || mm->addrtype == ADDR_ADSB_ICAO_NT)) {
mm->garbage = 1;
mm->source = SOURCE_SBS;
if (mm->addrtype >= ADDR_OTHER)
Expand Down
14 changes: 8 additions & 6 deletions readsb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1960,8 +1960,8 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
if (strcasecmp(token[0], "disableAcasJson") == 0) {
Modes.enableAcasJson = 0;
}
if (strcasecmp(token[0], "enableConnsJson") == 0) {
Modes.enableConnsJson = 1;
if (strcasecmp(token[0], "enableClientsJson") == 0) {
Modes.enableClientsJson = 1;
}
if (strcasecmp(token[0], "tar1090NoGlobe") == 0) {
Modes.tar1090_no_globe = 1;
Expand Down Expand Up @@ -2575,12 +2575,14 @@ static void miscStuff(int64_t now) {
static int64_t next_clients_json;
if (Modes.json_dir && now > next_clients_json) {
next_clients_json = now + 10 * SECONDS;
if (Modes.enableConnsJson) {
}
if (Modes.netIngest)

if (Modes.netIngest || Modes.enableClientsJson) {
free(writeJsonToFile(Modes.json_dir, "clients.json", generateClientsJson()).buffer);
if (Modes.netReceiverIdJson)
}

if (Modes.netReceiverIdJson) {
free(writeJsonToFile(Modes.json_dir, "receivers.json", generateReceiversJson()).buffer);
}

return;
}
Expand Down
2 changes: 1 addition & 1 deletion readsb.h
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ struct _Modes
int8_t netReceiverIdPrint;
int8_t netReceiverIdJson;
int8_t netIngest;
int8_t enableConnsJson;
int8_t enableClientsJson;
int8_t forward_mlat; // forward beast mlat messages to beast output ports
int8_t forward_mlat_sbs; // forward mlat messages to sbs output ports
int8_t beast_forward_noforward;
Expand Down

0 comments on commit 4f8a0b4

Please sign in to comment.