Skip to content

Commit

Permalink
Added options to specify own position
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed Jan 14, 2017
1 parent b0897dc commit 0b95820
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 15 additions & 1 deletion dsd_main.cpp
Expand Up @@ -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 <float> Own latitude in decimal degrees. Latitude is positive to the North. Default 0\n");
fprintf(stderr, " -Q <float> 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);
}
Expand Down Expand Up @@ -181,14 +185,16 @@ 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");

exitflag = 0;
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)
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions messagefile.md
Expand Up @@ -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)

<h3>YSF (Yaesu System Fusion)</h3>

Expand Down

0 comments on commit 0b95820

Please sign in to comment.