API for the U-BLOX 6 and SIM28 GPS Modules.
More...
UPM support for the U-BLOX 6 GPS module. It is also compatible with the SIM28 GPS module.
{
cerr << "Failed to setup tty port parameters" << endl;
return 1;
}
char nmeaBuffer[bufferLength];
while (shouldRun)
{
{
int rv = nmea->
readData(nmeaBuffer, bufferLength);
if (rv > 0)
write(1, nmeaBuffer, rv);
if (rv < 0)
{
cerr << "Port read error." << endl;
break;
}
continue;
}
usleep(100000);
}
Ublox6 object constructor
- Parameters
-
uart | Default UART to use (0 or 1) |
Checks to see if there is data available for reading
- Returns
- True if there is data available for reading
int readData |
( |
char * |
buffer, |
|
|
int |
len |
|
) |
| |
Reads any available data in a user-supplied buffer. Note: the call blocks until data is available to be read. Use dataAvailable() to determine whether there is data available beforehand, to avoid blocking.
- Parameters
-
buffer | Buffer to hold the data read |
len | Length of the buffer |
- Returns
- the Number of bytes read
int writeData |
( |
char * |
buffer, |
|
|
int |
len |
|
) |
| |
Writes the data in the buffer to the device
- Parameters
-
buffer | Buffer to hold the data read |
len | Length of the buffer |
- Returns
- Number of bytes written
bool setupTty |
( |
speed_t |
baud = B9600 | ) |
|
Sets up proper tty I/O modes and the baud rate. The default baud rate is 9,600 (B9600).
- Parameters
-
- Returns
- True if successful
The documentation for this class was generated from the following files:
- /iotdk/jenkins/workspace/upm-doc-stable/src/ublox6/ublox6.h
- /iotdk/jenkins/workspace/upm-doc-stable/src/ublox6/ublox6.cxx