Révision 260
Ajouté par Henri JOUANNY il y a environ 3 ans
main.c | ||
---|---|---|
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
{
|
||
printf ("> %s\n",trame);
|
||
static int cpt=0;
|
||
cpt++;
|
||
{
|
||
static int cpt=0;
|
||
if (trame_cmp(trame, "GPGGA")==1)
|
||
{
|
||
printf("> %s\n", trame);
|
||
cpt++;
|
||
}
|
||
}
|
||
|
||
//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")==0)
|
||
{
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
if (trame_cmp("$GPRMC suite chaine","GPGGA")!=0){
|
||
if (trame_cmp("$GPRMC suite chaine","GPGGA")==1){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
if (trame_cmp("$GPRMC... ", "GPRMC" )!=1){
|
||
if (trame_cmp("$GPRMC... ", "GPRMC" )==0){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
if (trame_cmp("$APRMC...", "GPGGA")!=0){
|
||
if (trame_cmp("$APRMC...", "GPGGA")==0){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
}*/
|
||
}
|
||
|
||
int trame_cmp(char *trame, char *type)
|
||
... | ... | |
|
||
for (i=0;i<5;i++)
|
||
{
|
||
if (trame[i+1]==type[i])
|
||
if (trame[i+1]!=type[i])
|
||
{
|
||
b=1;
|
||
}
|
||
else
|
||
{
|
||
b=0;
|
||
}
|
||
}
|
Formats disponibles : Unified diff
affichage des trames commençant par GPGGA