Decod Msg GPS

Dependencies:   C12832 mbed

Fork of ComGPS by SAADI Nadia

GPS_Decod_Function/GPS_Init.h

Committer:
pfe
Date:
2015-03-03
Revision:
1:821bd360ec5b

File content as of revision 1:821bd360ec5b:

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
//------------------------------------------------------------------------------