Révision 41
Ajouté par Mafall FALL il y a environ 3 ans
branche/Mafall_FALL/sp4a12/main.c | ||
---|---|---|
"$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};
|
||
|
||
|
||
|
||
|
||
int trame_cmp(char* trame, char* type)
|
||
|
||
{
|
||
int a=1; // permet de valider si le debut de la trame est conforme avec le type .
|
||
int i=1;;// varaiables pour parcourir les tableaux
|
||
|
||
|
||
while ( a==1 && (&type[i])!=0)
|
||
{
|
||
if ( (&trame[i])!=&type[i-1])
|
||
{
|
||
a=0;
|
||
printf("a= %d",a);
|
||
printf("le trame ne commence pas par ce type \n");
|
||
|
||
}else
|
||
{
|
||
i++;
|
||
}
|
||
}
|
||
if (a==1)
|
||
{
|
||
|
||
printf("a= %d",a);
|
||
printf("Le Trame copmmence par le type donn? \n");
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
|
||
{
|
||
static int cpt=0;
|
||
char * type[] = {"$GPGSV","$GPGSV", "$GPRMC","$GPGLL","$GPGGA","$GPGSA ","$GPVTG" ,"$GPZDA",0};
|
||
int result=0;
|
||
int i=0;
|
||
while (trames[i] && type[i])
|
||
result = tram_cmp (&trames[i++], &type[i++]);
|
||
|
||
|
||
|
||
|
||
|
||
cpt++;
|
||
static int cpt=0;
|
||
cpt++;
|
||
printf ("> %s\n",trame);
|
||
}
|
||
|
||
... | ... | |
printf ("Erreur Test unitaire basique.\n");
|
||
exit(-1);
|
||
}
|
||
/*if (trame_cmp("$GPGGA suite chaine","GPGGA")!=1){
|
||
if (trame_cmp("$GPGGA suite chaine","GPGGA")!=1){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}*/
|
||
}
|
||
}
|
||
|
||
// Ne pas modifier cette fonction
|
Formats disponibles : Unified diff
implémentation de trame_cmp et mis a jour de traitement