Révision 176
Ajouté par Romain CHAMBELLON il y a environ 3 ans
branch/CHAMBELLON/sp4a12/main.c | ||
---|---|---|
"$GPZDA,141914.00,01,02,2006,00,00*69",
|
||
0};
|
||
|
||
int trame_cmp(char * trame, char * type)
|
||
{
|
||
int trame_cmp(char * trame, char * type){
|
||
|
||
int i = 0, j = 0, res = 1;
|
||
while(type[i] != '\0')
|
||
... | ... | |
}
|
||
return res;
|
||
}
|
||
int decode_int(char c)
|
||
{
|
||
|
||
int decode_int(char c){
|
||
int res;
|
||
if (c >= 48 && c <= 57)
|
||
{
|
||
... | ... | |
return res;
|
||
}
|
||
|
||
void test_decode_int(void)
|
||
{
|
||
void test_decode_int(void){
|
||
if(decode_int('0') != 0)
|
||
{
|
||
printf ("Erreur Test unitaire decode_int.\n");
|
||
... | ... | |
}
|
||
}
|
||
|
||
int decode_nombre (char * ch, int n)
|
||
{
|
||
int decode_nombre (char * ch, int n){
|
||
int i, res = 0;
|
||
for (i=0;i<n;i++)
|
||
{
|
||
... | ... | |
return res;
|
||
}
|
||
|
||
void test_decode_nombre(void)
|
||
{
|
||
void test_decode_nombre(void){
|
||
if (decode_nombre("7541",2)!=75)
|
||
{
|
||
printf("Erreur test unitaire decode_nombre.\n");
|
||
... | ... | |
}
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
{
|
||
void traitement(char * trame){
|
||
static int cpt=0;
|
||
cpt++;
|
||
if (trame_cmp(trame,"GPGGA"))
|
||
... | ... | |
test_decode_int();
|
||
}
|
||
|
||
float conv_latitude(char* lat_sx)
|
||
|
||
{
|
||
|
||
float lat_dd=0
|
||
lat_dd = decode_nombre(lat_sx,2);
|
||
lat_dd += decode_nombre(lat_sx+2,2)/60;
|
||
lat_dd += decode_nombre(lat_sx+5,4)/600000;
|
||
|
||
}
|
||
|
||
|
||
|
||
// Ne pas modifier cette fonction
|
||
int main(int argc,char ** argv)
|
Formats disponibles : Unified diff
Q8 : Création fonction conv_lat / Il faut la tester et faire son test unitaire