[Xastir] Okay, so it only transmits when the GPS interface is started?
Curt Mills
hacker at tc.fluke.com
Wed Mar 5 19:33:26 EST 2003
On Wed, 5 Mar 2003, Curt Mills, WE7U wrote:
> Here's the relevant portion from main.c:UpdateTime():
>
>
> // Decrement the my_position_valid variable if we're
> // using GPS. This will make sure that positions
> // are valid, as we'll only get four positions out
> // maximum per valid GPS position. If the GPS
> // position goes stale, we'll stop sending posits.
> if (using_gps_position && my_position_valid) {
> my_position_valid--;
> //fprintf(stderr,"my_position_valid:%d\n",my_position_valid);
>
> if (!my_position_valid) { // We just went to zero!
> // Waiting for GPS data..
> statusline(langcode("BBARSTA041"),1);
> //fprintf(stderr,"my_position_valid just went to zero!\n");
> }
> }
>
>
> It looks like we stop transmitting positions if we think we have a
> GPS interface configured and enabled, and we stop getting positions
> from that interface.
>
> I'll do some more checking to make sure I understand the
> "using_gps_position" variable and how/when it gets set/reset.
It appears that we set "my_position_valid" to zero when start up any
GPS/networked-GPS port, otherwise its default is 1. When we
correctly parse GPS data, we set it to three. Each time we transmit
a posit if we're in GPS mode, we decrement it. This keeps us from
transmitting stale GPS data if we lose the signal. In that case, if
we're moving, dead-reckoning should take over on other people
screens and cover us until we get GPS lock again.
Starting up a GPS port increments "using_gps_position". Shutting
down a GPS port decrements it. If all GPS ports are shut down, it
should be at 0 and you should start posit'ing again.
I see one hole in the theory though. If you start up a GPS port
without good data being decoded and then shut down the port again,
there's no code to set my_position_valid to 1. In that case you
shouldn't posit again until you shutdown and restart. I suppose
that'd be an easy one to fix in the code though.
Could that be what happened to you?
--
Curt Mills, WE7U hacker_NO_SPAM_ at tc.fluke.com
Senior Methods Engineer/SysAdmin
"Lotto: A tax on people who are bad at math!"
"Windows: Microsoft's tax on computer illiterates!" -- WE7U
"The world DOES revolve around me: I picked the coordinate system!"
More information about the Xastir
mailing list