Hello everyone,
I am writing a code for a project that uses NMEA sentences received from the serial port and stored into char array. The NMEA sentences are actually ASCII character fields separated by commas. Is there an easy way to copy specific fields from the char array into a new char array ?
Here is an example of the contents of the first char array :
$GPGGA,133212.00,3557.910,N,02130.187,E,1,04,1.762,18.65,M,-35.2,M,,*48
In this example sentense i would like to copy the indocated part (bold letters) into an other char array named Lat.
$GPGGA,133212.00,3557.910,N,02130.187,E,1,04,1.762,18.65,M,-35.2,M,,*48
in this particular example case the desiered field is the 3rd one.
To complicate things more, in many occasion there may be empty fields like for example:
$GPGGA,,3557.910,N,02130.187,E,,,,18.65,M,-35.2,M,,*48
In this case now there is an empty field before the desired 3rd field.
Do i make sense ? THANKYOU