summaryrefslogtreecommitdiff
path: root/serial.c
Commit message (Collapse)AuthorAgeFilesLines
* system call failure should be tested against -1, rather than "< 0"Chris Kuethe2009-07-091-3/+3
|
* a little bit of handy glue for network transported GNSS dataChris Kuethe2009-07-091-1/+7
|
* GPSD can now be a gpsd clientChris Kuethe2009-07-051-0/+5
| | | | | | | | that is, it can connect to and relay data from other gpsd instances. Sample usage # gpsd -S 12000 -n 'gpsd://localhost:2947/?raw' # cgps 127.0.0.1:12000
* Defensive programming.Eric S. Raymond2009-03-021-0/+2
|
* Restore the logic for treating baud rate of 0 as "no change".Eric S. Raymond2009-02-121-3/+10
|
* All driver method tables are now const.Eric S. Raymond2009-02-121-1/+1
| | | | | | | This required moving one field, the modifiable cycle time, into the session structure; the driver type field is now the default value set on switching to that driver, if the field has not already been set during a previous activation.
* More thorough suppression of subtype probes.Eric S. Raymond2009-02-091-13/+15
|
* better fix suggested by Greg TroxelChris Kuethe2009-01-261-1/+3
|
* more paranoiaChris Kuethe2009-01-261-1/+1
|
* tcdrain before close of a GPS, because if there's any traffic waiting in theEric S. Raymond2009-01-091-0/+1
| | | | buffers that might flush it.
* This diff goes most of the way to getting us splint-clean again.Eric S. Raymond2009-01-051-2/+2
|
* Add a wrapper function around gpsd_hexdump to avoid hexdumping buffers...Chris Kuethe2008-12-271-1/+2
| | | | | | | | ...and copying ascii strings around when they're not going to be printed. This saves quite a lot of CPU. I processed a 50MB ubx binary file. With no "-D" options, this saved nearly 2.2M calls to gpsd_hexdump and the processing time for this file went from 84 seconds to 35 seconds.
* whitespace fixesChris Kuethe2008-08-031-33/+33
|
* Fix to allow compiling with --disable-pps to work.Gary E. Miller2008-01-211-0/+2
|
* Fix, 2nd try, too many PPS threads being started. Gary E. Miller2008-01-211-1/+0
| | | | Found by John Arthur <lists@davey.net.au>
* Prevent spawning more than one ntp/pps thread. This also fixes some process ↵Gary E. Miller2008-01-121-0/+7
| | | | killing problems I have been seeing. Thanks to John Arthur <lists@davey.net.au>.
* Enrich the regression-test logs with more metainformation.Eric S. Raymond2007-12-131-1/+2
| | | | Add corresponding entries to the hardware table where we can.
* Minor build and patches from the Gumstix crew.Eric S. Raymond2007-12-131-1/+1
|
* Refactoring step and fix to ntp interface.Mick Durkin2007-12-081-0/+9
| | | | | | | | | | Extract the code which activates the interface to ntpd into a separate function and arrange that this is called by gpsd_assert_sync (in serial.c). This ensures it only happens once the serial port parameters are known. Modify the code which probes for devices to issue a gpsd_assert_sync on success.
* wrap the NTP SHM setup in the appropriate conditionalChris Kuethe2007-07-271-0/+2
|
* Two small fixes:Mick Durkin2007-07-171-0/+3
| | | | | | | | | | | serial.c Set a definite unused value to the NTPD shared memory segment number stored in device data when a device is allocated. gpsd.c Resolved a resource release problem in gpsd.c which left NTPD shared memory segments hanging if a device disconnected. Corrected by modifying the order in which the releases happen.
* Pull the device_readonly variable into the global context structure.Eric S. Raymond2007-06-011-5/+3
| | | | | | | Note that the implementation is now somewhat different. Before, this flag prevented low-level writes to the device. Now it prevents operations that could *cause* low-level writes -- notably subtype probes, mode changes, and baud-rate changes.
* splint cleanups, and move a static to wre it belongs in the driver structure.Eric S. Raymond2007-06-011-0/+2
|
* Change return ttype of gpsd_write to be what the Garmin driver was expecting;Eric S. Raymond2007-06-011-5/+5
| | | | | it actually makes more sense this way. (Fixes what may have been a subtle bug.)
* Neuter gpsd_write. Chris Kuethe2007-04-061-0/+2
| | | | | Don't even bother trying the write() if device_readonly is set. Saves me from having to see writes return -1 in ktrace output.
* fix stupid think-o. from Antonio Eugenio BurrielChris Kuethe2007-03-181-1/+1
|
* Gary reported a runtime link error. Chris Kuethe2007-03-141-2/+2
| | | | | | Rename the readonly flag, change type. Also, bump the library version number. So much has changed that it's not fair to call it v16.0 any more.
* committed from the wrong tree, so fix the "-b" flag. Chris Kuethe2007-03-091-4/+4
| | | | now it really does work "like it says on the tin."
* Much as I hate to do this, add a command line flag (-b)...Chris Kuethe2007-03-071-1/+3
| | | | | | | | | | | | | | | | | ...to prevent gpsd from writing to a device. It sucks that we have to do this, but I'm really sick of explaining to people that gpsd is not to blame for the crap being sold as a bluetooth device these days. This is user-friendly and packager-friendly: users can now run gpsd on an arbitrary device without fear of wrecking it, and packagers do not need to produce special "--disable-reconfigure" packages. In a perfect world * embedded bluetooth stacks would not be flaky and fragile * there would be a reliable, cross-platform way to detect a bluetooth device, in order to optimize runtime behaviour. I don't see either of these happening any time soon...
* Whoopsy - the fallback mode is always O_RDONLYChris Kuethe2007-01-181-1/+1
|
* only open character devices read-write; Chris Kuethe2007-01-181-4/+14
| | | | pipes, sockets and files are opened read-only.
* allow the speed search to proceed up to 115k2 Chris Kuethe2006-12-261-1/+1
| | | | | | ... my itrax3 likes to run that fast, and for more verbose applications (raw data, ephemeris, ...) it's probably important for UBX as well.
* Eliminate redundant setting of CS7/CS8. All regression tests pass.Eric S. Raymond2006-12-051-2/+0
|
* Split the packet-sniffer internals out of the session structure. Eric S. Raymond2006-11-301-4/+4
| | | | | | | | | | | | | This is a big, super-intrusive patch but changes no logic at all -- it's all about ripping out some of the gps_device_t structure members into a new gps_packet_t structure. Even the driver API doesn't change at all, this is all libgpsd(3) internals being rearranged. The motivation here is that we want to kill off the ad-hoc Python implementation of a packet-sniffer in gpsfake. To do that we need to be able to write a "pure" packet sniffer that uses the same C code as the daemon's but without being welded to the rest of the libgpsd(3) code. This is the first step towards that.
* if we can't open the device read-write, try to open it read-only. gpsd isChris Kuethe2006-11-251-2/+5
| | | | | pretty smart, and can probably cope with arbitrary byte streams that strongly resemble gps data, even if it can't exert control over the source.
* Move the checking of probe functions... Eric S. Raymond2006-11-171-30/+1
| | | | | | | | | | | | | | | | ...from within gpsd_open() out into its only caller, gpsd_activate(). This cleans up the layer separation between serial-device bashing and the driver-structure stuff. The reeason for this change is that I want all the configurator and revert method calls close to each other in libgpsd_core.c so a reader can have some hope of grokking the interactions correctly. Petr Slansky thinks there's a subtle bug in the current design, and I think he may be right. Heads up, Gary! Presently, the only driver this change could break is Garmin, as you're the only user of the probe_detect hook. I've changed gpsd_set_raw(), of which you are also the only user, in what I believe is the correct way. Test it, please...
* Interleave NMEA subtype probes with received packets. This seems to Eric S. Raymond2006-11-071-1/+1
| | | | | *immediately* improve detection of SiRF devices in NMEA mode, and probably solves Davor Emard's Garmin GPS-10 bug as well (though this is not yet proven.
* Sigh...avoid harmless but *annoying* name collision...Eric S. Raymond2006-11-021-3/+3
| | | | | between our LOG_ERR and the syslog() macro by changing ours to LOG_ERROR.
* Define uniform log level macros.Eric S. Raymond2006-11-021-9/+10
| | | | | | | | | | | | | | | | | | | | | | This patch defines a uniform set of log levels and changes all gpsd_report() instances to use them. In most cases (I'd say about 80%) this will make no observable difference, as the numeric log levels the code was using were not too badly inconsistent anyway. The new log level macros are defined and described in gpsd.h. The main thing I wanted was to be able to consistently force dumping of all I/O to devices and clients with -D 4. Some drivers didn't honor this. One or two still may not through lack of an internal write() wrapper that does logging; there will need to be some followup changes. Level 0 messages are always displayed, but to make the semantics clearer there are two defines LOG_ERR and LOG_SHOUT. Level 5 is still super-raw I/O reporting. Level 6 and 7 messages are tagged RAW_LOG+1 and RAW_LOG+2; I was particularly careful about these because we have one report of a user who is getting good results from Garmin serial only at -D 7 or up, and perish forbid I should interfere with that bug being found.
* Another small refactoring step.Eric S. Raymond2006-11-011-0/+8
| | | | Now we have saved_baud completely confined to serial.c
* More pure refactoring.Eric S. Raymond2006-11-011-0/+12
| | | | | We're trying to hide all instances of saved_baud preparatory to some logic changes in the serial layer.
* Pure refactoring. Eric S. Raymond2006-11-011-0/+18
| | | | | Give serial.c a new entry point so storage for TTY settings can stay private to serial.c rather than being tweaked in the Garmin driver.
* Make it possible to disable reconfiguration.Eric S. Raymond2006-10-301-2/+3
|
* Rename some methods for clarity.Eric S. Raymond2006-10-301-7/+7
|
* Split the "initializer" driver method in two.Eric S. Raymond2006-10-301-0/+4
| | | | | | | | | | | There is now a new method, "configurator". The initializer method probes the driver for subtype information (such as a firmware rev) without changing any device settings. The configurator method does things like selecting which packets should send. At the moment, these two methods are always called in tandem, so there has been effectively no change in behavior. Soon, though, gpsctrl will call the initializer method but *not* the configurator.
* Fix another bug in the wakeup logic. Document the move to lesstif better.Eric S. Raymond2006-10-271-3/+3
|
* Switch us to using lesstif rather than OpenMotif, as OpenMotif won't shipEric S. Raymond2006-10-271-1/+1
| | | | | | | | with FCS. Fortunately, lesstif seems to be a drop-in replacement; all this took was installing lesstif-devel and changing the BuildRequre in the spec file. Also, fix a reveresed test in my True North patch of earlier today.
* Rename config.h so it can be installed as gpsd_config.h...Chris Kuethe2006-10-261-1/+2
| | | | | | ...for those who want to build their own apps linked against libgps and want the headers to work. Works on OpenBSD, tested by Jeff Francis on OS X and Linux
* OK, I'm slow today.Eric S. Raymond2006-10-261-4/+15
| | | | | | | | | | If we don't already know the type of a device, we have to send it *every* driver's wakeups on a baud-rate change. This does, basically, the same thing the old probe function in the TrueNorth driver did since at the moment only that driver has a wakeup. Also, move the send so it gets done when we change baud rates without closing the device.
* Add a new capability to the generic driver structure: wakeup...Eric S. Raymond2006-10-261-0/+4
| | | | | | | | | | ...a function to be called just after the autobaud hunt sets the line speed each time. Use this to get rid of the internal baud hunt loop in the True North driver; instead, the ID query and rate-setting strings will be sent by the wakeup hook. Note: this patch is untested. I'm pretty certain it will work, but somebody needs to try it on live hardware.