Update of /cvsroot/firebug/fireboard/beta/apps/XSensorMTS400
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18199
Modified Files:
TestMTS400M.nc
Log Message:
double buffering and formatting changes
Index: TestMTS400M.nc
===================================================================
RCS file: /cvsroot/firebug/fireboard/beta/apps/XSensorMTS400/TestMTS400M.nc,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** TestMTS400M.nc 17 Aug 2005 23:50:14 -0000 1.18
--- TestMTS400M.nc 8 Sep 2005 23:33:46 -0000 1.19
***************
*** 639,684 ****
#ifdef MTS420
! /******************************************************************************
! * Packet received from GPS - ASCII msg
! * 1st byte in pkt is number of ascii bytes
! * async used only for testing
! GGA - Global Positioning System Fix Data
! GGA,123519,4807.038,N,01131.324,E,1,08,0.9,545.4,M,46.9,M, , *42
! 123519 Fix taken at 12:35:19 UTC
! 4807.038,N Latitude 48 deg 07.038' N
! 01131.324,E Longitude 11 deg 31.324' E
! 1 Fix quality: 0 = invalid
! 1 = GPS fix
! 2 = DGPS fix
! 08 Number of satellites being tracked
! 0.9 Horizontal dilution of position
! 545.4,M Altitude, Metres, above mean sea level
! 46.9,M Height of geoid (mean sea level) above WGS84
! ellipsoid
! (empty field) time in seconds since last DGPS update
! (empty field) DGPS station ID number
! *****************************************************************************/
! event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) {
! //uint32_t temp;
! //GGA_Data gga_data = {0};
char * leadtek_string;
GGA_Data * gga_data_ptr;
- //change to GPS packet!!
- GPS_MsgPtr gps_data = (GPS_MsgPtr)data;
-
- //gga_data_ptr = &gga_data;
-
gga_data_ptr = &(pack->xData.gga_data);
// if gps have been scaned then stop receiving gps uart packet
- if (readStep == GPS_DONE) return data;
! leadtek_string = gps_data->data;
! #if 0
if (leadtek_string[0] == '$') {
int i;
! for (i=0;i < MIN(sizeof(gps_data->data),gps_data->length);i += 1) {
SODbg(DBG_USR2, "%c",leadtek_string[i]);
if (leadtek_string[i] == '*') break;
--- 639,668 ----
#ifdef MTS420
! // When a packet is received from the GPS we retain a pointer to
! // that packet and hand a pointer to another buffer back to the
! // lower level. Each sucessive message swaps buffers, establishing
! // a double buffering scheme.
! static GPS_Msg gpsData; // contributed buffer for double buffering
! static GPS_Msg *pGPSdata = &gpsData; // buffer to dump
! // Report and handle the content of a message that came in from the
! // GPS and is stored inpGGAdata.
! task void handleGPSmessage() {
char * leadtek_string;
GGA_Data * gga_data_ptr;
gga_data_ptr = &(pack->xData.gga_data);
// if gps have been scaned then stop receiving gps uart packet
! // ???is this still appropriate? Double buffering should
! // eliminate the need.
! if (readStep == GPS_DONE) return;
!
! leadtek_string = pGPSdata->data;
! #if 1
if (leadtek_string[0] == '$') {
int i;
! for (i=0;i < MIN(sizeof(pGPSdata->data),pGPSdata->length);i += 1) {
SODbg(DBG_USR2, "%c",leadtek_string[i]);
if (leadtek_string[i] == '*') break;
***************
*** 708,712 ****
// Deal with the following later.
#if 0
! else if (is_gsa_string(data)) {
call nmea.gsa_parse(gsa_data_ptr, leadtek_string);
} else if (is_gva_string(data)) {
--- 692,696 ----
// Deal with the following later.
#if 0
! else if (is_gsa_string(pGPSdata->data)) {
call nmea.gsa_parse(gsa_data_ptr, leadtek_string);
} else if (is_gva_string(data)) {
***************
*** 748,752 ****
#endif
};
! return data;
}
--- 732,752 ----
#endif
};
! }
!
!
! // A gps message has been collected from the receiver. Log it and
! // set off a task to report it.
! //
! // Inputs:
! // pData really a pointer to a GGA_data block
! // Returns:
! // new buffer for lower level to use
! event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr pData) {
! GPS_Msg *pTemp;
!
! pTemp = pGPSdata;
! pGPSdata = (GPS_Msg *)pData;
! post handleGPSmessage();
! return (TOS_MsgPtr)pTemp;
}
|