ahmed ahmed
/
Nadia_ComGPS_1
Decod Msg GPS
Fork of ComGPS by
Diff: GPS_Decod_Function/GPS_Init.h
- Revision:
- 1:821bd360ec5b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GPS_Decod_Function/GPS_Init.h Tue Mar 03 13:35:34 2015 +0000 @@ -0,0 +1,57 @@ +unsigned short *P0_Msg,*P_Msg; +unsigned short MSG_GPGGA_Valid; +unsigned short MSG_GPRMC_Valid; +unsigned short DL,Npt,Pospt; +unsigned short Start,End; + +unsigned short hh,mm,ss; +unsigned short LatDeg,LatMin,LatMin1,LatMin2,LatDir; +unsigned short LongDeg,LongMin,LongMin1,LongMin2,LongDir; +unsigned short Qual; +unsigned short SignHMSL,HMSL_L,HMSL_H,HMSL_1,HMSL_2,HUnite; +unsigned short dd,yy,mn,val; + +unsigned short Data[16],PosV[16]; +//------------------------------------------------------------------------------ +//Calcul de la longueur des sous message +unsigned short Get_Length(unsigned short index) + { + unsigned short LongData; + LongData=PosV[index+1]-PosV[index]-1; + return LongData; + } +//Décomposition du message en Sub message +void Set_Data(unsigned short index) + { + unsigned short ii,jj; + ii=0; + Start = PosV[index]+1; + index++; + End = PosV[index]; + P_Msg = P0_Msg+Start; + for(jj=Start;jj<End;jj++) + { + Data[ii]=*P_Msg; + P_Msg++; + ii++; + } + } +//Vérification des sub message +void Validation_StrToFloat(unsigned short LongData) + { + unsigned short ii; + Npt=0; + Pospt=0; + for(ii=0;ii<LongData;ii++) + { + if(Data[ii]=='.') + { + Npt++; + Pospt=ii; + } + else if((Data[ii]<48)||(Data[ii]>57)) Npt=Npt+2; + } + } +//------------------------------------------------------------------------------ +#include "DecMsgGPGGA.h" // GPGGA +//------------------------------------------------------------------------------