⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gps.cpp

📁 this the code of bootstation
💻 CPP
📖 第 1 页 / 共 3 页
字号:
		  //printf ( " UTC Time (Format: hhmmss.sss): not found!\n" );
		 }
		 int iPlace = 0;
		 break;
		}
	case 1: 
		{
        if ( iPlace != 0 )
		 {
		  
          while ( iPlace != 0 )
		  {
           
		   stat=buffer[i-iPlace];
		   
		   if (stat=='\0') stat='X';
		   iPlace--;
		  }
		  
		 }
		 else 
		 {
		  
		 }
		 int iPlace = 0;
		 break;
		}
	case 2: 
		{
         if ( iPlace != 0 )
		 {
		  
          while ( iPlace != 0 )
		  {
		   latitude[i-iPlace-19] = buffer[i-iPlace];
		  
		   iPlace--;
		  }
		  
		 }
		 else 
		 {
		  
		 }
		 int iPlace = 0;
		 break;
		}
	case 3: 
		{
         if ( iPlace != 0 )
		 {
		  
          while ( iPlace != 0 )
		  {
           
		   N_S = buffer[i-iPlace];
		   switch ( buffer[i-iPlace] )
		   {
		    case 'N' : latitude[0]='+' ; break;
		    case 'S' : latitude[0]='-' ; break;
			default  : latitude[0]=' '; break;
		   }
		   
		   iPlace--;
		  }
		  
		 }
		 else 
		 {
		  
		 }
		 int iPlace = 0;
		 break;
		}
	case 4: 
		{
			
         if ( iPlace != 0 )
		 {
		  
          while ( iPlace != 0 )
		  {
           
		   longitude[i-iPlace-31]=buffer[i-iPlace];
		   
		   iPlace--;
		  }
		  
		 }
		 else 
		 {
		  
		 }
		 int iPlace = 0;
		 break;
		}
	case 5: 
		{
         if ( iPlace != 0 )
		 {
		  
          while ( iPlace != 0 )
		  {
           
		   E_W = buffer[i-iPlace];
		   switch ( buffer[i-iPlace] )
		   {
		    case 'E' : longitude[0]='+' ; break;
		    case 'W' : longitude[0]='-' ; break;
			default  : longitude[0]=' '; break;
		   }
		   iPlace--;
		  }
		  
		 }
		 else 
		 {
		 
		 }
		 int iPlace = 0;
		 break;
		}
    case 6:
		{
         if ( iPlace != 0 )
		 {
		  
          while ( iPlace != 0 )
		  {
           
		   iPlace--;
		  }
		  
		 }
		 else 
		 {
		  
		 }
		 int iPlace = 0;
		 break;
		}
    case 7:
		{
         if ( iPlace != 0 )
		 {
		  
          while ( iPlace != 0 )
		  {
           
		   iPlace--;
		  }
		  
		 }
		 else 
		 {
		  
		 }
		 int iPlace = 0;
		 break;
		}
    case 8:
		{
         if ( iPlace != 0 )
		 {
		  
          while ( iPlace != 0 )
		  {
           
		   iPlace--;
		  }
		  
		 }
		 else 
		 {
		  //printf ( " Date (Format: ddmmyy): not found!\n" );
		 }
		 int iPlace = 0;

		 break;// Keine weiteren Informationen

		}

//	default: if ( bDebugInfo == TRUE ) printf("****** Funktion: CSerial::PrintOverview Reached Default RMC Comma ******\n");

	}
	iCount++;
   }
   else 
   {
    iPlace++;
   }
   // wird das ende gefunden ( <CR><LF>)
   if ( buffer[i] == CR )
   {
    // ende wurde erreicht schleifen beenden
	break;
   }
  }  
  bTest = TRUE; // ueberstimmung merken!



lat_f=float(atof(latitude));
long_f=float(atof(longitude));
  RMC_flag=false;
  R_RMC_flag=false;
 }

 

 if ( ( bDebugInfo == TRUE ) && ( bTest == FALSE ) ) printf("****** Funktion: CSerial::PrintOverview Keine 躡ereinstimmung mit MsgTyp! ******\n");
 return ( bTest ); 
}//else if(RMC)
}

//------------------------------------------------------------------------------------------------------------------------
// Funktion:     BOOL SetSerialPort ( int iProtocol, int iBaud, int DataBits, int StopBits, int iParity );
// Beschreibung: Setzen der Eigenschaften des seriallen Schnittstelle des GPS-Moduls
// Paramter:     int iProtocol     : welches Protokoll soll verwendet werden
//								   :	0 = SiRF Binary 
//                                 :	1 = NMEA 
//                                 :	4 = USER1
//
//				 int iBaud         : welche BaudRate soll verwendet werden
//                                 :	1200, 2400, 4800, 9600, 19200, 38400
//
//				 int DataBits      : Anzahl der DatenBits
//								   :	7,8 DatenBits
//
//               int StopBits      : StopBits vorhanden
//								   :	0,1 StopBit
//
//				 int iParity       : Art des ParityBits
//								   :	0 = None 
//                                 :	1 = Odd 
//                                 :	2 = Even
//
// Return:	     BOOL			   : True:  Ausgeben war erfolgreich
//                                 : False: Ausgeben war nicht erfolgreich
//-------------------------------------------------------------------------------------------------------------------
CSerial::SetSerialPort ( int iProtocol, int iBaud, int DataBits, int StopBits, int iParity )
{
 if ( bDebugInfo == TRUE ) printf("****** Funktion: CSerial::SetSerialPort ******\n");
 
 return ( TRUE );
}


//------------------------------------------------------------------------------------------------------------------------
// Funktion:     BOOL SetNaviInit ( int iXCord, int iYCord, int iZCord, int iClkOffset, unsigned int iTimeOfWeek, 
//	         	                    unsigned short int iWeekNr, unsigned char byChNr, unsigned char byResetCfg );
//
// Beschreibung: Dieser Funktion wird genutzt um das Modul nach einen WarmStart zu initialisieren um das Bestimmen 
//               der Position zu beschleunigen
//
// Paramter:     int iXCord                : X coordinate position ( INT32 )
//				 int iYCord                : Y coordinate position ( INT32 )
//				 int iZCord                : Z coordinate position ( INT32 )
//			     int iClkOffset            : Clock offset of the receiver in Hz ( INT32 ) 
//                                         :	0     = last saved value
//                                         :	75000 = default value GSP1 
//                                         :	95000 = default value GSP 1/LX
//										   : 
//				 unsigned int iTimeOfWeek  : GPS Time Of Week ( UINT32 )
//               unsigned short int iWeekNr: GPS Week Number  ( UINT16 )
//               unsigned char byChNr      : Number of channels to use 1-12 ( UBYTE )
//               unsigned char byResetCfg  : Resetinformation ( UBYTE )
//										   :	0?1=Data Valid warm/hotstarts=1
//										   :	0?2=clear ephemeris warm start=1
//										   :	0?4=clear memory. Cold start=1
//
// Return:	     BOOL			   : True:  Ausgeben war erfolgreich
//                                 : False: Ausgeben war nicht erfolgreich
//-------------------------------------------------------------------------------------------------------------------
CSerial::SetNaviInit ( int iXCord, int iYCord, int iZCord, int iClkOffset, unsigned int iTimeOfWeek, 
		               unsigned short int iWeekNr, unsigned char byChNr, unsigned char byResetCfg )
{
 if ( bDebugInfo == TRUE ) printf("****** Funktion: CSerial::SetNaviInit ******\n");



 return ( TRUE );
}


//------------------------------------------------------------------------------------------------------------------------
// Funktion:     BOOL SetControllsNmeaMsg ( int iMsgTyp, int iMode, int iRate, int iCheckSumEnable )
//
// Beschreibung: Setzen der jeweiligen Sende-Einstellung fuer die verschiedenen NMEA-Msg
//
// Paramter:     int iMsgTyp              : Msg Typ:
//										  :	 	0 = GGA
//										  :		1 = GLL
//										  :		2 = GSA
//										  :		3 = GSV
//										  :		4 = RMC
//										  :		5 = VTG
//												
//				 int iMode                : Query oder setzen einer Zeit zum Aussenden
//										  :		0 = SetRate
//										  :		1 = Query
//
//				 int iRate                : Output every <rate>seconds, off=0,max=255
//										  :		0 = Msg Off
//										  :   255 = Max value
//
//			     int iCheckSumEnable      : Aktivieren der CheckSumme fuer diesen Msg-Typ
//										  :		0 = CheckSum OFF
//										  :		1 = CheckSum ON
//
// Return:	     BOOL			   : True:  Ausgeben war erfolgreich
//                                 : False: Ausgeben war nicht erfolgreich
//-------------------------------------------------------------------------------------------------------------------
CSerial::SetControllsNmeaMsg ( int iMsgTyp, int iMode, int iRate, int iCheckSumEnable )
{
 if ( bDebugInfo != TRUE ) printf("****** Funktion: CSerial::SetControllsNmeaMsg ******\n");

 return ( TRUE );
}
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -