Révision 439
Ajouté par alpuech il y a presque 3 ans
main.c | ||
---|---|---|
}Position;
|
||
|
||
|
||
float decode_position(char *trame,Position Pos);
|
||
float decode_position(char *trame,Position Pos);
|
||
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
{
|
||
... | ... | |
printf ("Erreur Test unitaire basique.\n");
|
||
exit(-1);
|
||
}
|
||
/*if (trame_cmp("$GPGGA suite chaine","GPGGA")!=1){
|
||
if (trame_cmp("$GPGGA suite chaine","GPGGA")!=1){
|
||
printf ("Erreur Test unitaire trame_cmp1.\n");
|
||
exit(-1);
|
||
}
|
||
... | ... | |
if (test_decode_latitude()!=1){
|
||
printf ("Erreur Test unitaire trame_cmp7.\n");
|
||
exit(-1);
|
||
}*/
|
||
}
|
||
Position pos;
|
||
printf("%f\n",decode_position("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",pos));
|
||
|
||
... | ... | |
Pos.Longitude=decode_longitude(trame);
|
||
}
|
||
|
||
int decode_trame(char *trame,Position *Pos)
|
||
{
|
||
int i;
|
||
|
||
if(trame_cmp(char*trame)=="GPGGA")
|
||
{
|
||
decode_position(trame,&Pos);
|
||
i=1;
|
||
}
|
||
else
|
||
{
|
||
i=0;
|
||
}
|
||
return i;
|
||
}
|
||
|
||
int trame_cmp(char * trame,char * type)
|
||
{
|
||
int i;
|
Formats disponibles : Unified diff
TP1/2avancé au maximum