Revised Embedded Artists' MTK3339 library to save all raw GPS messages and enable optional decoding of RMC message.
Fork of MTK3339 by
MTK3339 Class Reference
An interface to the MTK3339 GPS module. More...
#include <MTK3339.h>
Public Types | |
enum | PubConstants |
Time, position and date related data. More... | |
Public Member Functions | |
MTK3339 (PinName tx, PinName rx) | |
Create an interface to the MTK3339 GPS module. | |
void | start (void(*fptr)(void), int mask) |
Start to read data from the GPS module. | |
template<typename T > | |
void | start (T *tptr, void(T::*mptr)(void), int mask) |
Start to read data from the GPS module. | |
void | stop () |
Stop to read data from GPS module. | |
NmeaSentence | getAvailableDataType () |
Get the type of the data reported in available data callback. | |
void | decodeRMC () |
Detailed Description
An interface to the MTK3339 GPS module.
Definition at line 12 of file MTK3339.h.
Member Enumeration Documentation
enum PubConstants |
Constructor & Destructor Documentation
MTK3339 | ( | PinName | tx, |
PinName | rx | ||
) |
Create an interface to the MTK3339 GPS module.
- Parameters:
-
tx UART TX line pin rx UART RX line pin
Definition at line 21 of file MTK3339.cpp.
Member Function Documentation
void decodeRMC | ( | ) |
Find and decode field 0, UTC time, as hhmmss.sss
Find and decode field 1, GPS status, as single character 'A' for valid or 'V' for invalid
Find and decode field 2, latitude, formatted as ddmm.mmmm
Find and decode field 3, latitude sense, as single character 'N' for north or 'S' for south
Find and decode field 4, longitude, formatted as dddmm.mmmm
Find and decode field 5, longitude sense, as single character 'E' for east or 'W' for west
Find and skip field 6, speed in knots
Find and skip field 7, course in degrees
Find and decode field 8, UTC date, formatted as ddmmyy where 1<=dd<=31, 1<=mm<=12, and yy is offset from 2000
Find and skip field 9, magnetic variation (not implemented in GPS firmware)
Find and skip field 10, magnetic variation direction (not implemented in GPS firmware)
Definition at line 57 of file MTK3339.cpp.
MTK3339::NmeaSentence getAvailableDataType | ( | ) |
Get the type of the data reported in available data callback.
This method will only return a valid type when called within the callback.
Definition at line 53 of file MTK3339.cpp.
void start | ( | T * | tptr, |
void(T::*)(void) | mptr, | ||
int | mask | ||
) |
Start to read data from the GPS module.
- Parameters:
-
tptr pointer to the object to call the member function on mptr pointer to the member function to be called mask specifies which sentence types (NmeaSentence) that are of interest. The member function will only be called for messages specified in this mask.
void start | ( | void(*)(void) | fptr, |
int | mask | ||
) |
Start to read data from the GPS module.
- Parameters:
-
fptr A pointer to a void function that will be called when there is data available. mask specifies which sentence types (NmeaSentence) that are of interest. The callback function will only be called for messages specified in this mask.
Definition at line 35 of file MTK3339.cpp.
void stop | ( | ) |
Stop to read data from GPS module.
Definition at line 47 of file MTK3339.cpp.
Generated on Fri Jul 22 2022 20:10:17 by 1.7.2