[Firebug-cvs] firebug/project/src/gps TestMTS350M.nc,1.1,1.2
Brought to you by:
doolin
From: <cs...@us...> - 2003-07-11 16:04:15
|
Update of /cvsroot/firebug/firebug/project/src/gps In directory sc8-pr-cvs1:/tmp/cvs-serv7317 Modified Files: TestMTS350M.nc Log Message: log_array must be assembled in parallel w GGA_Msg Index: TestMTS350M.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/gps/TestMTS350M.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMTS350M.nc 8 Jul 2003 21:51:35 -0000 1.1 --- TestMTS350M.nc 11 Jul 2003 16:04:10 -0000 1.2 *************** *** 71,75 **** #define MSG_LENGTH 100 ! #define GGA_BYTES 12 #define NUM_FIELDS 6 #define NUM_BYTES_PER_FIELD 10 --- 71,75 ---- #define MSG_LENGTH 100 ! #define GGA_BYTES 11 #define NUM_FIELDS 6 #define NUM_BYTES_PER_FIELD 10 *************** *** 304,310 **** //***DEBUG: Output NMEA message*** ! //uint16_t q; ! //for(q=0; q<length; q++) UARTPutChar(NMEAstr[q]); ! //SODbg(DBG_USR2, "\n"); //******************************** --- 304,310 ---- //***DEBUG: Output NMEA message*** ! uint16_t q; ! for(q=0; q<length; q++) UARTPutChar(NMEAstr[q]); ! SODbg(DBG_USR2, "\n"); //******************************** *************** *** 328,332 **** // if field is empty, set it equal to 0 if (j <= 1) { ! for (m=0; m<10; m++) write[i][m] = 0; } --- 328,333 ---- // if field is empty, set it equal to 0 if (j <= 1) { ! //for (m=0; m<10; m++) write[i][m] = '0'; ! for (m=0; m<10; m++) write[i][m] = '9'; } *************** *** 350,355 **** GGA_Msg *pGGA; ! //char log_array[GGA_BYTES]; ! char log_array[16]; char NS; --- 351,355 ---- GGA_Msg *pGGA; ! char log_array[GGA_BYTES]; char NS; *************** *** 360,398 **** pGGA->hours = 10*(write[1][0]-'0') + (write[1][1]-'0'); pGGA->minutes = 10*(write[1][2]-'0') + (write[1][3]-'0'); pGGA->dec_sec = 10000*(write[1][4]-'0') + 1000*(write[1][5]-'0') + 100*(write[1][7]-'0') + 10*(write[1][8]-'0') + (write[1][9]-'0'); pGGA->Lat_deg = 10*(write[2][0]-'0') + (write[2][1]-'0'); pGGA->Lat_dec_min = 100000*(write[2][4]-'0') + 10000*(write[2][5]-'0') + 1000*(write[2][7]-'0') + 100*(write[2][8]-'0') + 10*(write[2][9]-'0') + (write[2][10]-'0'); pGGA->Long_deg = 10*(write[4][0]-'0') + (write[4][1]-'0'); pGGA->Long_dec_min = 100000*(write[4][4]-'0') + 10000*(write[4][5]-'0') + 1000*(write[4][7]-'0') + 100*(write[4][8]-'0') + 10*(write[4][9]-'0') + (write[4][10]-'0'); NS = (write[3][0] == 'N') ? 1 : 0; EW = (write[5][0] == 'W') ? 1 : 0; pGGA->NSEWind = EW | (NS<<4); // eg. Status = 000N000E = 00010000 ! // Log GGA_Msg ! ! j = 0; ! log_array[j++] = pGGA->hours; ! log_array[j++] = pGGA->minutes; ! log_array[j++] = (pGGA->dec_sec)>>8; // MSB ! log_array[j++] = pGGA->dec_sec; // LSB ! log_array[j++] = pGGA->Lat_deg; ! log_array[j++] = (pGGA->Lat_dec_min)>>8; ! log_array[j++] = pGGA->Lat_dec_min; ! log_array[j++] = pGGA->Long_deg; ! log_array[j++] = (pGGA->Long_dec_min)>>8; ! log_array[j++] = pGGA->Long_dec_min; ! log_array[j++] = pGGA->NSEWind; ! log_array[j++] = 0xFF; ! log_array[j++] = 0xFF; ! log_array[j++] = 0xFF; ! log_array[j++] = 0xFF; ! //if(call GpsCmd.GpsPower(0)) { ! // SODbg(DBG_USR2, "GPS Power Off\n"); ! //} if(call LoggerWrite.write(0x19,(char *)log_array)){ --- 360,395 ---- pGGA->hours = 10*(write[1][0]-'0') + (write[1][1]-'0'); + log_array[0] = pGGA->hours; pGGA->minutes = 10*(write[1][2]-'0') + (write[1][3]-'0'); + log_array[1] = pGGA->minutes; pGGA->dec_sec = 10000*(write[1][4]-'0') + 1000*(write[1][5]-'0') + 100*(write[1][7]-'0') + 10*(write[1][8]-'0') + (write[1][9]-'0'); + log_array[2] = (pGGA->dec_sec)>>8; // MSB + log_array[3] = pGGA->dec_sec; // LSB pGGA->Lat_deg = 10*(write[2][0]-'0') + (write[2][1]-'0'); + log_array[4] = pGGA->Lat_deg; pGGA->Lat_dec_min = 100000*(write[2][4]-'0') + 10000*(write[2][5]-'0') + 1000*(write[2][7]-'0') + 100*(write[2][8]-'0') + 10*(write[2][9]-'0') + (write[2][10]-'0'); + log_array[5] = (pGGA->Lat_dec_min)>>8; + log_array[6] = pGGA->Lat_dec_min; pGGA->Long_deg = 10*(write[4][0]-'0') + (write[4][1]-'0'); + log_array[7] = pGGA->Long_deg; pGGA->Long_dec_min = 100000*(write[4][4]-'0') + 10000*(write[4][5]-'0') + 1000*(write[4][7]-'0') + 100*(write[4][8]-'0') + 10*(write[4][9]-'0') + (write[4][10]-'0'); + log_array[8] = (pGGA->Long_dec_min)>>8; + log_array[9] = pGGA->Long_dec_min; NS = (write[3][0] == 'N') ? 1 : 0; EW = (write[5][0] == 'W') ? 1 : 0; pGGA->NSEWind = EW | (NS<<4); // eg. Status = 000N000E = 00010000 + log_array[10] = pGGA->NSEWind; ! //***DEBUG: Output GGA data before write*** ! //for(j=0; j<11; j++) UARTPutChar(log_array[j]); ! //SODbg(DBG_USR2, "\n"); ! //***************************************** ! if(call GpsCmd.GpsPower(0)) { ! SODbg(DBG_USR2, "GPS Power Off\n"); ! } if(call LoggerWrite.write(0x19,(char *)log_array)){ *************** *** 409,413 **** //uint8_t i; //if (call LoggerRead.read(0x19,line)) { ! // for(i=0; i<32; i++) UARTPutChar(line[i]); //} //SODbg(DBG_USR2, "\n"); --- 406,410 ---- //uint8_t i; //if (call LoggerRead.read(0x19,line)) { ! // for(i=16; i<32; i++) UARTPutChar(line[i]); //} //SODbg(DBG_USR2, "\n"); |