##// END OF EJS Templates
aaguilar -
r204:205
parent child
Show More
@@ -1,44 +1,44
1 /* No newline at end of file
1 /*
2 * gpgga_parse.cpp No newline at end of file
2 * gpgga_parse.cpp
3 * No newline at end of file
3 *
4 * Created on: Oct 29, 2014 No newline at end of file
4 * Created on: Oct 29, 2014
5 * Author: Alan Aguilar Sologuren No newline at end of file
5 * Author: Alan Aguilar Sologuren
6 */ No newline at end of file
6 */
7
7
No newline at end of file
8 #include "../nmea_defs.h"
8 #include "nmea_defs.h"
No newline at end of file
No newline at end of file
9 #include <string.h>
9 #include <cstring>
No newline at end of file
No newline at end of file
10 #include <stdlib.h> No newline at end of file
10 #include <cstdlib> No newline at end of file
11 No newline at end of file
11
12 int gpgga_parse(nmea_code* gga, gnss_info* info){ No newline at end of file
12 int gpgga_parse(nmea_code* gga, gnss_info* info){
13 gnss_time utc; No newline at end of file
13 gnss_time utc;
14 gnss_satinfo sati; No newline at end of file
14 gnss_satinfo sati;
15 memset((void*)&sati,0,sizeof(gnss_satinfo)); No newline at end of file
15 memset((void*)&sati,0,sizeof(gnss_satinfo));
16 char *str = gga->get_parameter(1); No newline at end of file
16 char *str = gga->get_parameter(1);
17 char h[3]{'\0'}; strncpy(h,str,2); No newline at end of file
17 char h[3]{'\0'}; strncpy(h,str,2);
18 char m[3]{'\0'}; strncpy(m,str+2,2); No newline at end of file
18 char m[3]{'\0'}; strncpy(m,str+2,2);
19 char s[3]{'\0'}; strncpy(s,str+4,2); No newline at end of file
19 char s[3]{'\0'}; strncpy(s,str+4,2);
20 char hs[4]{'\0'};strncpy(hs,str+7,3); No newline at end of file
20 char hs[4]{'\0'};strncpy(hs,str+7,3);
21 char dir; No newline at end of file
21 char dir;
22 gnss_pos coords; No newline at end of file
22 gnss_pos coords;
23 No newline at end of file
23
24 utc.hour = atoi(h); No newline at end of file
24 utc.hour = atoi(h);
25 utc.min = atoi(m); No newline at end of file
25 utc.min = atoi(m);
26 utc.sec = atoi(s); No newline at end of file
26 utc.sec = atoi(s);
27 utc.hsec = atoi(hs); No newline at end of file
27 utc.hsec = atoi(hs);
28 No newline at end of file
28
29 info->set_utc(&utc,NMEA_TIME); No newline at end of file
29 info->set_utc(&utc,NMEA_TIME);
30 No newline at end of file
30
31 dir = gga->get_parameter(3)[0]; No newline at end of file
31 dir = gga->get_parameter(3)[0];
32 str = gga->get_parameter(2); coords.lat = (dir == 'N')?atof(str):-1*atof(str); No newline at end of file
32 str = gga->get_parameter(2); coords.lat = (dir == 'N')?atof(str):-1*atof(str);
33 dir = gga->get_parameter(5)[0]; No newline at end of file
33 dir = gga->get_parameter(5)[0];
34 str = gga->get_parameter(4); coords.lon = (dir == 'E')?atof(str):-1*atof(str); No newline at end of file
34 str = gga->get_parameter(4); coords.lon = (dir == 'E')?atof(str):-1*atof(str);
35 info->set_pos(&coords); No newline at end of file
35 info->set_pos(&coords);
36 No newline at end of file
36
37 str = gga->get_parameter(6); info->set_sig(atoi(str)); No newline at end of file
37 str = gga->get_parameter(6); info->set_sig(atoi(str));
38 str = gga->get_parameter(7); sati.inview = atoi(str); No newline at end of file
38 str = gga->get_parameter(7); sati.inview = atoi(str);
39 str = gga->get_parameter(8); info->set_hdop(atof(str)); No newline at end of file
39 str = gga->get_parameter(8); info->set_hdop(atof(str));
40 str = gga->get_parameter(9); info->set_elv(atof(str)); No newline at end of file
40 str = gga->get_parameter(9); info->set_elv(atof(str));
41 No newline at end of file
41
42 info->set_smask(GPGGA); No newline at end of file
42 info->set_smask(GPGGA);
43 return 1; No newline at end of file
43 return 1;
44 } No newline at end of file
44 }
@@ -1,12 +1,12
1 /* No newline at end of file
1 /*
2 * gpgsa_parse.cpp No newline at end of file
2 * gpgsa_parse.cpp
3 * No newline at end of file
3 *
4 * Created on: Oct 29, 2014 No newline at end of file
4 * Created on: Oct 29, 2014
5 * Author: Alan Aguilar Sologuren No newline at end of file
5 * Author: Alan Aguilar Sologuren
6 */ No newline at end of file
6 */
7
7
No newline at end of file
8 #include "../nmea_defs.h" No newline at end of file
8 #include "nmea_defs.h" No newline at end of file
9 No newline at end of file
9
10 int gpgsa_parse(nmea_code*, gnss_info*){ No newline at end of file
10 int gpgsa_parse(nmea_code*, gnss_info*){
11 return 0; No newline at end of file
11 return 0;
12 } No newline at end of file
12 }
@@ -1,12 +1,12
1 /* No newline at end of file
1 /*
2 * gpgsv_parse.cpp No newline at end of file
2 * gpgsv_parse.cpp
3 * No newline at end of file
3 *
4 * Created on: Oct 29, 2014 No newline at end of file
4 * Created on: Oct 29, 2014
5 * Author: Alan Aguilar Sologuren No newline at end of file
5 * Author: Alan Aguilar Sologuren
6 */ No newline at end of file
6 */
7
7
No newline at end of file
8 #include "../nmea_defs.h" No newline at end of file
8 #include "nmea_defs.h" No newline at end of file
9 No newline at end of file
9
10 int gpgsv_parse(nmea_code*, gnss_info*){ No newline at end of file
10 int gpgsv_parse(nmea_code*, gnss_info*){
11 return 0; No newline at end of file
11 return 0;
12 } No newline at end of file
12 }
@@ -1,12 +1,12
1 /* No newline at end of file
1 /*
2 * gprmc_parse.cpp No newline at end of file
2 * gprmc_parse.cpp
3 * No newline at end of file
3 *
4 * Created on: Oct 29, 2014 No newline at end of file
4 * Created on: Oct 29, 2014
5 * Author: Alan Aguilar Sologuren No newline at end of file
5 * Author: Alan Aguilar Sologuren
6 */ No newline at end of file
6 */
7
7
No newline at end of file
8 #include "../nmea_defs.h" No newline at end of file
8 #include "nmea_defs.h" No newline at end of file
9 No newline at end of file
9
10 int gprmc_parse(nmea_code*, gnss_info*){ No newline at end of file
10 int gprmc_parse(nmea_code*, gnss_info*){
11 return 0; No newline at end of file
11 return 0;
12 } No newline at end of file
12 }
@@ -1,12 +1,12
1 /* No newline at end of file
1 /*
2 * gpvtg_parse.cpp No newline at end of file
2 * gpvtg_parse.cpp
3 * No newline at end of file
3 *
4 * Created on: Oct 29, 2014 No newline at end of file
4 * Created on: Oct 29, 2014
5 * Author: Alan Aguilar Sologuren No newline at end of file
5 * Author: Alan Aguilar Sologuren
6 */ No newline at end of file
6 */
7
7
No newline at end of file
8 #include "../nmea_defs.h" No newline at end of file
8 #include "nmea_defs.h" No newline at end of file
9 No newline at end of file
9
10 int gpvtg_parse(nmea_code*, gnss_info*){ No newline at end of file
10 int gpvtg_parse(nmea_code*, gnss_info*){
11 return 0; No newline at end of file
11 return 0;
12 } No newline at end of file
12 }
@@ -1,12 +1,12
1 /* No newline at end of file
1 /*
2 * pgrmb_parse.cpp No newline at end of file
2 * pgrmb_parse.cpp
3 * No newline at end of file
3 *
4 * Created on: Oct 29, 2014 No newline at end of file
4 * Created on: Oct 29, 2014
5 * Author: Alan Aguilar Sologuren No newline at end of file
5 * Author: Alan Aguilar Sologuren
6 */ No newline at end of file
6 */
7
7
No newline at end of file
8 #include "../nmea_defs.h" No newline at end of file
8 #include "nmea_defs.h" No newline at end of file
9 No newline at end of file
9
10 int pgrmb_parse(nmea_code*, gnss_info*){ No newline at end of file
10 int pgrmb_parse(nmea_code*, gnss_info*){
11 return 0; No newline at end of file
11 return 0;
12 } No newline at end of file
12 }
@@ -1,12 +1,12
1 /* No newline at end of file
1 /*
2 * pgrme_parse.cpp No newline at end of file
2 * pgrme_parse.cpp
3 * No newline at end of file
3 *
4 * Created on: Oct 29, 2014 No newline at end of file
4 * Created on: Oct 29, 2014
5 * Author: Alan Aguilar Sologuren No newline at end of file
5 * Author: Alan Aguilar Sologuren
6 */ No newline at end of file
6 */
7
7
No newline at end of file
8 #include "../nmea_defs.h" No newline at end of file
8 #include "nmea_defs.h" No newline at end of file
9 No newline at end of file
9
10 int pgrme_parse(nmea_code*, gnss_info*){ No newline at end of file
10 int pgrme_parse(nmea_code*, gnss_info*){
11 return 0; No newline at end of file
11 return 0;
12 } No newline at end of file
12 }
@@ -1,12 +1,12
1 /* No newline at end of file
1 /*
2 * pgrmf_parse.cpp No newline at end of file
2 * pgrmf_parse.cpp
3 * No newline at end of file
3 *
4 * Created on: Oct 29, 2014 No newline at end of file
4 * Created on: Oct 29, 2014
5 * Author: Alan Aguilar Sologuren No newline at end of file
5 * Author: Alan Aguilar Sologuren
6 */ No newline at end of file
6 */
7
7
No newline at end of file
8 #include "../nmea_defs.h" No newline at end of file
8 #include "nmea_defs.h" No newline at end of file
9 No newline at end of file
9
10 int pgrmf_parse(nmea_code*, gnss_info*){ No newline at end of file
10 int pgrmf_parse(nmea_code*, gnss_info*){
11 return 0; No newline at end of file
11 return 0;
12 } No newline at end of file
12 }
@@ -1,12 +1,12
1 /* No newline at end of file
1 /*
2 * pgrmm_parse.cpp No newline at end of file
2 * pgrmm_parse.cpp
3 * No newline at end of file
3 *
4 * Created on: Oct 29, 2014 No newline at end of file
4 * Created on: Oct 29, 2014
5 * Author: Alan Aguilar Sologuren No newline at end of file
5 * Author: Alan Aguilar Sologuren
6 */ No newline at end of file
6 */
7
7
No newline at end of file
8 #include "../nmea_defs.h" No newline at end of file
8 #include "nmea_defs.h" No newline at end of file
9 No newline at end of file
9
10 int pgrmm_parse(nmea_code*, gnss_info*){ No newline at end of file
10 int pgrmm_parse(nmea_code*, gnss_info*){
11 return 0; No newline at end of file
11 return 0;
12 } No newline at end of file
12 }
@@ -1,12 +1,12
1 /* No newline at end of file
1 /*
2 * pgrmt_parse.cpp No newline at end of file
2 * pgrmt_parse.cpp
3 * No newline at end of file
3 *
4 * Created on: Oct 29, 2014 No newline at end of file
4 * Created on: Oct 29, 2014
5 * Author: Alan Aguilar Sologuren No newline at end of file
5 * Author: Alan Aguilar Sologuren
6 */ No newline at end of file
6 */
7
7
No newline at end of file
8 #include "../nmea_defs.h" No newline at end of file
8 #include "nmea_defs.h" No newline at end of file
9 No newline at end of file
9
10 int pgrmt_parse(nmea_code*, gnss_info*){ No newline at end of file
10 int pgrmt_parse(nmea_code*, gnss_info*){
11 return 0; No newline at end of file
11 return 0;
12 } No newline at end of file
12 }
@@ -1,12 +1,12
1 /* No newline at end of file
1 /*
2 * pgrmv_parse.cpp No newline at end of file
2 * pgrmv_parse.cpp
3 * No newline at end of file
3 *
4 * Created on: Oct 29, 2014 No newline at end of file
4 * Created on: Oct 29, 2014
5 * Author: Alan Aguilar Sologuren No newline at end of file
5 * Author: Alan Aguilar Sologuren
6 */ No newline at end of file
6 */
7
7
No newline at end of file
8 #include "../nmea_defs.h" No newline at end of file
8 #include "nmea_defs.h" No newline at end of file
9 No newline at end of file
9
10 int pgrmv_parse(nmea_code*, gnss_info*){ No newline at end of file
10 int pgrmv_parse(nmea_code*, gnss_info*){
11 return 0; No newline at end of file
11 return 0;
12 } No newline at end of file
12 }
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now