Time of ephemeris changes to fit our spoofer requirements. The ephemeris shall be valid for 4 hours, 2 hours ahead and 2 hours in the past
This commit is contained in:
parent
399579f352
commit
9646ce72a8
10
gpssim.c
10
gpssim.c
@ -2009,7 +2009,11 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
if (subGpsTime(g0, gmin)<0.0 || subGpsTime(gmax, g0)<0.0)
|
||||
// Deviation from original gpssim.c. This statement is checking that the current receiver local time is
|
||||
// within a longer time interval given by two hours before the minimum ephemeris time and two hours after the
|
||||
// maximum ephemeris time. In the original implementation, the check was that the current receiver local time
|
||||
// is within the miminum time of ephemeris and the maximum time of ephemeris
|
||||
if (fabs(subGpsTime(g0, gmin))>2*SECONDS_IN_HOUR && fabs(subGpsTime(gmax, g0))>2*SECONDS_IN_HOUR)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Invalid start time.\n");
|
||||
fprintf(stderr, "tmin = %4d/%02d/%02d,%02d:%02d:%02.0f (%d:%.0f)\n",
|
||||
@ -2042,7 +2046,9 @@ int main(int argc, char *argv[])
|
||||
if (eph[i][sv].vflg == 1)
|
||||
{
|
||||
dt = subGpsTime(g0, eph[i][sv].toc);
|
||||
if (dt>=-SECONDS_IN_HOUR && dt<SECONDS_IN_HOUR)
|
||||
// Test that ephemeris can be used by comparing the receiver local time with the time of clock from ephemeris data and observing
|
||||
// the receiver local time is within a 4 hour interval from the time of clock from ephemeris
|
||||
if (dt>=-2*SECONDS_IN_HOUR && dt<2*SECONDS_IN_HOUR)
|
||||
{
|
||||
ieph = i;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user