upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Data Structures | Namespaces | Enumerations
Include dependency graph for nmea_gps.hpp:

API Description

This driver was tested with a number of GPS devices that emit NMEA data via a serial interface of some sort (typically a UART).

The I2C capablity was tested with a UBLOX LEA-6H based GPS shield from DFRobot. Currently, the I2C capability is only supported for UBLOX devices (or compatibles) that conform to the specifications outlined in the u-blox6 Receiver Description Protocol Specification, Chapter 4, DDC Port.

An example using the UART.

// Instantiate a NMEA_GPS sensor on uart 0 at 9600 baud with enable
// pin on D3. If you do not need an enable pin, you can specify -1.
upm::NMEAGPS sensor(0, 9600, 3);
// loop, dumping NMEA data out as fast as it comes in
while (shouldRun && sensor.dataAvailable(5000)) {
cout << sensor.readStr(bufferLength);
}
if (shouldRun)
cerr << "Timed out" << endl;

An example using I2C.

// Instantiate a NMEA_GPS UBLOX based i2c sensor on i2c bus 0 at
// address 0x42
upm::NMEAGPS sensor(0, 0x42);
// loop, dumping NMEA data out as fast as it comes in
while (shouldRun) {
if (sensor.dataAvailable(0))
upm_delay_us(100);
else
cout << sensor.readStr(bufferLength);
}

Go to the source code of this file.

Data Structures

struct  coord_DD
 
struct  satellite
 
struct  nmeatxt
 
struct  gps_fix
 
class  NMEAGPS
 

Namespaces

 upm
 C++ API wrapper for the bh1749 driver.
 

Enumerations

enum  gps_fix_quality {
  no_fix = 0, fix_sp, fix_dp, fix_pps,
  fix_rtk, fix_frtk, fix_dr, fix_manual,
  fix_simulation
}