NMEAGPS |
( |
unsigned int |
uart, |
|
|
unsigned int |
baudrate, |
|
|
int |
enable_pin |
|
) |
| |
NMEAGPS object constructor for a UART
- Parameters
-
uart | Specify which mraa uart index to use. |
baudrate | Specify the baudrate to use. The device defaults to 9600 baud. |
enable_pin | Specify the GPIO pin to use for the enable pin, -1 to not use an enable pin. |
NMEAGPS |
( |
const std::string & |
uart, |
|
|
unsigned int |
baudrate |
|
) |
| |
NMEAGPS object constructor for a UART
- Parameters
-
uart | Specify which uart to use (fs device path) |
baudrate | Specify the baudrate to use. The device defaults to 9600 baud. |
NMEAGPS |
( |
unsigned int |
bus, |
|
|
uint8_t |
addr |
|
) |
| |
NMEAGPS object constructor for a UBLOX I2C interface
- Parameters
-
bus | Specify which the I2C bus to use. |
addr | Specify the I2C address to use. For UBLOX devices, this typically defaults to 0x42. |
std::string readStr |
( |
size_t |
size | ) |
|
Read character data from the device.
- Parameters
-
size | The maximum number of characters to read. |
- Returns
- string containing the data read.
int writeStr |
( |
const std::string & |
buffer | ) |
|
Write character data to the device. This is only valid for a UART device.
- Parameters
-
buffer | The string containing the data to write. |
- Returns
- The number of bytes written.
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.
- Parameters
-
enable | true to enable the device, false otherwise. |
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.
- Parameters
-
baudrate | The baud rate to set for the device. |
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.
- Parameters
-
millis | The number of milliseconds to wait for data to become available. |
- Returns
- true if data is available to be read, false otherwise.
size_t getMaxQueueDepth |
( |
| ) |
|
Return the current maximum queue depth.
- Returns
- Maximum queue depth
size_t setMaxQueueDepth |
( |
size_t |
depth | ) |
|
Set the current maximum queue depth.
- Parameters
-
depth | New target queue depth 1 <= depth <= 1000 |
- Returns
- Actual maximum queue depth
Start a NMEA parsing thread for reading/parsing NMEA sentences. The thread calls the readStr method, parsing NMEA sentences as they are encountered. Each sentence type is pushed into a corresponding queue of size
Stop a running NMEA parsing thread
Is the parsing thread currently running?
- Returns
- True if parsing
Pop and return a GPS fix structure from the GPS fix queue. A GPS fix should only be used if valid is true.
- Returns
- GPS fix structure
std::string getRawSentence |
( |
| ) |
|
Pop and return a raw NMEA sentence from the NMEA sentence queue. If the queue contains no elements, an empty string is returned
- Returns
- NMEA raw sentence
Pop and return a message from the message queue (GPTXT sentences) If the queue contains no elements, an empty string is returned
- Returns
- NMEA text message
Get the number of elements in the GPS fix queue.
- Returns
- Number of fixes in the GPS fix queue
size_t rawSentenceQueueSize |
( |
| ) |
|
Get the number of elements in the NMEA raw sentence queue.
- Returns
- Number of sentences in the raw NMEA sentence queue
size_t txtMessageQueueSize |
( |
| ) |
|
Get the number of messages in the NMEA message queue.
- Returns
- Number of messages in the message queue
void parseNMEASentence |
( |
const std::string & |
sentence | ) |
|
Parse NMEA sentences. Raw sentence is placed into sentence queue. Additional structures are parsed depending on sentence type
- Parameters
-
sentence | NMEA raw sentence ($...
) inclusive |
Return a vector of the current satellites
- Returns
- Current satellites
double sentencesPerSecond |
( |
| ) |
|
Get the number of sentences parsed per second
- Returns
- Sentences parsed per second
double bytesPerSecond |
( |
| ) |
|
Get the throughput of the device. This number shows a rough data-rate as well as provides a bit of debug since it will show bps even if sentences are not getting parsed correctly.
- Returns
- Total bytes read from the device/second (bps)
Provide a string representation of this class
- Returns
- String representing this instance
The documentation for this class was generated from the following files: