Remove doubled-up banner/header code

This commit is contained in:
Oliver Jowett 2018-02-20 00:24:39 +13:00
parent 1d5db2fd76
commit d6c0612767

View file

@ -2021,39 +2021,15 @@ static const char *sil_type_enum_string(sil_type_t type)
} }
} }
static void writeFATSVBanner()
{
char *p = prepareWrite(&Modes.fatsv_out, TSV_MAX_PACKET_SIZE);
if (!p)
return;
char *end = p + TSV_MAX_PACKET_SIZE;
p = appendFATSV(p, end, "faup1090_format_version", "%s", "2");
--p; // remove last tab
p = safe_snprintf(p, end, "\n");
if (p <= end)
completeWrite(&Modes.fatsv_out, p);
else
fprintf(stderr, "fatsv: output too large (max %d, overran by %d)\n", TSV_MAX_PACKET_SIZE, (int) (p - end));
}
static void writeFATSV() static void writeFATSV()
{ {
struct aircraft *a; struct aircraft *a;
static uint64_t next_update; static uint64_t next_update;
static int first_run = 1;
if (!Modes.fatsv_out.service || !Modes.fatsv_out.service->connections) { if (!Modes.fatsv_out.service || !Modes.fatsv_out.service->connections) {
return; // not enabled or no active connections return; // not enabled or no active connections
} }
if (first_run) {
writeFATSVBanner();
first_run = 0;
}
uint64_t now = mstime(); uint64_t now = mstime();
if (now < next_update) { if (now < next_update) {
return; return;