Ahmed_PFE_Embarq_300415

Dependencies:   C12832 LM75B mbed

Fork of Ahmed_Embarq_Prog by ahmed ahmed

Committer:
pfe
Date:
Tue Apr 21 10:16:20 2015 +0000
Revision:
0:05a20e3e3179
dd

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pfe 0:05a20e3e3179 1 unsigned char _DL,_Npt,_Pospt;
pfe 0:05a20e3e3179 2 unsigned char _hh,_mm,_ss;
pfe 0:05a20e3e3179 3 unsigned char _LatDeg,_LatMin,_LatMin1,_LatMin2,_LatDir;
pfe 0:05a20e3e3179 4 unsigned char _LongDeg,_LongMin,_LongMin1,_LongMin2,_LongDir;
pfe 0:05a20e3e3179 5 unsigned char _Qual;
pfe 0:05a20e3e3179 6 unsigned char _SignHMSL,_HMSL_L,_HMSL_H,_HMSL_1,_HMSL_2,_HUnite;
pfe 0:05a20e3e3179 7 unsigned char _dd,_yy,_mn,_val;
pfe 0:05a20e3e3179 8
pfe 0:05a20e3e3179 9 unsigned char _Data[16],_PosV[16],_MsgGPSRx[100];
pfe 0:05a20e3e3179 10
pfe 0:05a20e3e3179 11 // defini un structure
pfe 0:05a20e3e3179 12 typedef struct {
pfe 0:05a20e3e3179 13 unsigned char GGA_Valid;
pfe 0:05a20e3e3179 14 unsigned char hh;
pfe 0:05a20e3e3179 15 unsigned char mm;
pfe 0:05a20e3e3179 16 unsigned char ss;
pfe 0:05a20e3e3179 17
pfe 0:05a20e3e3179 18 unsigned char LatDeg;
pfe 0:05a20e3e3179 19 unsigned char LatMin;
pfe 0:05a20e3e3179 20 unsigned char LatMin1;
pfe 0:05a20e3e3179 21 unsigned char LatMin2;
pfe 0:05a20e3e3179 22 unsigned int Latmmmm;
pfe 0:05a20e3e3179 23 unsigned char LatDir;
pfe 0:05a20e3e3179 24
pfe 0:05a20e3e3179 25 unsigned char LongDeg;
pfe 0:05a20e3e3179 26 unsigned char LongMin;
pfe 0:05a20e3e3179 27 unsigned char LongMin1;
pfe 0:05a20e3e3179 28 unsigned char LongMin2;
pfe 0:05a20e3e3179 29 unsigned int Longmmmm;
pfe 0:05a20e3e3179 30 unsigned char LongDir;
pfe 0:05a20e3e3179 31
pfe 0:05a20e3e3179 32 unsigned char Qual;
pfe 0:05a20e3e3179 33
pfe 0:05a20e3e3179 34 unsigned int HMSL;
pfe 0:05a20e3e3179 35 unsigned char SignHMSL;
pfe 0:05a20e3e3179 36 unsigned char HUnite;
pfe 0:05a20e3e3179 37 }StructGPS;
pfe 0:05a20e3e3179 38
pfe 0:05a20e3e3179 39 StructGPS GpsData;
pfe 0:05a20e3e3179 40 //------------------------------------------------------------------------------
pfe 0:05a20e3e3179 41 //Calcul de la longueur des sous message
pfe 0:05a20e3e3179 42 unsigned char Get_Length(unsigned short index)
pfe 0:05a20e3e3179 43 {
pfe 0:05a20e3e3179 44 static unsigned char LongData;
pfe 0:05a20e3e3179 45 LongData=_PosV[index+1]-_PosV[index]-1;
pfe 0:05a20e3e3179 46 return LongData;
pfe 0:05a20e3e3179 47 }
pfe 0:05a20e3e3179 48 //Décomposition du message en Sub message
pfe 0:05a20e3e3179 49 void Set_Data(unsigned char index){
pfe 0:05a20e3e3179 50 static unsigned char ii,jj;
pfe 0:05a20e3e3179 51 static unsigned char Start,End;
pfe 0:05a20e3e3179 52 ii=0;
pfe 0:05a20e3e3179 53 Start = _PosV[index]+1;
pfe 0:05a20e3e3179 54 End = _PosV[index+1];
pfe 0:05a20e3e3179 55
pfe 0:05a20e3e3179 56 for(jj=Start;jj<End;jj++){
pfe 0:05a20e3e3179 57 _Data[ii] = _MsgGPSRx[jj];
pfe 0:05a20e3e3179 58 ii++;
pfe 0:05a20e3e3179 59 }
pfe 0:05a20e3e3179 60 }
pfe 0:05a20e3e3179 61 //Vérification des sub message
pfe 0:05a20e3e3179 62 void Validation_StrToFloat(unsigned char LongData)
pfe 0:05a20e3e3179 63 {
pfe 0:05a20e3e3179 64 unsigned char ii;
pfe 0:05a20e3e3179 65 _Npt = 0;
pfe 0:05a20e3e3179 66 _Pospt = 0;
pfe 0:05a20e3e3179 67 for(ii=0;ii<LongData;ii++){
pfe 0:05a20e3e3179 68 if(_Data[ii]=='.')
pfe 0:05a20e3e3179 69 {
pfe 0:05a20e3e3179 70 _Npt++;
pfe 0:05a20e3e3179 71 _Pospt=ii;
pfe 0:05a20e3e3179 72 }
pfe 0:05a20e3e3179 73 else if((_Data[ii]<48)||(_Data[ii]>57)) _Npt=_Npt+2;
pfe 0:05a20e3e3179 74 }
pfe 0:05a20e3e3179 75 }
pfe 0:05a20e3e3179 76
pfe 0:05a20e3e3179 77 void DecodageGPGGA(unsigned char Ldata);
pfe 0:05a20e3e3179 78
pfe 0:05a20e3e3179 79 //------------------------------------------------------------------------------
pfe 0:05a20e3e3179 80 #include "DecMsgGPGGA.h" // GPGGA
pfe 0:05a20e3e3179 81 //------------------------------------------------------------------------------