Projet

Général

Profil

« Précédent | Suivant » 

Révision 103

Ajouté par annoyau il y a presque 4 ans

Ajout de ma fonction trame_cmp + affiche que les trames GPGGA

Voir les différences:

branch/NOYAU/sp4a12/main.c
"$GPVTG,99.4,T,,M,0.4,N,0.7,K*57",
"$GPZDA,141914.00,01,02,2006,00,00*69",
0};
int trame_cmp (char * trame, char * type) {
int trame_cmp(char* a,char* b){
return 0;
}
int i=0;
int verif = 0;
int j;
while (type[i] != '\0') {
i++;
}
for (j=0;j<i;j++){
if (trame[j+1] != type[j]){
verif = 0;
j=i;
}
else {
verif = 1;
}
}
return verif;
}
//Fonction ? modifier !!!!!
void traitement(char * trame)
{
static int cpt=0 ;
cpt++ ;
printf ("> %s\n",trame);
cpt++ ;
if (trame_cmp(trame,"GPGGA")==1) {
printf ("> %s\n",trame);
}
}
//Ajouter vos tests unitaires dans cette fonction.
......
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

Formats disponibles : Unified diff