Merge branch 'net-cleanups' into oversampling
Conflicts: dump1090.c dump1090.h
This commit is contained in:
commit
22f2a8db37
4 changed files with 216 additions and 197 deletions
77
mode_s.c
77
mode_s.c
|
|
@ -1875,43 +1875,6 @@ void detectModeS(uint16_t *m, uint32_t mlen) {
|
|||
use_correction = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//Send any remaining partial raw buffers now
|
||||
if (Modes.rawOutUsed || Modes.beastOutUsed)
|
||||
{
|
||||
Modes.net_output_raw_rate_count++;
|
||||
if (Modes.net_output_raw_rate_count > Modes.net_output_raw_rate)
|
||||
{
|
||||
if (Modes.rawOutUsed) {
|
||||
modesSendAllClients(Modes.ros, Modes.rawOut, Modes.rawOutUsed);
|
||||
Modes.rawOutUsed = 0;
|
||||
}
|
||||
if (Modes.beastOutUsed) {
|
||||
modesSendAllClients(Modes.bos, Modes.beastOut, Modes.beastOutUsed);
|
||||
Modes.beastOutUsed = 0;
|
||||
}
|
||||
Modes.net_output_raw_rate_count = 0;
|
||||
}
|
||||
}
|
||||
else if ( (Modes.net)
|
||||
&& (Modes.net_heartbeat_rate)
|
||||
&& ((++Modes.net_heartbeat_count) > Modes.net_heartbeat_rate) ) {
|
||||
//
|
||||
// We haven't received any Mode A/C/S messages for some time. To try and keep any TCP
|
||||
// links alive, send a null frame. This will help stop any routers discarding our TCP
|
||||
// link which will cause an un-recoverable link error if/when a real frame arrives.
|
||||
//
|
||||
// Fudge up a null message
|
||||
memset(&mm, 0, sizeof(mm));
|
||||
mm.msgbits = MODES_SHORT_MSG_BITS;
|
||||
mm.timestampMsg = Modes.timestampBlk;
|
||||
|
||||
// Feed output clients
|
||||
modesQueueOutput(&mm);
|
||||
|
||||
// Reset the heartbeat counter
|
||||
Modes.net_heartbeat_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 2.4MHz sampling rate version
|
||||
|
|
@ -2404,43 +2367,6 @@ void detectModeS_oversample(uint16_t *m, uint32_t mlen) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Send any remaining partial raw buffers now
|
||||
if (Modes.rawOutUsed || Modes.beastOutUsed)
|
||||
{
|
||||
Modes.net_output_raw_rate_count++;
|
||||
if (Modes.net_output_raw_rate_count > Modes.net_output_raw_rate)
|
||||
{
|
||||
if (Modes.rawOutUsed) {
|
||||
modesSendAllClients(Modes.ros, Modes.rawOut, Modes.rawOutUsed);
|
||||
Modes.rawOutUsed = 0;
|
||||
}
|
||||
if (Modes.beastOutUsed) {
|
||||
modesSendAllClients(Modes.bos, Modes.beastOut, Modes.beastOutUsed);
|
||||
Modes.beastOutUsed = 0;
|
||||
}
|
||||
Modes.net_output_raw_rate_count = 0;
|
||||
}
|
||||
}
|
||||
else if ( (Modes.net)
|
||||
&& (Modes.net_heartbeat_rate)
|
||||
&& ((++Modes.net_heartbeat_count) > Modes.net_heartbeat_rate) ) {
|
||||
//
|
||||
// We haven't received any Mode A/C/S messages for some time. To try and keep any TCP
|
||||
// links alive, send a null frame. This will help stop any routers discarding our TCP
|
||||
// link which will cause an un-recoverable link error if/when a real frame arrives.
|
||||
//
|
||||
// Fudge up a null message
|
||||
memset(&mm, 0, sizeof(mm));
|
||||
mm.msgbits = MODES_SHORT_MSG_BITS;
|
||||
mm.timestampMsg = Modes.timestampBlk;
|
||||
|
||||
// Feed output clients
|
||||
modesQueueOutput(&mm);
|
||||
|
||||
// Reset the heartbeat counter
|
||||
Modes.net_heartbeat_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -2468,9 +2394,6 @@ void useModesMessage(struct modesMessage *mm) {
|
|||
|
||||
// Feed output clients
|
||||
if (Modes.net) {modesQueueOutput(mm);}
|
||||
|
||||
// Heartbeat not required whilst we're seeing real messages
|
||||
Modes.net_heartbeat_count = 0;
|
||||
}
|
||||
}
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue