If you are asking a question, please follow this template:
My goal is: To obtain clean GPGGA string from GPS
My actions are: I sent AT commands using Teraterm, each command is runing successfully with OK reply and finally getting clean GPGGA string. But whenever I am trying to perform the same using PPPoS, I am getting GPGGA string with random garbage value. I am using the modem which has both GPS and GSM integrated in it. PPPoS commands for connecting to net are working fine. I am able to connect to net easily.
The result I see is: I am seeing commands getting timed out sometimes and whenever getting the GPGGA string its getting correupted with other garbage values.
It seems data.p is not handled well in the library.Sometimes half string can only be seen. I also tried doing %.*s for specific part of string but its not working
https://drive.google.com/open?id=1ttRNHSwdIWYz8I9299K1T0ndavVRvEkv
Now the ok status always remains false , it is true only for first command that has been executed.
If I remove the if(!ok) loop then I am getting something at UART as I have uploded LOG in above image. Whenever I try to use %.*s nothing gets printed in LOG, it seems it is updating data.len value to zero after some iterations. AT+CGPS=1 command that our modem supports return OK only for the first time, from second time onward it returns ERROR . Even if we dont give any command MODEM returns GPGGA string at the UART.
First image of the Serial Console that I uploaded was obtained when I removed if (!ok) return false, statement and in log I printed value of string data.p, garbage values were stored in that data.p
Thank you again for your support. I am able to find out command that gives GPS values whenever it is given command AT+CGPSINFO. In order to turn this ON , AT+CGPS=1 needs to be sent once. This time I am facing different issue now, net is getting disconnected and ATE0 command is getting timed out after some duration.