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 26, 2024
1 parent 0c87e59 commit eebf95a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
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 eebf95a

Please sign in to comment.