Skip to content

Commit

Permalink
Merge pull request #183 from labomb/bias-t-support
Browse files Browse the repository at this point in the history
optional bias-t support
  • Loading branch information
mutability authored Feb 8, 2017
2 parents ccd8fd5 + eeb7d1d commit 34fb495
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,6 @@ EXTRAPACKAGES="eatmydata debhelper fakeroot"
ALLOWUNTRUSTED="no"
APTKEYRINGS=("/home/oliver/ppa/mutability.gpg")
````

>**Note about Bias-t support:**
Bias-t support is available for RTL-SDR.com V3 dongles. If you wish to enable bias-t support, you must insure that you are building this package with a version of librtlsdr that supports this capability. You can find suitable source packages [here](https://github.com/rtlsdrblog/rtl_biast) and [here](https://github.com/librtlsdr/librtlsdr/tree/master/src). To enable the necessary support code when building, be sure to include preprocessor define macro HAVE_RTL_BIAST.
15 changes: 15 additions & 0 deletions dump1090.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,14 @@ int modesInitRTLSDR(void) {
fprintf(stderr, "Gain reported by device: %.2f dB\n",
rtlsdr_get_tuner_gain(Modes.dev)/10.0);

#ifdef HAVE_RTL_BIAST
if (Modes.enable_rtlsdr_biast) {
rtlsdr_set_bias_tee(Modes.dev, 1);
} else {
rtlsdr_set_bias_tee(Modes.dev, 0);
}
#endif

return 0;
}
//
Expand Down Expand Up @@ -717,6 +725,9 @@ void showHelp(void) {
"--quiet Disable output to stdout. Use for daemon applications\n"
"--show-only <addr> Show only messages from the given ICAO on stdout\n"
"--ppm <error> Set receiver error in parts per million (default 0)\n"
#ifdef HAVE_RTL_BIAST
"--enable-rtlsdr-biast Set bias tee supply on (default off)\n"
#endif
"--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"
Expand Down Expand Up @@ -1073,6 +1084,10 @@ int main(int argc, char **argv) {
exit(0);
} else if (!strcmp(argv[j],"--ppm") && more) {
Modes.ppm_error = atoi(argv[++j]);
#ifdef HAVE_RTL_BIAST
} else if (!strcmp(argv[j], "--enable-rtlsdr-biast")) {
Modes.enable_rtlsdr_biast = 1;
#endif
} else if (!strcmp(argv[j],"--quiet")) {
Modes.quiet = 1;
} else if (!strcmp(argv[j],"--show-only") && more) {
Expand Down
3 changes: 3 additions & 0 deletions dump1090.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ struct { // Internal state
rtlsdr_dev_t *dev;
int freq;
int ppm_error;
#ifdef HAVE_RTL_BIAST
int enable_rtlsdr_biast;
#endif

// Networking
char aneterr[ANET_ERR_LEN];
Expand Down

0 comments on commit 34fb495

Please sign in to comment.