Merge pull request #13 from kukabu/master

Code cleanup
This commit is contained in:
Oliver Jowett 2017-07-28 14:06:37 +01:00 committed by GitHub
commit 43b0f5a75a
7 changed files with 6 additions and 20 deletions

View file

@ -3,13 +3,8 @@ PROGNAME=dump1090
RTLSDR ?= yes
BLADERF ?= yes
CC=gcc
CPPFLAGS += -DMODES_DUMP1090_VERSION=\"$(DUMP1090_VERSION)\" -DMODES_DUMP1090_VARIANT=\"dump1090-fa\"
ifneq ($(HTMLPATH),"")
CPPFLAGS += -DHTMLPATH=\"$(HTMLPATH)\"
endif
DIALECT = -std=c11
CFLAGS += $(DIALECT) -O2 -g -Wall -Werror -W -D_DEFAULT_SOURCE
LIBS = -lpthread -lm -lrt

View file

@ -4,8 +4,8 @@ Priority: extra
Maintainer: Oliver Jowett <oliver@mutability.co.uk>
Build-Depends: debhelper(>=9), libusb-1.0-0-dev, pkg-config, cmake, libncurses5-dev
Standards-Version: 3.9.3
Homepage: https://github.com/mutability/dump1090
Vcs-Git: https://github.com/mutability/dump1090.git
Homepage: http://www.flightaware.com/
Vcs-Git: https://github.com/flightaware/dump1090.git
Package: dump1090
Architecture: all

View file

@ -22,7 +22,7 @@ install_rtlsdr:
cd rtl-sdr-build && cmake ../rtl-sdr -DCMAKE_INSTALL_PREFIX=./install && make install
override_dh_auto_build: install_rtlsdr
dh_auto_build -- RTLSDR=yes BLADERF=no DIALECT=-std=gnu1x HTMLPATH=/usr/share/$(SRCNAME)/html DUMP1090_VERSION=$(DUMP1090_VERSION) STATIC=yes RTLSDR_PREFIX=rtl-sdr-build/install
dh_auto_build -- RTLSDR=yes BLADERF=no DIALECT=-std=gnu1x DUMP1090_VERSION=$(DUMP1090_VERSION) STATIC=yes RTLSDR_PREFIX=rtl-sdr-build/install
override_dh_auto_test:
dh_auto_test -- DIALECT=-std=gnu1x

4
debian/control vendored
View file

@ -4,8 +4,8 @@ Priority: extra
Maintainer: Oliver Jowett <oliver@mutability.co.uk>
Build-Depends: debhelper(>=9), librtlsdr-dev, libusb-1.0-0-dev, pkg-config, dh-systemd, libncurses5-dev, libbladerf-dev
Standards-Version: 3.9.3
Homepage: https://github.com/mutability/dump1090
Vcs-Git: https://github.com/mutability/dump1090.git
Homepage: http://www.flightaware.com/
Vcs-Git: https://github.com/flightaware/dump1090.git
Package: dump1090
Architecture: all

2
debian/rules vendored
View file

@ -20,7 +20,7 @@ ifeq ($(DEB_HOST_ARCH),armhf)
endif
override_dh_auto_build:
dh_auto_build -- RTLSDR=yes BLADERF=yes HTMLPATH=/usr/share/$(DEB_SOURCE)/html DUMP1090_VERSION=$(DEB_VERSION)
dh_auto_build -- RTLSDR=yes BLADERF=yes DUMP1090_VERSION=$(DEB_VERSION)
override_dh_install:
dh_install

View file

@ -117,7 +117,6 @@ void modesInitConfig(void) {
Modes.net_input_beast_ports = strdup("30004,30104");
Modes.net_output_beast_ports = strdup("30005");
Modes.interactive_display_ttl = MODES_INTERACTIVE_DISPLAY_TTL;
Modes.html_dir = HTMLPATH;
Modes.json_interval = 1000;
Modes.json_location_accuracy = 1;
Modes.maxRange = 1852 * 300; // 300NM default max range
@ -329,7 +328,6 @@ void showHelp(void) {
"--debug <flags> Debug mode (verbose), see README for details\n"
"--quiet Disable output to stdout. Use for daemon applications\n"
"--show-only <addr> Show only messages from the given ICAO on stdout\n"
"--html-dir <dir> Use <dir> as base directory for the internal HTTP server. Defaults to " HTMLPATH "\n"
"--write-json <dir> Periodically write json output to <dir> (for serving by a separate webserver)\n"
"--write-json-every <t> Write json output every t seconds (default 1)\n"
"--json-location-accuracy <n> Accuracy of receiver location in json metadata: 0=no location, 1=approximate, 2=exact\n"
@ -605,8 +603,6 @@ int main(int argc, char **argv) {
Modes.mlat = 1;
} else if (!strcmp(argv[j],"--oversample")) {
// Ignored
} else if (!strcmp(argv[j], "--html-dir") && more) {
Modes.html_dir = strdup(argv[++j]);
#ifndef _WIN32
} else if (!strcmp(argv[j], "--write-json") && more) {
Modes.json_dir = strdup(argv[++j]);

View file

@ -219,10 +219,6 @@ typedef enum {
#define MODES_NET_SNDBUF_SIZE (1024*64)
#define MODES_NET_SNDBUF_MAX (7)
#ifndef HTMLPATH
#define HTMLPATH "./public_html" // default path for gmap.html etc
#endif
#define HISTORY_SIZE 120
#define HISTORY_INTERVAL 30000
@ -335,7 +331,6 @@ struct { // Internal state
int mlat; // Use Beast ascii format for raw data output, i.e. @...; iso *...;
char *json_dir; // Path to json base directory, or NULL not to write json.
uint64_t json_interval; // Interval between rewriting the json aircraft file, in milliseconds; also the advertised map refresh interval
char *html_dir; // Path to www base directory.
int json_location_accuracy; // Accuracy of location metadata: 0=none, 1=approx, 2=exact
int json_aircraft_history_next;