Révision 79
Ajouté par Mourougen MARIMOUTOU-POUGARY il y a environ 3 ans
branch/MARIMOUTOU_Mourougen/main.c | ||
---|---|---|
0};
|
||
//Fonctions Personnels
|
||
|
||
|
||
|
||
int trame_cmp(char * trame,char * type)
|
||
{
|
||
int i,j;
|
||
... | ... | |
}
|
||
return verif;
|
||
}
|
||
|
||
int decode_int(char c)
|
||
{
|
||
if(c>='0' && c<='9')
|
||
{
|
||
c-=48;
|
||
}
|
||
else
|
||
{
|
||
return -1;
|
||
}
|
||
}
|
||
|
||
int decode_nombre(char *ch,int n)
|
||
{
|
||
int temp=0;
|
||
int i;
|
||
for(i=0;i<n;i++)
|
||
{
|
||
temp=(temp*10)+decode_int(ch[i]);
|
||
}
|
||
return temp;
|
||
}
|
||
//
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
{
|
||
static int cpt=0;
|
||
if(trame_cmp(trame,"GPGGA")==1)
|
||
{
|
||
printf ("> %s\n",trame);
|
||
cpt++;
|
||
}
|
||
if(trame_cmp(trame,"GPGGA")==1)
|
||
{
|
||
printf ("> %s\n",trame);
|
||
cpt++;
|
||
}
|
||
}
|
||
|
||
//Ajouter vos tests unitaires dans cette fonction.
|
||
... | ... | |
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}*/
|
||
/*if (decode_int('A')!=-1){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}*/
|
||
|
||
|
||
}
|
||
|
Formats disponibles : Unified diff
Question 6 Test fonction decode int