Skip to content

Commit a67ab90

Browse files
committed
AX-688 - Gate UAV/drone support behind --enable-uav runtime flag
1 parent 6a99c67 commit a67ab90

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

help.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ static struct argp_option optionsReadsb[] = {
5959
{"interactive-ttl", OptInteractiveTTL, "<sec>", 0, "Remove from list if idle for <sec> (default: 60)", 1},
6060
{"modeac", OptModeAc, 0, 0, "Enable decoding of SSR Modes 3/A & 3/C", 1},
6161
{"modeac-auto", OptModeAcAuto, 0, 0, "Enable Mode A/C if requested by a Beast connection", 1},
62+
{"enable-uav", OptEnableUav, 0, 0, "Enable processing of UAV/drone data ($ prefix in SBS input)", 1},
6263
{"max-range", OptMaxRange, "<dist>", 0, "Absolute maximum range for position decoding (in nm, default: 300)", 1},
6364
{"fix", OptFix, 0, 0, "Enable CRC single-bit error correction (default)", 1},
6465
{"no-fix", OptNoFix, 0, 0, "Disable CRC single-bit error correction", 1},

net_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2994,7 +2994,7 @@ static int decodeSbsLine(struct client *c, char *line, int remote, int64_t now,
29942994
char *icao = t[5];
29952995

29962996
// Check for $ prefix (UAV/drone identifier)
2997-
if (icao_len == 7 && icao[0] == '$') {
2997+
if (Modes.enable_uav && icao_len == 7 && icao[0] == '$') {
29982998
is_uav = 1;
29992999
icao = t[5] + 1; // Skip $ prefix
30003000
icao_len = 6;

readsb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,6 +1481,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
14811481
case OptModeAcAuto:
14821482
Modes.mode_ac_auto = 1;
14831483
break;
1484+
case OptEnableUav:
1485+
Modes.enable_uav = 1;
1486+
break;
14841487
case OptNetOnly:
14851488
Modes.net = 1;
14861489
Modes.net_only = 1;

readsb.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ struct _Modes
640640
int8_t raw; // Raw output format
641641
int8_t mode_ac; // Enable decoding of SSR Modes A & C
642642
int8_t mode_ac_auto; // allow toggling of A/C by Beast commands
643+
int8_t enable_uav; // Enable processing of UAV/drone data
643644
int8_t debug_net;
644645
int8_t debug_flush;
645646
int8_t debug_no_discard;
@@ -1272,6 +1273,7 @@ enum {
12721273
OptSoapyBandwith,
12731274
OptSoapyEnableAgc,
12741275
OptSoapyGainElement,
1276+
OptEnableUav,
12751277
};
12761278

12771279

0 commit comments

Comments
 (0)