From 0f3dfccad575ac35ef0c41beb3c6340c1b2d1939 Mon Sep 17 00:00:00 2001
From: "Eric S. Raymond"
The easiest way write a driver is probably to copy the driver_proto.c +
The easiest way to write a driver is probably to copy the driver_proto.c file in the source distribution, change names appropriately, and write the guts of the analyzer and writer functions. Look in gpsutils.c before you do; driver helper functions live there. Also read some @@ -1005,7 +1004,7 @@ existing drivers for clues.
On Writing A GPSD Driver.There's a second kind of driver architecture for
-gpsmon
, the real-timr packet monitor and diagnostic tool.
+gpsmon
, the real-time packet monitor and diagnostic tool.
It works from monitor-object definitions that include a pointer to the
device driver for the GPS type you want to monitor. See
monitor_proto.c for a prototype and technical details.
At low baud rates it is possible to try to push more characters of -NMEA through per cycle than the time to transmit will allow. Here -are the maxima to use for computation:
- -ZDA | 36 |
GLL | 47 |
GGA | 82 |
VTG | 46 |
RMC | 77 |
GSA | 67 |
GSV | 60 (per line, thus 180 for a set of 3) |
The transmit time for a cycle (which must be less than 1 second) -is the total character count multiplied by 10 and divided by the -baud rate.
- -A typical budget is GGA, RMC, GSA, 3*GSV = 82+75+67+(3*60) = 404.
- -When you write a driver that includes the capability to change -sampling rates, you must fill in the cycle_chars member with -a maximum character length so the daemon framework code will -be able to compute when a sample-rate change will work. If -you have to estimate this number, err on the high side.
-Considered in the abstract, the cleanest thing for a -- cgit v1.2.1