Révision 83
Ajouté par Khalid YAZID il y a environ 3 ans
branch/yazid/sp4a12/main.c | ||
---|---|---|
void traitement(char * trame)
|
||
{
|
||
static int cpt=0 ;
|
||
cpt++ ;
|
||
printf ("> %s\n",trame);
|
||
cpt++ ;
|
||
int b=trame_cmp(trame,"GPGGA");
|
||
if (b==1){
|
||
printf ("> %s\n",trame);
|
||
}
|
||
}
|
||
int trame_cmp(char *trame , char *type){
|
||
int i,j;
|
||
int i;
|
||
int test=1;
|
||
for (i=0;i<5;i++){
|
||
if(trame[i+1]!=type[i]){
|
||
... | ... | |
}
|
||
|
||
//Ajouter vos tests unitaires dans cette fonction.
|
||
/*void tests_unitaires(void){
|
||
void tests_unitaires(void){
|
||
if (5!=5){
|
||
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);
|
||
}
|
||
... | ... | |
if (trame_cmp("$APRMC...", "GPGGA")!=0){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
}*/
|
||
}*/
|
||
}
|
||
|
||
// Ne pas modifier cette fonction
|
||
int main(int argc,char ** argv)
|
Formats disponibles : Unified diff
Le programme n'affiche que les trames GPGGA.