[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-users] AIVDM sentence buffering
From: |
Jonathan Fewtrell |
Subject: |
Re: [gpsd-users] AIVDM sentence buffering |
Date: |
Tue, 28 Feb 2012 16:23:57 +0800 |
Thanks for this.
The situation I have in mind is one where signals are being received from
numerous vessels at the same time. In such a case, there could very well be
more than one signal of a given type (particularly types 1/2/3 and 5) received
within 2 seconds. My concern is that (say) a type 1 signal from Vessel B could
shadow a type 1 signal from Vessel A received a fraction of a second earlier.
Furthermore, if their transponders are reliably sending signals at a steady
frequency, this shadowing could continue for some time, meaning that Vessel A
might never be detected.
Is this a valid concern, or have I misunderstood?
For info, I am testing in Hong Kong. I consume reports every 1.5s and I
regularly see more than 100 simultaneous live targets. Admittedly this is an
extreme case, HK being perhaps the busiest port in the world, but arguably this
is when AIS ought to be most valuable.
On 26 Feb 2012, at 15:24, Eric S. Raymond wrote:
> Jonathan Fewtrell <address@hidden>:
>> Reading the documentation (http://catb.org/gpsd/client-howto.html
>> and http://catb.org/gpsd/libgps.html), I am worried that if a read
>> picks up multiple AIVDM sentences only the most recent one will be
>> reflected in the ais_t struct.
>
> Yes, this is a potential failure mode. To avoid it, just consume
> reports from the demon more often than once per 2 seconds. That
> way the read buffer will never contain both a message and a later
> message of the same type that steps on it.
>
> I'll add this advice to the client HOWTO.
> --
> <a href="http://www.catb.org/~esr/">Eric S. Raymond</a>