From 0b9582045e57b35833ebabee41531302325c5378 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 14 Jan 2017 07:17:06 +0100 Subject: [PATCH] Added options to specify own position --- dsd_main.cpp | 16 +++++++++++++++- messagefile.md | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/dsd_main.cpp b/dsd_main.cpp index 4f428df..b8fe1e6 100644 --- a/dsd_main.cpp +++ b/dsd_main.cpp @@ -148,6 +148,10 @@ void usage() fprintf(stderr, " You must have compiled with serialDV support (see Readme.md)\n"); fprintf(stderr, " Device name is the corresponding TTY USB device e.g /dev/ttyUSB0\n"); #endif + fprintf(stderr, " -P Own latitude in decimal degrees. Latitude is positive to the North. Default 0\n"); + fprintf(stderr, " -Q Own longitue in decimal degrees. Longitude is positive to the East. Default 0\n"); + fprintf(stderr, " This is useful when status messages (see -M option) contain geographical data\n"); + fprintf(stderr, " Practically this is only applicable to D-Star\n"); fprintf(stderr, "\n"); exit(0); } @@ -181,6 +185,8 @@ int main(int argc, char **argv) int dvGain_dB = 0; int slots = 1; Mixer mixer; + float lat = 0.0f; + float lon = 0.0f; fprintf(stderr, "Digital Speech Decoder DSDcc\n"); @@ -188,7 +194,7 @@ int main(int argc, char **argv) signal(SIGINT, sigfun); while ((c = getopt(argc, argv, - "hep:qtv:i:o:g:nR:f:u:U:lL:D:d:T:M:m:")) != -1) + "hep:qtv:i:o:g:nR:f:u:U:lL:D:d:T:M:m:P:Q:")) != -1) { opterr = 0; switch (c) @@ -352,12 +358,20 @@ int main(int argc, char **argv) case 'l': dsdDecoder.enableCosineFiltering(false); break; + case 'P': + sscanf(optarg, "%f", &lat); + break; + case 'Q': + sscanf(optarg, "%f", &lon); + break; default: usage(); exit(0); } } + dsdDecoder.setMyPoint(lat, lon); + if (strlen(log_file) > 0) { dsdDecoder.setLogFile(log_file); } diff --git a/messagefile.md b/messagefile.md index 01366ff..06aa016 100644 --- a/messagefile.md +++ b/messagefile.md @@ -96,8 +96,8 @@ There is one line per polling occurence with a fixed format depending on the pro - **7**: Destination repeater callsign (RPT2) - **8**: Informative text - **9**: 6 character locator a.k.a. Maidenhead locator - - **A**: Bearing to the station when own position is specified (option TBD) - - **B**: Distance to the station when own position is specified (option TBD) + - **A**: Bearing to the origin station when locator is defined and own position is specified (options -P and -Q) + - **B**: Distance to the origin station when locator is defined and own position is specified (options -P and -Q)

YSF (Yaesu System Fusion)