Révision 116
Ajouté par dgmbadinga il y a environ 4 ans
main.c | ||
---|---|---|
"$GPZDA,141914.00,01,02,2006,00,00*69",
|
||
0};
|
||
|
||
int trame_cmp(char* a,char* b){
|
||
return 0;
|
||
int trame_cmp(char* trame,char* identif){
|
||
|
||
int i,ok=0, taille=0;
|
||
while (identif[taille]!='\0') /* Determination de la taille de la chaine identif (GP...)*/
|
||
{
|
||
taille++;
|
||
}
|
||
for (i=0; i<taille; i++ )
|
||
{
|
||
if (trame[i+1]==identif[i]) /* compare les chaines de caract?res ?l?ments par ?lement */
|
||
{
|
||
ok=1; /* si ?galit? ok = 1 */
|
||
}
|
||
else
|
||
{
|
||
ok=0; /* si il sont diff?rent ok = 0 */
|
||
i=taille; /* nous permettra de sortir de la boucle on arrete la comparaison*/
|
||
}
|
||
}
|
||
return ok; /* la fonction renvois la valeur de ok */
|
||
}
|
||
|
||
/* Fonction ? modifier !!!!!*/
|
||
... | ... | |
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);
|
||
}
|
Formats disponibles : Unified diff
question 4 Implanter la fonction trame_cmp() (cf préparation).