Révision 328
Ajouté par Mourougen MARIMOUTOU-POUGARY il y a presque 3 ans
main.c | ||
---|---|---|
|
||
}
|
||
|
||
float decode_position(char *trame,Position* P)//Fonction qui stock la latitude dans la structure Position
|
||
Position decode_position(char *trame,Position* P)//Fonction qui stocke la latitude dans la structure Position
|
||
{
|
||
(*P).Latitude=decode_latitude(trame);
|
||
(*P).Longitude=decode_longitude(trame);
|
||
return (*P).Latitude;
|
||
(*P).Longitude=decode_latitude(trame);
|
||
//return (*P).Latitude;
|
||
}
|
||
|
||
|
||
|
||
float decode_trame(char *trame,Position P)
|
||
float decode_trame(char *trame,Position P)//Fonction qui extrait la position(latitude,longitude) pour les trame trame valide
|
||
{
|
||
if(trame_cmp(trame,"GPPGA")==1)
|
||
{
|
||
decode_position(trame,&P);
|
||
return 1;
|
||
}
|
||
}
|
||
|
||
... | ... | |
|
||
printf("%f\n",decode_latitude("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D"));
|
||
printf("%f\n",decode_longitude("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D"));*/
|
||
Position pos;
|
||
//Position pos;
|
||
/*printf("Latitude: %f Longitude: %f\n",decode_position("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",&pos));*/
|
||
//printf(decode_trame("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",pos));
|
||
|
||
/*if (decode_trame("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",pos)!=1){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
... | ... | |
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}*/
|
||
//printf()
|
||
|
||
Position P1,P2;
|
||
Position p_2=decode_position("$GPGGA,141917.00,4545.0242,N,00306.6039,E,1,05,3.4,499.6,M,,M,,*73",&P2);
|
||
Position p_1=decode_position("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",&P1);
|
||
printf("distance: %f\n",calcul_distance(p_1,p_2));
|
||
printf("vitesse: %f\n",calcul_vitesse(p_1,p_2));
|
||
}
|
||
|
||
// Ne pas modifier cette fonction
|
Formats disponibles : Unified diff
Test de la fonction calcul_vitesse