Révision 28
Ajouté par abseck1 il y a environ 4 ans
branch/aseck/sp4a12/main.c | ||
---|---|---|
#include <stdio.h>
|
||
#include <stdlib.h>
|
||
#include <strings.h>
|
||
#include "trame.h"
|
||
#include "trame.h"
|
||
|
||
typedef struct
|
||
{
|
||
float latitude;
|
||
float longitude;
|
||
} position;
|
||
|
||
|
||
|
||
//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",
|
||
... | ... | |
"$GPZDA,141914.00,01,02,2006,00,00*69",
|
||
0};
|
||
|
||
position test_position;
|
||
position pos1;
|
||
position pos2;
|
||
|
||
int trame_cmp(char* a,char* b){
|
||
if (!strncmp(trame+1,type,strlen(type)))
|
||
return 1;
|
||
return 0;
|
||
int i;
|
||
for (i=0; i<strlen(type); i++)
|
||
{
|
||
if (trame[i+1] != type[i])
|
||
return 0;
|
||
}
|
||
return 1;
|
||
}
|
||
|
||
|
||
int decode_nombre(char * ch, int n)
|
||
{
|
||
int i;
|
||
int somme=0;
|
||
for (i=0;i<n;i++)
|
||
{
|
||
somme=(somme*10) + decode_int(ch[i]);
|
||
}
|
||
return somme;
|
||
|
||
}float conversion_longitude(char * longi)
|
||
{
|
||
float result_convers,val_deci;
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
{
|
||
{
|
||
static int cpt=0;
|
||
cpt++;
|
||
if(trame_cmp(trame,"GPGGA"))
|
||
printf ("> %s\n",trame);
|
||
}
|
||
|
Formats disponibles : Unified diff
Code séance 1