Abstract base class for GPS receiver drivers.
More...
#include <GPS.h>
Inherited by AP_GPS_Auto, AP_GPS_HIL, AP_GPS_MTK, AP_GPS_MTK16, AP_GPS_NMEA, AP_GPS_None, AP_GPS_SIRF, and AP_GPS_UBLOX.
List of all members.
Detailed Description
Abstract base class for GPS receiver drivers.
Definition at line 14 of file GPS.h.
Member Enumeration Documentation
GPS status codes
- Note:
- Non-intuitive ordering for legacy reasons
- Enumerator:
NO_GPS |
No GPS connected/detected.
|
NO_FIX |
Receiving valid GPS messages but no lock.
|
GPS_OK |
Receiving valid messages and locked.
|
Definition at line 40 of file GPS.h.
Constructor & Destructor Documentation
GPS::GPS |
( |
Stream * |
s |
) |
[inline] |
Constructor
- Note:
- The stream is expected to be set up and configured for the correct bitrate before init is called.
- Parameters:
-
Definition at line 25 of file GPS.h.
Member Function Documentation
void GPS::_error |
( |
const char * |
msg |
) |
[protected] |
emit an error message
based on the value of print_errors, emits the printf-formatted message in msg,... to stderr
- Parameters:
-
| fmt | printf-like format string |
- Note:
- deprecated as-is due to the difficulty of hooking up to a working printf vs. the potential benefits
Definition at line 34 of file GPS.cpp.
int16_t GPS::_swapi |
( |
const void * |
bytes |
) |
[inline, protected] |
perform an endian swap on an int
- Parameters:
-
| bytes | pointer to a buffer containing bytes representing an int in the wrong byte order |
- Returns:
- endian-swapped value
Definition at line 158 of file GPS.h.
long GPS::_swapl |
( |
const void * |
bytes |
) |
[inline, protected] |
perform an endian swap on a long
- Parameters:
-
| bytes | pointer to a buffer containing bytes representing a long in the wrong byte order |
- Returns:
- endian-swapped value
Definition at line 141 of file GPS.h.
virtual void GPS::init |
( |
void |
|
) |
[pure virtual] |
virtual bool GPS::read |
( |
void |
|
) |
[protected, pure virtual] |
Query GPS status
The 'valid message' status indicates that a recognised message was received from the GPS within the last 500ms.
- Returns:
- Current GPS status
Definition at line 53 of file GPS.h.
void GPS::update |
( |
void |
|
) |
|
Update GPS state based on possible bytes received from the module.
This routine must be called periodically to process incoming data.
GPS drivers should not override this function; they should implement read instead.
Definition at line 7 of file GPS.cpp.
Member Data Documentation
port the GPS is attached to
Definition at line 88 of file GPS.h.
altitude in cm
Definition at line 68 of file GPS.h.
true if we have a position fix (use status instead)
Definition at line 81 of file GPS.h.
ground course in 100ths of a degree
Definition at line 70 of file GPS.h.
ground speed in cm/sec
Definition at line 69 of file GPS.h.
horizontal dilution of precision in cm
Definition at line 72 of file GPS.h.
latitude in degrees * 10,000,000
Definition at line 66 of file GPS.h.
longitude in degrees * 10,000,000
Definition at line 67 of file GPS.h.
Set to true when new data arrives. A client may set this to false in order to avoid processing data they have already seen.
Definition at line 78 of file GPS.h.
Number of visible satelites.
Definition at line 73 of file GPS.h.
deprecated
Definition at line 85 of file GPS.h.
3D speed in cm/sec (not always available)
Definition at line 71 of file GPS.h.
GPS time in milliseconds from the start of the week.
Definition at line 65 of file GPS.h.
true if we have seen data from the GPS (use status instead)
Definition at line 82 of file GPS.h.
The documentation for this class was generated from the following files:
- /home/jgoppert/Projects/ap/libraries/AP_GPS/GPS.h
- /home/jgoppert/Projects/ap/libraries/AP_GPS/GPS.cpp