Révision 422
Ajouté par Hatim EL MAADI il y a presque 3 ans
branch/ELMAADI/sp4a12/main.c | ||
---|---|---|
"$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",
|
||
"$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39",
|
||
"$GPVTG,99.4,T,,M,0.4,N,0.7,K*57",
|
||
"$GPZDA,141914.00,01,02,2006,00,00*69",
|
||
0};
|
||
"$GPZDA,141914.00,01,02,2006,00,00*69",
|
||
0};
|
||
typedef struct
|
||
{
|
||
float latitude;
|
||
float longitude;
|
||
}Position;
|
||
|
||
|
||
|
||
|
||
int trame_cmp(char *trame,char *type)
|
||
|
||
{
|
||
... | ... | |
result=longitude(ch);
|
||
}
|
||
return result;
|
||
}
|
||
}
|
||
|
||
float decode_trame(char *trame, Position *p)
|
||
{
|
||
p->latitude=latitude(trame);
|
||
p->longitude=longitude(trame);
|
||
}
|
||
|
||
/*Fonction ? modifier !!!!!*/
|
||
void traitement(char * trame)
|
||
{
|
||
... | ... | |
{
|
||
printf ("Erreur Test unitaire latitude_longitude.\n");
|
||
exit(-1);
|
||
}
|
||
Position p;
|
||
if (decode_trame("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",&p)!=1)
|
||
{
|
||
printf ("Erreur Test unitaire decode_trame.\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_trame("$GPGGA,141918.00,4545.0968,N,00306.6034,E,1,05,3.4,498.8,M,,M,,*7A",&p)!=1)
|
||
{
|
||
printf ("Erreur Test unitaire decode_trame.\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_trame("$GPGGA,141925.00,4545.2410,N,00306.6046,E,1,05,3.4,501.4,M,,M,,*7C",&p)!=1)
|
||
{
|
||
printf ("Erreur Test unitaire decode_trame.\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_trame("$GPGGA,141922.00,4545.1810,N,00306.6046,E,1,05,3.4,500.6,M,,M,,*77",&p)!=1)
|
||
{
|
||
printf ("Erreur Test unitaire decode_trame.\n");
|
||
exit(-1);
|
||
}
|
||
}
|
||
|
Formats disponibles : Unified diff
Implantation de la fonction decode_trame avec tests.