Skip to content

Commit

Permalink
Update nmea.c
Browse files Browse the repository at this point in the history
  • Loading branch information
pawar4 authored Apr 18, 2021
1 parent 3531288 commit f6aeb91
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions microcontroller/blink/src/nmea.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,17 @@ void USART2_IRQHandler(){

char * createGPSmsg(){
memset(gps_msg_to_send, '\0', 54);
char lat_dir[4] = {',', parsed_message -> rmc -> lat_direction, ',', '\0'};
char long_dir[4] = {',', parsed_message -> rmc -> long_direction, '\0'};
memset(gps_msg_to_send, '\0', 54);
strcat(gps_msg_to_send, parsed_message -> rmc -> latitude);
strcat(gps_msg_to_send, lat_dir);
strcat(gps_msg_to_send, parsed_message -> rmc -> longitude);
strcat(gps_msg_to_send, long_dir);
if(parsed_message -> valid == 'A'){
char lat_dir[4] = {',', parsed_message -> rmc -> lat_direction, ',', '\0'};
char long_dir[4] = {',', parsed_message -> rmc -> long_direction, '\0'};
memset(gps_msg_to_send, '\0', 54);
strcat(gps_msg_to_send, parsed_message -> rmc -> latitude);
strcat(gps_msg_to_send, lat_dir);
strcat(gps_msg_to_send, parsed_message -> rmc -> longitude);
strcat(gps_msg_to_send, long_dir);
}
else{
strcat(gps_msg_to_send, "Location Unavailable");
}
return gps_msg_to_send;
}

0 comments on commit f6aeb91

Please sign in to comment.