GPS working with LoRa code - can't transmit faster that once every 6 seconds
Dependencies: mbed LoRaWAN-lib_gps_lora SingleFrequencyLora
Diff: l86.cpp
- Revision:
- 6:670ff1507ff4
- Parent:
- 5:850a9db98a41
- Child:
- 7:1c90f51096fe
diff -r 850a9db98a41 -r 670ff1507ff4 l86.cpp --- a/l86.cpp Sun Nov 12 23:34:19 2017 +0000 +++ b/l86.cpp Mon Nov 13 15:44:11 2017 +0000 @@ -1,17 +1,18 @@ #include "l86.hpp" #include <string.h> +#include <stdio.h> -void Parse_RMC_data(RMC_data RMC_data_parse){ +void Parse_RMC_data(RMC_data *RMC_data_parse){ //Local Variables char RMC_message_copy[MAX_NMEA_LENGTH] = ""; const char delimeter[2] = ","; char *token = ""; int i = 0; - char temp[11][12]; /* [11][12]: 11 strings, of length 12 */ + char temp[13][12]; /* [13][12]: 13 strings, of length 12 */ //Copy original RMC sentence to a copy in order to not destroy message - strcpy(RMC_message_copy,RMC_data_parse.Message); + strcpy(RMC_message_copy,RMC_data_parse->Message); //Seperated Message /* get the first token */ @@ -25,16 +26,20 @@ token = strtok(NULL, delimeter); } - //Copy the message into its individual components - strcpy(RMC_data_parse.Message_ID,temp[0]); - strcpy(RMC_data_parse.UTC_Time,temp[1]); - strcpy(RMC_data_parse.Status,temp[2]); - strcpy(RMC_data_parse.Latitude,temp[3]); - strcpy(RMC_data_parse.N_S_Indicator,temp[4]); - strcpy(RMC_data_parse.Longitude,temp[5]); - strcpy(RMC_data_parse.E_W_Indicator,temp[6]); - strcpy(RMC_data_parse.Speed_Over_Ground,temp[7]); - strcpy(RMC_data_parse.Course_Over_Ground,temp[8]); - strcpy(RMC_data_parse.Date,temp[9]); - strcpy(RMC_data_parse.Mode,temp[10]); -} \ No newline at end of file + //Copy the message into its individual components + strcpy(RMC_data_parse->Message_ID,temp[0]); + strcpy(RMC_data_parse->UTC_Time,temp[1]); + strcpy(RMC_data_parse->Status,temp[2]); + strcpy(RMC_data_parse->Latitude,temp[3]); + strcpy(RMC_data_parse->N_S_Indicator,temp[4]); + strcpy(RMC_data_parse->Longitude,temp[5]); + strcpy(RMC_data_parse->E_W_Indicator,temp[6]); + strcpy(RMC_data_parse->Speed_Over_Ground,temp[7]); + strcpy(RMC_data_parse->Course_Over_Ground,temp[8]); + strcpy(RMC_data_parse->Date,temp[9]); + strcpy(RMC_data_parse->Magnetic_Variation,temp[10]); + strcpy(RMC_data_parse->Magnetic_E_W_Indicator,temp[11]); + strcpy(RMC_data_parse->Mode,temp[12]); +} + +// Used GPS data pares function? // parses into data formats that will be sent over LoRa? \ No newline at end of file