I tried commenting sleep(1) , but no data I am able to see.
When I again kept delay for 1second. I am able to see some data around 5 to 6 times only. After that it Stops at " No GPS data available ".
On Sep 15, 2015 11:13 PM, "Gary E. Miller" <
address@hidden> wrote:
Yo lokesh!
On Tue, 15 Sep 2015 22:59:32 +0530
lokesh kumar Nijalinge <address@hidden> wrote:
> So I need to wait very less.
> Mean to say the statement " if (gps_waiting (&gpsdata, 2000))"
> should be changed something to " if (gps_waiting (&gpsdata, 2))".
No. That is fine. gps_waiting() returns when there is data available.
As the doc clearly says:
"gps_waiting() can be used to check whether there is new data from
the daemon. The second argument is the maximum amount of time to
wait (in microseconds) on input before returning. It returns true
if there is input waiting, false on timeout (no data waiting) or
error condition."
So 2000 is the MAX time to wait, which is fine.
> Am I right with above statement?
No. The problem is the uninterruptible sleep(1). Which is why that
is the part of the code I highlighted.
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
address@hidden Tel:+1(541)382-8588