gpsd-dev
[Top][All Lists]
Advanced

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

[gpsd-dev] Adding new fields to JSON reports


From: Eric S. Raymond
Subject: [gpsd-dev] Adding new fields to JSON reports
Date: Wed, 1 Apr 2015 15:57:37 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

Gary E. Miller <address@hidden>:
> I have added the "precision" field to the gpsd PPS JSON output.  It
> is in this afternoon's git head of gpsd.

Maybe this needed to be done, but you left the job very incomplete.  As
a result, gpsmon is almost certain to have flaky failures.

There is a general issue here about what you have to do when adding a field
to a JSON report. There are four required steps, of which you only did one:

1. Make the daemon emit the new field.

2. Document it in gpsd_json.xml.

3. Decide whether it warrants a minor or major protocol bump.  Update
   the appropriate macros in gpsd.h-tail.  In the comment above them,
   add a brief descrotion of the change.

4. Update the JSON parse templates in libgps_json.c.  If you don't do this, 
   clients (including gpsmon) will throw an error when they trip over the
   new field.

5. The hard part: the data wants to go somewhere on the client side, but
   doing this may involve a compatibility break in the user-visible core
   structures.  You need to make a call on whether to extend them or accept 
   that the new data will be invisible untol the next structure upgrade
   and if so document that as an item in TODO.

This procedure is going into the Hacking Guide.
-- 
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>



reply via email to

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