[Xastir] shared serial output?
Derrick J Brashear
shadow at dementia.org
Wed Jun 9 14:09:51 EDT 2004
On Wed, 9 Jun 2004, Curt, WE7U wrote:
> On Wed, 9 Jun 2004, Kurt A. Freiberger wrote:
>
> > I looked at the sources for gpsd and am as confused as a milkman at a
> > crematorium. Does anybody know a way to wedge it so that when one
> > attaches, one gets the raw datastream without sending "R"? Basically,
> > attach, and it streams.
>
> Ask Derrick, he might know.
He's right, it's nasty. I added a switch at one point which puts things in
raw mode by default. but that makes R toggle things off, then on.
if you just always want raw mode,
void send_nmea(fd_set *afds, fd_set *nmea_fds, char *buf)
{
(send stuff)
}
and nmea_fds is set by passing that array into handle_request, and if we
got an r, doing:
FD_SET(fd, fds);
sprintf(reply + strlen(reply),
",R=1");
so if you want to default to on, find the part of main() that looks like:
if (FD_ISSET(msock, &rfds)) {
int ssock;
alen = sizeof(fsin);
ssock = accept(msock, (struct sockaddr *) &fsin, &alen);
if (ssock < 0)
errlog("accept");
else FD_SET(ssock, &afds);
}
and change the else at the end to be
else {
FD_SET(ssock, &afds);
FD_SET(sock, &nmea_fds);
}
More information about the Xastir
mailing list