Révision 642
Ajouté par malameynar il y a presque 4 ans
main.c | ||
---|---|---|
}
|
||
return (lon);
|
||
}
|
||
long lon_vf(char * ch){
|
||
long lon_int(char * ch){
|
||
long deg;
|
||
long min;
|
||
long lon=0;
|
||
... | ... | |
return (lat);
|
||
}
|
||
|
||
long lat_vf(char * ch){
|
||
long lat_int(char * ch){
|
||
long deg;
|
||
long min;
|
||
long lat=0;
|
||
deg=decode_nombre(ch,2);
|
||
min=(decode_nombre(ch,9)-deg*1000000);
|
||
lon=deg*46603+min*777;
|
||
min=(decode_nombre(ch,8)-deg*1000000);
|
||
lat=deg*46603+min*777;
|
||
if((ch[8]=='S')){
|
||
lat=-lat;
|
||
}
|
||
return (lon);
|
||
return (lat);
|
||
}
|
||
|
||
float lat_long(char* ch){
|
||
... | ... | |
}
|
||
}
|
||
test_lon_float(void){
|
||
char longi[]="003066036E";
|
||
char longi[]="180000000E";
|
||
printf("longitude\n%f\n",lon_float(&longi));
|
||
printf("longitude\n%d\n",lon_int(&longi));
|
||
}
|
||
test_lat_float(void){
|
||
char lati[]="37232475S";
|
||
char lati[]="90000000S";
|
||
printf("latitude\n%f\n",lat_float(&lati));
|
||
printf("latitude\n%d\n",lat_int(&lati));
|
||
}
|
||
//test_lon_int
|
||
|
||
decode_trame(char *chi,char *lon,char *lat,int *ok){
|
||
void decode_trame(char *chi,char *lon,char *lat,int *ok){
|
||
char ref[]="GPGGA";
|
||
int i=17;
|
||
int j=0;
|
||
... | ... | |
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
/* test_decode_int();
|
||
test_decode_nombre();
|
||
// test_decode_int();
|
||
// test_decode_nombre();
|
||
test_lon_float();
|
||
test_lat_float();
|
||
test_lat_long();
|
||
test_decode_trame();*/
|
||
// test_lat_long();
|
||
// test_decode_trame();*/
|
||
}
|
||
|
||
void test_decode_int(void){
|
Formats disponibles : Unified diff
fonction entière et gestion clavier