Révision 145
Ajouté par Pape Demba AMAR il y a environ 3 ans
branch/AMAR/sp4a12/main.c | ||
---|---|---|
int trame_cmp(char*trame,char*type)
|
||
|
||
{
|
||
int i=0 , j=0, res=0;
|
||
while(type[i]!='\0')
|
||
int i=0 , j=0, res=1; //initialisation des valeurs
|
||
while(type[i]!='\0') //tant que treme n'a pas attent sa fin de caract?re
|
||
{
|
||
i++;
|
||
}
|
||
while(j<1)
|
||
while(j<i)
|
||
{
|
||
if(trame[j+1]!=type[j])
|
||
{
|
||
... | ... | |
void traitement(char * trame)
|
||
{
|
||
static int cpt=0;
|
||
cpt++ ;
|
||
printf ("> %s\n",trame);
|
||
cpt++ ;
|
||
if(trame_cmp(trame,"GPGGA"))
|
||
printf ("> %s\n",trame);
|
||
}
|
||
|
||
//Ajouter vos tests unitaires dans cette fonction.
|
||
void tests_unitaires(void){
|
||
if (5!=5){
|
||
printf ("Erreur Test unitaire basique.\n");
|
||
void tests_unitaires(void){
|
||
if (5!=5){
|
||
printf ("Erreur Test unitaire basique.\n");
|
||
exit(-1);
|
||
}
|
||
if (trame_cmp("$GPGGA suite chaine","GPGGA")!=1){
|
||
printf ("Erreur Test unitaire trame_cmp 1.\n");
|
||
exit(-1);
|
||
}
|
||
if (trame_cmp("$GPRMC suite chaine","GPGGA")!=0){
|
||
printf ("Erreur Test unitaire trame_cmp 2.\n");
|
||
exit(-1);
|
||
}
|
||
if (trame_cmp("$GPRMC... ", "GPRMC" )!=1){
|
||
printf ("Erreur Test unitaire trame_cmp 3.\n");
|
||
exit(-1);
|
||
}
|
||
if (trame_cmp("$APRMC...", "GPGGA")!=0){
|
||
printf ("Erreur Test unitaire trame_cmp4.\n");
|
||
exit(-1);
|
||
}
|
||
/*if (trame_cmp("$GPGGA suite chaine","GPGGA")!=1){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");https://forge.uca.fr/svn/https-forge-uca-fr-svn-polytech-ge-sp4abc-2022/branch/AMAR
|
||
exit(-1);
|
||
}*/
|
||
}
|
||
|
||
// Ne pas modifier cette fonction
|
Formats disponibles : Unified diff
afficher que les trames GPGGA