gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] AIS JSON inconsistencies


From: Jon Schlueter
Subject: Re: [gpsd-dev] AIS JSON inconsistencies
Date: Fri, 2 Oct 2015 21:38:48 -0400

Stefan,

do you have any sample data that exercises this code? I'd like to make sure our regression test suite covers this case and it currently appears it might not.

Jon

On Fri, Oct 2, 2015 at 7:18 AM, Jon Schlueter <address@hidden> wrote:
good catch and this will require a rebuild of test data!

Jon

On Fri, Oct 2, 2015 at 3:18 AM, Stefan Roels <address@hidden> wrote:
Dear all,

I found some inconsistencies in the JSON output. In some cases the line termination is \t\n instead of \r\n.

You can find a patch below.

Best regards,
Stefan Roels

diff --git a/gpsd_json.c b/gpsd_json.c
index 22c9f3d..6641846 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -1902,7 +1902,7 @@ void json_aivdm_dump(const struct ais_t *ais,
                break;
            case 16:    /* IMO236 - Number of persons on board */
                str_appendf(buf, buflen,
-                              "\"persons\":%u}\t\n", ais->type6.dac1fid16.persons);
+                              "\"persons\":%u}\r\n", ais->type6.dac1fid16.persons);
                break;
            case 18:    /* IMO289 - Clearance time to enter port */
                str_appendf(buf, buflen,
@@ -2296,7 +2296,7 @@ void json_aivdm_dump(const struct ais_t *ais,
                break;
            case 16:    /* IMO289 - Number of persons on board */
                str_appendf(buf, buflen,
-                              "\"persons\":%u}\t\n", ais->type6.dac1fid16.persons);
+                              "\"persons\":%u}\r\n", ais->type6.dac1fid16.persons);
                break;
            case 17:        /* IMO289 - VTS-generated/synthetic targets */
                (void)strlcat(buf, "\"targets\":[", buflen);





reply via email to

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