Update of /cvsroot/firebug/fireboard/beta/tos/sensorboards/mts400/GPS
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7284/GPS
Modified Files:
NMEA.h NMEAM.nc
Removed Files:
NMEA.nc
Log Message:
Moved gga parsing to nmea module.
Index: NMEA.h
===================================================================
RCS file: /cvsroot/firebug/fireboard/beta/tos/sensorboards/mts400/GPS/NMEA.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NMEA.h 19 May 2005 17:31:54 -0000 1.1
--- NMEA.h 27 May 2005 00:38:32 -0000 1.2
***************
*** 16,19 ****
--- 16,20 ----
#include <inttypes.h>
+
/** @brief NMEA message parser which uses a lot of macros
* and lower-level operations to extract data from the
***************
*** 88,97 ****
#define is_mss_string_m(ns) ((ns[3]=='M')&&(ns[4]=='S')&&(ns[5]=='S'))
! typedef struct _nmea_data NMEA_Data;
// 0 length for using in TinyOS interface
// definitions, general type checking, etc.
// Members may be added later.
! struct _nmea_data {
! };
--- 89,98 ----
#define is_mss_string_m(ns) ((ns[3]=='M')&&(ns[4]=='S')&&(ns[5]=='S'))
! //typedef struct nmea_data NMEA_Data;
// 0 length for using in TinyOS interface
// definitions, general type checking, etc.
// Members may be added later.
! typedef struct nmea_data {
! } NMEA_Data;
***************
*** 110,115 ****
*/
typedef struct gga_data {
- NMEA_Data nd;
uint8_t hours;
uint8_t minutes;
--- 111,116 ----
*/
typedef struct gga_data {
+ //NMEA_Data nd;
uint8_t hours;
uint8_t minutes;
***************
*** 189,192 ****
--- 190,194 ----
} VTG_Data;
+
typedef struct mss_data {
NMEA_Data nd;
Index: NMEAM.nc
===================================================================
RCS file: /cvsroot/firebug/fireboard/beta/tos/sensorboards/mts400/GPS/NMEAM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NMEAM.nc 19 May 2005 17:31:54 -0000 1.1
--- NMEAM.nc 27 May 2005 00:38:32 -0000 1.2
***************
*** 28,32 ****
- includes NMEA;
module NMEAM {
--- 28,31 ----
***************
*** 38,41 ****
--- 37,45 ----
implementation {
+ #include "gps.h"
+ #include "NMEA.h"
+
+
+
command uint8_t NMEA.get_type (const char * nmeastring) {
return 0;
***************
*** 53,65 ****
* done now in the MTS420 driver code.
*/
! command result_t NMEA.gga_parse (GGA_Data * ggad, GPS_MsgPtr gps_data) {
! /* int i = 0;
int numcommas = 0;
int numsats = 0;
const char * data;
- const char * gga_string;
- gga_string = (const char * )(gps_data->data);
while (numcommas < 7) {
if (gga_string[i] == ',') {
--- 57,67 ----
* done now in the MTS420 driver code.
*/
! command result_t NMEA.gga_parse (GGA_Data * ggad, const char * gga_string) {
! int i = 0;
int numcommas = 0;
int numsats = 0;
const char * data;
while (numcommas < 7) {
if (gga_string[i] == ',') {
***************
*** 89,153 ****
ggad->NSEWind = extract_GGA_NSEWind_m(gga_string);
- */
- char gga_fields[GGA_FIELDS][GPS_CHAR_PER_FIELD]; // = {{0}};
- char * pdata;
- uint8_t NS,EW;
- uint8_t i,j,k,m;
- bool end_of_field;
- uint8_t length;
-
- // parse comma delimited fields to gga_filed[][]
- end_of_field = FALSE;
- i=0;
- k=0;
- length = gps_data->length;
- while (i < GGA_FIELDS) {
- // assemble gga_fields array
- end_of_field = FALSE;
- j = 0;
- while ((!end_of_field) &( k < length)) {
- if (gps_data->data[k] == GPS_DELIMITER) {
- end_of_field = TRUE;
- }
- else {
- gga_fields[i][j] = gps_data->data[k];
- }
- j++;
- k++;
- }
- // two commas (,,) indicate empty field
- // if field is empty, set it equal to 0
- if (j <= 1) {
- for (m=0; m<GPS_CHAR_PER_FIELD; m++) gga_fields[i][m] = '0';
- }
- i++;
- }
-
- pdata=gga_fields[6];
- ggad->fixQuality = extract_fix_quality_m(pdata);
-
- // Extract number_of_satellites
- // no fix if less 3 satellites, and bad fix if less than 5 sats.
-
- pdata=gga_fields[7];
- ggad->num_sats = extract_num_sats_m(pdata);
-
- // Extract Greenwich time.
- pdata=gga_fields[1];
- ggad->hours = extract_hours_m(pdata);
- ggad->minutes = extract_minutes_m(pdata);
- ggad->dec_sec = extract_dec_sec_m(pdata);
-
- pdata=gga_fields[2];
- ggad->Lat_deg = extract_Lat_deg_m(pdata);
- ggad->Lat_dec_min = extract_Lat_dec_min_m(pdata);
-
- pdata = gga_fields[4];
- ggad->Long_deg = extract_Long_deg_m(pdata);
- ggad->Long_dec_min = extract_Long_dec_min_m(pdata);
-
- NS = (gga_fields[3][0] == 'N') ? 1 : 0;
- EW = (gga_fields[5][0] == 'W') ? 1 : 0;
- ggad->NSEWind = EW | (NS<<4); // eg. Status = 000N000E = 00010000
return SUCCESS;
--- 91,94 ----
--- NMEA.nc DELETED ---
|