Révision 283
Ajouté par Hatim EL MAADI il y a environ 3 ans
branch/ELMAADI/sp4a12/main.c | ||
---|---|---|
#include "trame.h"
|
||
#include <math.h>
|
||
|
||
//Trames de tests ? modifier si n?cessaire.
|
||
/*Trames de tests ? modifier si n?cessaire.*/
|
||
char * trames[]= {"$GPGSV,3,2,10,15,03,077,,18,04,041,42,19,85,271,,20,08,214,*7C",
|
||
"$GPGSV,3,3,10,22,39,053,50,28,15,320,*7E",
|
||
"$GPRMC,141914.00,A,4545.6424,N,00306.6036,E,0.4,99.4,010206,,*0C",
|
||
... | ... | |
min2=(float)decode_nombre(&ch[0+5],4);
|
||
result=degre+(min1/60)+(min2/600000);
|
||
return result;
|
||
|
||
}
|
||
//Fonction ? modifier !!!!!
|
||
}
|
||
|
||
/*Fonction ? modifier !!!!!*/
|
||
void traitement(char * trame)
|
||
{
|
||
static int cpt=0;
|
||
... | ... | |
|
||
}
|
||
|
||
//Ajouter vos tests unitaires dans cette fonction.
|
||
/*Ajouter vos tests unitaires dans cette fonction.*/
|
||
void tests_unitaires(void){
|
||
if (5!=5)
|
||
{
|
||
... | ... | |
printf ("Erreur Test unitaire decode_nombre.\n");
|
||
exit(-1);
|
||
}
|
||
if ((latitude("3723.2475")-37,387458)>0.0001)
|
||
|
||
if (latitude("3723.2475")-37.387458>0.0001)
|
||
{
|
||
printf ("Erreur Test unitaire latitude.\n");
|
||
exit(-1);
|
||
|
||
}
|
||
|
||
}
|
||
|
||
// Ne pas modifier cette fonction
|
||
/* Ne pas modifier cette fonction*/
|
||
int main(int argc,char ** argv)
|
||
{
|
||
|
||
tests_unitaires();
|
||
|
||
// Affichage des trames definies dans la table trames.
|
||
/* Affichage des trames definies dans la table trames.*/
|
||
printf ("Trames de tests tableau trames:\n");
|
||
int i=0;
|
||
while (trames[i])
|
||
... | ... | |
|
||
if (!trame_init())
|
||
exit(-1);
|
||
// Affichage des trames du fichier gps.log
|
||
/* Affichage des trames du fichier gps.log*/
|
||
char *trame;
|
||
printf ("Trames de tests du fichier gps.log\n");
|
||
while ((trame = trame_suivante()))
|
Formats disponibles : Unified diff
Implantation de la fonction de conversion de latitude, avec test.