summaryrefslogtreecommitdiff
path: root/sys/kern/tty_nmea.c
AgeCommit message (Collapse)Author
2022-04-02Update an old commentMike Larkin
The old comment only mentioned that tty_nmea was used for time, but subsequently position data was added to this line discipline.
2022-04-02whitespace fixMike Larkin
2019-08-15NMEA 4.1 has one more field in the RMC message; ok kettenis@Otto Moerbeek
2019-01-26Parse altitude and ground speed values from the GGA & RMC NMEA messages,Landry Breuil
and provide them as nmea(4) distance & velocity sensors. With my 'u-blox GNSS receiver' that gives: hw.sensors.nmea0.distance0=335.600 m (Altitude), OK hw.sensors.nmea0.velocity0=18.337 m/s (Ground speed), OK ok deraadt@
2018-09-01Recognize more talker IDs when parsing NMEA RMC messagesLandry Breuil
The NMEA 0183 standard says that the first two chars correspond to the 'source' of the message, right now we were only looking for 'GP' prefix for 'GPS', but this can also be 'GL' for Glonass, 'BD' for BeiDou, 'GA' for Galileo, or 'GN' for a generic GNSS source. Match the RMC messages from all those variants, with this i'm able to use my navilock nl-8002u (which uses GNRMC) as a timedelta sensor for ntpd, and i have my GPS position in the nmea(4) sensors. ok deraadt@
2018-02-19Remove almost unused `flags' argument of suser().Martin Pieuchot
The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
2015-12-21Move ppp, nmea, endrun, and msts prototypes to tty.hStefan Fritsch
Fix inconsistent arguments for pppopen/pppclose/pppstart. Use passed in argument p in pppopen instead of curproc. "Looks good to me" deraadt@
2014-11-03pass size argument to free()Theo de Raadt
ok doug tedu
2014-09-14remove uneeded proc.h includesJonathan Gray
ok mpi@ kspillner@
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-03-21Fix missing brackets: longitude/latitude status set to critical every timeandre
nmea_timeout() is triggered introduced in rev 1.37. ok sthen@
2014-03-21Some knf, no functional changes.andre
ok sthen@
2010-05-27Switch the signal status "percent" sensor, which is currentlyStuart Henderson
hardcoded(!), over to an "indicator" sensor type, value depending on whether the GPS has fix. ok deraadt@
2010-04-23Remove unnecessary pointer dereference causing gcc2 to warn.Miod Vallat
2010-04-21Provide nmea(4) position information using the new angle sensor type.Stuart Henderson
Use SENSOR_FINVALID until we have good data, suggested by deraadt@ "i am happy" deraadt@
2010-04-12Some of the line disciplines want to check for suser. Better to pass themTed Unangst
a process instead of using curproc. ok deraadt
2009-06-02Add some extra protection against non-monotonic timestamps. ok steveskChris Kuethe
2009-04-26don't zero sensor .value and .flags immediately after the allocation w/ ↵Constantine A. Murenin
M_ZERO; ok deraadt
2008-12-25don't need #include <sys/queue.h>; ok mbalmer@Kevin Steves
CVS ---------------------------------------------------------------------
2008-12-25spelling in comments; ok mbalmer@Kevin Steves
2008-09-10Convert timeout_add() calls using multiples of hz to timeout_add_sec()Bret Lambert
Really just the low-hanging fruit of (hopefully) forthcoming timeout conversions. ok art@, krw@
2008-07-22deactivate the code to display location in the sensor descriptionMarc Balmer
2008-07-07Shorten the sensor description and reserve room for optional charactersMarc Balmer
only when they are needed. Makes locations like -123d45m,-123d45m fit.
2008-07-06Add the position to the sensor description.Marc Balmer
discussed with otto, sthen, ckuethe. ok otto
2008-06-11Don't use the reference count to create the sensor name; we can end upMarc Balmer
with sensors with the same name. The sensor name is now ever increasing unless the reference count drops to zero, in which case the naming restarts at zero as well.
2008-05-05Make nmea(4) behave like the other timedelta sensors and provide aMarc Balmer
signal sensor that reflects the status of the receiver. tested by and ok ckuethe
2008-01-28spelling in comment; ok mbalmer@ jmc@Kevin Steves
2007-11-27Only checksum the NMEA sentence if it as GPRMC message.Marc Balmer
suggested by otto.
2007-11-26Degrade the timedelta if the GPS reports a warning condition for more thanMarc Balmer
ten minutes (or if a serial GPS is disconnect and we get no NMEA sentences at all). ok otto
2007-09-07Use M_ZERO in a few more places to shave bytes from the kernel.Artur Grabowski
eyeballed and ok dlg@
2007-03-22split userland & kernel struct sensor/sensordev so that the additionTheo de Raadt
of new fields in the future is less disruptive. This is done similar to how struct proc is handled for ps(1). ok jmc (man page changes) tested fkr simon, and more suggestions from millert
2007-03-20swiss spellingTheo de Raadt
2007-03-19Change the way the nmea(4) line discipline takes the timestamp forMarc Balmer
the timedelta sensor when no PPS signal is available. Previously, the timestamp was taken at the leading '$' character of a GPRMC message, which was not always correct, as some GPS units send other messages first; we do not know when the GPRMC message is sent within a data block (we refer to a data block as the set of NMEA messages that are sent by a GPS unit in one go, usually once per second). nmea(4) now takes the timestamp at the first '$' character received after the start of a new seconds. Since GPS units transmit a data block every second, the first message can be found by measuring the gap between consecutive messages: after the longest gap, the first message of the next second follows. And it is at the leading '$' character of this message that we take the timestamp. $GPGGA,..... <- take timestamp here $GPGSA,..... $GPRMC,..... <- decode time here ... <- possibly more messages <- longer gap till start of next second $GPGGA,..... <- it starts all over, take next timestamp This code has been designed to work independent of the baudrate and the rate at which the GPS sends out it's data blocks (usually 1 Hz, but 5 Hz units are common as well): With this change, precision is greatly improved in the absence of a PPS signal and as a side effect, jitter is reduced. Note that while this is much better than before, there is still a slight offset to the real time, as calculating the fix in the GPS unit and transmitting the '$' character takes a short, but unpredictable amount of time. When tty timestamping is enabled, but there is no PPS signal available, the sensor status will be degraded to CRITICAL, which means "check your hardware". Thanks to Chris Kuethe for testing and feedback. ok ckuethe.
2007-03-05If tty-timestamping is requested, but no PPS signal is present, output aMarc Balmer
warning message and unconditionally set the sensor state to WARNING. discussed with otto, ckuethe; ok otto, "i like it" ckuethe
2007-01-02return is not a function.Marc Balmer
2006-12-23adapt to new two-level sensor api; Constantine A. MureninTheo de Raadt
2006-12-23in nmeaopen(), only add the sensors to the system if there was no error.Marc Balmer
2006-12-15Correct order of malloc(9) arguments.Marc Balmer
Spotted by Constantine A. Murenin <cnst+openbsd@bugmail.mojo.ru>; thanks.
2006-11-29Update the sensor description based on the GPS operation mode. InitialMarc Balmer
diff received from matthieu. ok matthieu
2006-11-28Let nmea(4) use tty timestamps if they are enabled. Using a GPS receiverMarc Balmer
that provides a PPS signal, more precision and less jitter can be expected. With my test setting (a Garmin GPS 18 LVC hooked up to a i386 machine) I observed a skew of 0.03 to 0.05 seconds between the tty timestamp and the soft timestamp. "put it in" deraadt
2006-11-18typos; from bret lambertJason McIntyre
2006-06-21If tty timestamping is enabled, copy the tty timestamp early to preserveMarc Balmer
the value if it gets overwritten by other events.
2006-06-20pruning; ok mbalmerTheo de Raadt
2006-06-19Remove the no longer needed date/time calculations.Marc Balmer
2006-06-13Next round of clean-up: Remove the ugly state machine and replace it withMarc Balmer
a simpler function that splits the nmea sentence into fields, verifies the checksum and eventually decodes the data (if it's a GPRMC sentence). Ignore Loran-C for the moment, no one has such a receiver. Loran-C can easily be added later if we have a receiver to test with.
2006-06-10Add functions to decode date and time strings that make sure no invalidMarc Balmer
information can be passed.
2006-06-05various cleanups; ok mbalmerTheo de Raadt
2006-06-04- ntpd no longer needs the NTP identifier as part of a timedelta sensorMarc Balmer
description. - create the timedelta sensors as early as possible, but mark them invalid as long as there is no real data. - update docs accordingly
2006-06-01Avoid buffer overflow in case of oversized input.Chris Kuethe
ok mbalmber
2006-06-01mbalmer says the swiss have learned how to swim.Chris Kuethe
- fixed debug printfs - cope with nmea0183 or nmea 2.3 - allow multiple receivers at the same time Hacked in the park in downtown... "commit this right away" mbalmer