Projet

Général

Profil

« Précédent | Suivant » 

Révision 223

Ajouté par gasacco il y a presque 4 ans

Modification fonction decode_trame

Voir les différences:

branch/sacco/sp4a12/main.c
"$GPZDA,141914.00,01,02,2006,00,00*69",
0};
typedef struct
{
float latitude;
......
{
int nb_Virgule = 0;
int i =0;
int k;
int Lat[10];
int Long[12];
int k = 0;
int j =0;
char Lat[10];
char Long[12];
int debut_Lat;
int debut_Long;
while (trame[i] !='\0')
{
if (trame[i] = ',')
if (nb_Virgule ==2 && i!= 26)
{
Lat[k] = trame[i];
k++;
}
if (nb_Virgule ==4 && i!= 39)
{
Long[j] = trame[i];
j++;
}
if (trame[i] == ',')
{
nb_Virgule += 1;
if (nb_Virgule ==2)
{
Lat[i+1] = trame[i+1];
p->latitude = conversion(Lat);
}
if (nb_Virgule == 4)
{
Long[i+1] = trame[i+1];
p->longitude = conversion(Long);
}
}
i++;
}
p->latitude = conversion(Lat);
p->longitude = conversion(Long);
}
else
{
return -1;
}
printf("Latitude= %f , Longitude = %f\n", p->latitude, p->longitude);
}

Formats disponibles : Unified diff