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
Diff: GPSGms6.h
- Revision:
- 1:f911149acd35
- Child:
- 4:aa7ac2ac6913
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/GPSGms6.h Fri May 06 19:30:02 2016 +0000
@@ -0,0 +1,114 @@
+
+
+#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];
+ char time[GPRMC_TIME_SIZE];
+ char status[GPRMC_TIME_SIZE];
+ char latitude[GPRMC_LATITUDE_SIZE];
+ char latitude_hemi[GPRMC_LATITUDE_HEMI_SIZE];
+ char longitude[GPRMC_LONGITUDE_SIZE];
+ char longitude_hemi[GPRMC_LATITUDE_HEMI_SIZE];
+ char speed[GPRMC_SPEED_SIZE];
+ char course[GPRMC_COURSE_SIZE];
+ char date[GPRMC_DATE_SIZE];
+ char magnetic[GPRMC_MAGNETIC_SIZE];
+ char magnetic_dir[GPRMC_MAGNETIC_DIR_SIZE];
+ char indicator[GPRMC_INDICATOR_SIZE];
+} 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();
+
+
+ /** 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);
+
+};
\ No newline at end of file
