pyupm_nmea_gps module

class pyupm_nmea_gps.NMEAGPS(*args)[source]

Bases: object

API for the NMEA GPS Module.

ID: nmea_gps

Name: Generic Serial Interface for GPS NMEA Devices

Category: gps

Manufacturer: dfrobot seeed

Connection: uart gpio

Other Names: VK2828u7 ublox LEA-6H 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.An example using I2C.

C++ includes: nmea_gps.hpp

dataAvailable(millis)[source]

bool dataAvailable(unsigned int millis)

Determine whether there is data available to be read. In the case of a UART, this function will wait up to “millis” milliseconds for data to become available. In the case of an I2C device, the millis argument is ignored and the function will return immediately, indicating whether data is available.

millis: The number of milliseconds to wait for data to become available.

true if data is available to be read, false otherwise.

enable(enable)[source]

void enable(bool enable)

Enable or disable the device. When disabled, the device enters a low power mode and does not emit NMEA data. It will still maintain location data however.

enable: true to enable the device, false otherwise.

readStr(size)[source]

std::string readStr(size_t size)

Read character data from the device.

size: The maximum number of characters to read.

string containing the data read.

setBaudrate(baudrate)[source]

void setBaudrate(unsigned int baudrate)

Set the baudrate of the device. By default, the constructor will set the baudrate to 9600. This is only valid for UART devices.

baudrate: The baud rate to set for the device.

writeStr(buffer)[source]

int writeStr(std::string buffer)

Write character data to the device. This is only valid for a UART device.

buffer: The string containing the data to write.

The number of bytes written.