Révision 323
Ajouté par Victor SOUDY il y a environ 3 ans
main.c | ||
---|---|---|
"$GPZDA,141914.00,01,02,2006,00,00*69",
|
||
0};
|
||
// structure
|
||
typedef struct
|
||
/*typedef struct
|
||
{
|
||
float longitude;
|
||
float latitude;
|
||
}position;
|
||
}position;*/
|
||
|
||
//fcts ajout?s
|
||
int trame_cmp(char*trame,char*type)
|
||
... | ... | |
return longdeg;
|
||
}
|
||
|
||
void coordonnee_to_float (char*trame,position pos)
|
||
//void coordonnee_to_float (char*trame,position pos)
|
||
void coordonne_to_float (char*trame,float* lat_position,float* long_position)
|
||
{
|
||
pos.latitude=lat_to_float(trame);
|
||
pos.longitude=long_to_float(trame);
|
||
return 0;
|
||
//pos.latitude=lat_to_float(trame);
|
||
//pos.longitude=long_to_float(trame);
|
||
//return 0;
|
||
*lat_position=lat_to_float (trame);
|
||
*long_position=long_to_float (trame);
|
||
}
|
||
|
||
|
||
... | ... | |
trame_cmp(trame,"GPGGA");
|
||
if (trame_cmp(trame,"GPGGA")==1)
|
||
{
|
||
position pos;
|
||
printf("%f\n%f\n",coordonnee_to_float(trame,pos)); // comment printf le resultat d'une proc?dure en C ?
|
||
//position pos;
|
||
//printf("%f\n%f\n",coordonnee_to_float(trame,pos)); // comment printf le resultat d'une proc?dure en C ?
|
||
float x,y;
|
||
coordonne_to_float(trame,&x,&y);
|
||
printf("%f\n%f\n",x,y);
|
||
printf ("> %s\n",trame);
|
||
}
|
||
|
Formats disponibles : Unified diff
modification du main pour afficher la longitude et latitude de chaque trame