Projet

Général

Profil

« Précédent | Suivant » 

Révision 257

Ajouté par malameynar il y a presque 4 ans

début du codage de la fonction de conversion de la longitude

Voir les différences:

main.c
return(x);
}
float lon_float(char * ch){
int deg;
int min;
float lon=0;
deg=decode_nombre(ch,2);
min=decode_nombre(ch,8)-deg*1000000;
lon=deg+min/60;
if ((ch[8]!=78) && (ch[8]!=83)){
return(200);
}
else{
if(ch[8]=83){
lon=-lon;
}
}
return (lon);
}
/*
float lon_float(char * trame)
int i=17;
float lon=0;
int deg=0;
int min=0;
while (i<19){
if(decode_int(trame[i])!=-1){
printf("%c",trame[i]);
}
i+=1;
}
while (i<26){
if(decode_int(trame[i])!=-1){
printf("%c",trame[i]);
}
i+=1;
}
printf("\n");
return(1);
}
*/
//Fonction ? modifier !!!!!
void traitement(char * trame)
......
cpt++ ;
if (trame_cmp(trame,"GPGGA")==1){
printf ("> %s\n",trame);
// lon_float(trame);
}
}
......
exit(-1);
}
// test_decode_int();
test_decode_nombre();
// test_decode_nombre();
test_lon_float();
}
test_decode_int(void){
test_decode_int(void){
int i;
......
printf("%d\n",decode_nombre(chaine,i));
}
}
test_lon_float(void){
printf("%d",);
printf("nique sa race %f",lon_float("00636036N"));
}
// Ne pas modifier cette fonction
int main(int argc,char ** argv)
{

Formats disponibles : Unified diff