Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FileManager GPSGms6 SDFileSystem mbed
Fork of 2545_SD_Card by
GPSGms6.h
- Committer:
- Lucyjungz
- Date:
- 2016-05-09
- Revision:
- 4:aa7ac2ac6913
- Parent:
- 1:f911149acd35
- Child:
- 6:a05ec997c496
File content as of revision 4:aa7ac2ac6913:
#define HEADER_SIZE 5
#define GPRMC_TIME_SIZE 10
#define GPRMC_STATUS_SIZE 1
#define GPRMC_LATITUDE_SIZE 9
#define GPRMC_LATITUDE_HEMI_SIZE 1
#define GPRMC_LONGITUDE_SIZE 10
#define GPRMC_LONGITUDE_HEMI_SIZE 1
#define GPRMC_SPEED_SIZE 5
#define GPRMC_COURSE_SIZE 5
#define GPRMC_DATE_SIZE 6
#define GPRMC_MAGNETIC_SIZE 5
#define GPRMC_MAGNETIC_DIR_SIZE 1
#define GPRMC_INDICATOR_SIZE 1
#define INVALID_VALUE 0xFFFF
#define RX_BUF_SIZE 100
typedef struct
{
char header[HEADER_SIZE+1];
char time[GPRMC_TIME_SIZE+1];
char status[GPRMC_TIME_SIZE+1];
char latitude[GPRMC_LATITUDE_SIZE+1];
char latitude_hemi[GPRMC_LATITUDE_HEMI_SIZE+1];
char longitude[GPRMC_LONGITUDE_SIZE+1];
char longitude_hemi[GPRMC_LATITUDE_HEMI_SIZE+1];
char speed[GPRMC_SPEED_SIZE+1];
char course[GPRMC_COURSE_SIZE+1];
char date[GPRMC_DATE_SIZE+1];
char magnetic[GPRMC_MAGNETIC_SIZE+1];
char magnetic_dir[GPRMC_MAGNETIC_DIR_SIZE+1];
char indicator[GPRMC_INDICATOR_SIZE+1];
} GPRMC_Data_TypeDef;
typedef enum GPS_ProcessState
{
GPS_Process_Start = 0,
GPS_Process_Header,
GPS_Process_Time,
GPS_Process_Status,
GPS_Process_Latitude,
GPS_Process_Latitude_hemis,
GPS_Process_Longitude,
GPS_Process_Longitude_hemis,
GPS_Process_Speed,
GPS_Process_Course,
GPS_Process_Date,
GPS_Process_Magnetic,
GPS_Process_Magnetic_Dir,
GPS_Process_Indicator,
GPS_Process_Complete ,
GPS_Process_SIZE
} GPS_ProcessState;
typedef enum GPS_ProcessStatus
{
GPS_Status_Valid,
GPS_Status_Empty,
GPS_Status_NotEnough,
} GPS_ProcessStatus;
typedef struct
{
GPS_ProcessState state;
int size;
char * p_val;
} GPRMC_Tbl_TypeDef;
class GPSGms6
{
public:
GPSGms6();
void start_GPS();
/** Get Latest GPRMC Data
*
* @returns
* Latest GPRMC Data
*/
GPRMC_Data_TypeDef latestGPRMC();
/** Get Valid Data Interval
*
* @returns
* Valid Data Interval
*/
GPRMC_Data_TypeDef validGPRMC();
/** Get availability of gprmc
*
* @returns
* 'true' - if data is available
*/
bool available();
private:
// States
//Member variables
//void GPS_ProcessGpsData(char * buf, unsigned int size, char * t, char * d);
//GPS_ProcessStatus GPS_ProcessGprmcSection(GPS_ProcessState state,char * buf , unsigned int buf_index,unsigned int buf_size, unsigned int section_size, char * ret_value);
};
