Révision 216
Ajouté par abseck1 il y a presque 4 ans
branch/aseck/sp4a12/main.c | ||
---|---|---|
float longitude;
|
||
} position;
|
||
|
||
typedef struct
|
||
{
|
||
position rpos;
|
||
float vitmax;
|
||
} Zone;
|
||
|
||
Zone zones[] = {
|
||
{{44.7887762, -3.012}, 50}, /* Descripteur de la premi?re zone */
|
||
{{44.7891220, -3,013}, 70},
|
||
...
|
||
}
|
||
|
||
|
||
//Trames de tests ? modifier si n?cessaire.
|
||
char * trames[]= {"$GPGSV,3,2,10,15,03,077,,18,04,041,42,19,85,271,,20,08,214,*7C",
|
||
"$GPGSV,3,3,10,22,39,053,50,28,15,320,*7E",
|
||
... | ... | |
"$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39",
|
||
"$GPVTG,99.4,T,,M,0.4,N,0.7,K*57",
|
||
"$GPZDA,141914.00,01,02,2006,00,00*69",
|
||
0};
|
||
0};
|
||
|
||
Zone zones[] = {
|
||
{{44.7887762, -3.012}, 50}, /* Descripteur de la premi?re zone */
|
||
{{44.7891220, -3,013}, 70},
|
||
...
|
||
};
|
||
|
||
|
||
position test_position;
|
||
position pos1;
|
||
position pos2;
|
||
... | ... | |
return 1;
|
||
return 0;
|
||
int i;
|
||
for (i=0; i<strlen(type); i++)
|
||
for (i=0; i<strlen(type); i++)https://forge.clermont-universite.fr/svn/polytech-ge-sp4abc-2021
|
||
{
|
||
if (trame[i+1] != type[i])
|
||
return 0;
|
||
... | ... | |
somme=(somme*10) + decode_int(ch[i]);
|
||
}
|
||
return somme;
|
||
|
||
https://forge.clermont-universite.fr/svn/polytech-ge-sp4abc-2021
|
||
}float conversion_longitude(char * longi)
|
||
{
|
||
float result_convers,val_deci;
|
||
... | ... | |
}
|
||
|
||
|
||
|
||
int decode_trame (char * trame, position * pos)
|
||
{
|
||
int i;
|
||
char ch[10]
|
||
if(trame_cmp(char * trame, position * pos))
|
||
{
|
||
for (i=0; i<10; i++) ch[i]=trame[]
|
||
pos->latitude= conversion_latitude(trame)
|
||
pos->longitude=conversion_longitude(ch)
|
||
return 1;
|
||
}
|
||
return 0;
|
||
}
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
... | ... | |
if (trame_cmp("$APRMC...", "GPGGA")!=0){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
}https://forge.clermont-universite.fr/svn/polytech-ge-sp4abc-2021
|
||
}
|
||
|
||
// Ne pas modifier cette fonction
|
Formats disponibles : Unified diff
début TP 2