[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-users] Flush unconsumed GPS reports in Python
From: |
Gary E. Miller |
Subject: |
Re: [gpsd-users] Flush unconsumed GPS reports in Python |
Date: |
Mon, 18 Dec 2017 13:19:25 -0800 |
Yo Alex!
On Mon, 18 Dec 2017 14:51:21 +0000
Alex <address@hidden> wrote:
> What is the recommended way of getting a fresh TPV report once a
> minute?
If it were me, everytime my process woke up, I'd read the entire queue.
Your input will be from older to newer. When you read a TPV, save it in
a buffer. Read another TPV, save it to the same buffer, overwriting the
last saved TPV.
When the input stream is empty, your most recent TPV is in the buffer.
Maybe a 5 line loop?
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
address@hidden Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can’t measure it, you can’t improve it." - Lord Kelvin
pgp7w3FGgwhxw.pgp
Description: OpenPGP digital signature