gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] Where to apply scaling


From: Christian Gagneraud
Subject: Re: [gpsd-dev] Where to apply scaling
Date: Fri, 25 May 2012 11:08:08 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120421 Thunderbird/12.0

Hi Eric,

On 24/05/12 21:49, Eric S. Raymond wrote:
Christian Gagneraud<address@hidden>:
Currently in driver_ais.c an offset is applied for certain message
fields (IMO 236 and IMO289 met/hydro message), and a scaling is done
conditionally in gpsd_json.c.
I think it would be better to apply the offset and the scaling in
gpsd_json.c. Do you have any objection on doing this?

Unfortunately, I thought of an objection. The shm interface.

Because some clients will be reading the AIS report structures
directly from the daemon via shared memory, all *lossless* preparation
of the data (in particular, offset applications) should be done in the
device driver.  This will reduce the number of magic constants that
client software has to know about.

Interpreting the AIS structures requires already lot of foreknowledge, there's plenty of enum values and magic constant (data not available).
Enums are not part of the API, but the NOT_AVAILABLE are (def'ed in gps.h).

What about moving these 6 offset constants in gps.h beside their XXX_NOT_AVAILABLE? (FID31 needs only 1 constant not 5. I have one commit here for FID31 fixes). And while we are here, why not adding the scaling factors as well? This way, clients will have all the information to go from raw to interpreted data.

Another consequence of doing the offset in the driver is that the gpsd' version of the NOT_AVAILABLE values are different from the IMO standards (and from the ones documented in AIVDM.txt)

Regards,
Chris


Lossy transformations (scaling) should continue to be done optionally
in gpsd_json.c.


--
Christian Gagneraud,
Embedded systems engineer.
Techworks Marine
1 Harbour road
Dun Laoghaire
Co. Dublin
Ireland
Tel: + 353 (0) 1 236 5990
Web: http://www.techworks.ie/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]