Révision 8
Ajouté par gasacco il y a environ 4 ans
branch/sacco/sp4a12/main.c | ||
---|---|---|
"$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39",
|
||
"$GPVTG,99.4,T,,M,0.4,N,0.7,K*57",
|
||
"$GPZDA,141914.00,01,02,2006,00,00*69",
|
||
0};
|
||
0};
|
||
|
||
|
||
int decode_int(char c)
|
||
{
|
||
unsigned int ValDecimale;
|
||
ValDecimale = c-48;
|
||
if (ValDecimale>9 || ValDecimale<0)
|
||
{
|
||
return -1;
|
||
}
|
||
else
|
||
{
|
||
return ValDecimale;
|
||
}
|
||
}
|
||
|
||
|
||
int trame_cmp(char* a,char* b){
|
||
return 0;
|
||
int i =0;
|
||
while (b[i]!='\0')
|
||
{
|
||
int c = a[i+1];
|
||
int d = b[i];
|
||
if (c!=d)
|
||
{
|
||
return 0;
|
||
}
|
||
i=i+1;
|
||
}
|
||
return 1;
|
||
}
|
||
|
||
|
||
|
||
/*float ConversionSexaDec(float coord)
|
||
{
|
||
int Entiere = coord/100;
|
||
float Decimale = (float) coord - Entiere*100;
|
||
float Conversion = Entiere + Decimale/60
|
||
return Conversion;
|
||
}*/
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
{
|
||
printf ("> %s\n",trame);
|
||
{
|
||
static int cpt =0;
|
||
if (trame_cmp(trame, "GPGGA")==1)
|
||
{
|
||
printf("%s", trame);
|
||
}
|
||
cpt++;
|
||
}
|
||
|
||
//Ajouter vos tests unitaires dans cette fonction.
|
||
... | ... | |
int main(int argc,char ** argv)
|
||
{
|
||
|
||
tests_unitaires();
|
||
// tests_unitaires();
|
||
|
||
// Affichage des trames definies dans la table trames.
|
||
printf ("Trames de tests tableau trames:\n");
|
Formats disponibles : Unified diff
Vérification incrémentation compteur Sacco