LoRa send is causing hang-up when a gps fix is acquired

Dependencies:   mbed LoRaWAN-lib_publishing_testing_UART_bug SingleFrequencyLora

Fork of simple-demo-76_revised_20171113_copy by Rishin Amin

Revision:
14:539ef77197e0
Parent:
12:dc90bd3ac7d8
diff -r 9f1dd1497e9a -r 539ef77197e0 app/l86.cpp
--- a/app/l86.cpp	Mon Dec 04 14:48:01 2017 +0000
+++ b/app/l86.cpp	Mon Dec 04 21:25:19 2017 +0000
@@ -33,16 +33,16 @@
     strcpy(RMC_parsed.Message_ID,temp[0]);
     strcpy(RMC_parsed.UTC_Time,temp[1]);
     strcpy(RMC_parsed.Status,temp[2]);
-    //if(strcmp(RMC_parsed.Status,"A") == 0){
+    if(strcmp(RMC_parsed.Status,"A") == 0){
         strcpy(RMC_parsed.Latitude,temp[3]);
         strcpy(RMC_parsed.N_S_Indicator,temp[4]);
         strcpy(RMC_parsed.Longitude,temp[5]);
         strcpy(RMC_parsed.E_W_Indicator,temp[6]);
         strcpy(RMC_parsed.Speed_Over_Ground,temp[7]);
         strcpy(RMC_parsed.Course_Over_Ground,temp[8]);
-        //strcpy(RMC_parsed.Date,temp[9]);
+        strcpy(RMC_parsed.Date,temp[9]);
         strcpy(RMC_parsed.Mode,temp[10]);
-    //}
+    }
     return RMC_parsed;
 }
 
@@ -68,8 +68,8 @@
 /* Parse RMC_data struct into GPS data struct ready for sending over LoRa */
 GPS_data Parse_RMC_data(RMC_data RMC_parsed){
     GPS_data GPS_parsed;
-    char tempLat[11];
-    char tempLong[12];
+    char tempLat[11]="0";
+    char tempLong[12]="0";
     if(strcmp(RMC_parsed.Status,"A") == 0){
         strcpy(GPS_parsed.UTC_Time,RMC_parsed.UTC_Time);
         if (strcmp(RMC_parsed.N_S_Indicator, "N") == 0){
@@ -90,7 +90,7 @@
         strcpy(GPS_parsed.Longitude, tempLong);
         strcpy(GPS_parsed.Speed_Over_Ground,RMC_parsed.Speed_Over_Ground);
         strcpy(GPS_parsed.Course_Over_Ground,RMC_parsed.Course_Over_Ground);
-        //strcpy(GPS_parsed.Date,RMC_parsed.Date);
+        strcpy(GPS_parsed.Date,RMC_parsed.Date);
         strcpy(GPS_parsed.Valid,RMC_parsed.Status);
     }
     else {
@@ -99,7 +99,7 @@
         strcpy(GPS_parsed.Longitude,"+00000.0000");
         strcpy(GPS_parsed.Speed_Over_Ground,"0.00");
         strcpy(GPS_parsed.Course_Over_Ground,"000.00");
-        //strcpy(GPS_parsed.Date,RMC_parsed.Date);
+        strcpy(GPS_parsed.Date,"000000");
         strcpy(GPS_parsed.Valid,RMC_parsed.Status);
     }
     return GPS_parsed;
@@ -113,6 +113,6 @@
     pc2.printf("Longitude: %s\r\n",GPS_data_print.Longitude);
     pc2.printf("Speed: %s\r\n",GPS_data_print.Speed_Over_Ground);
     pc2.printf("Course: %s\r\n",GPS_data_print.Course_Over_Ground);
-    //pc2.printf("Date: %s\r\n",GPS_data_print.Date);
+    pc2.printf("Date: %s\r\n",GPS_data_print.Date);
 }