diff options
-rw-r--r-- | driver_aivdm.c | 2 | ||||
-rw-r--r-- | driver_rtcm2.c | 2 | ||||
-rw-r--r-- | rtcm2_json.c | 4 | ||||
-rw-r--r-- | test/synthetic-rtcm2.json | 2 | ||||
-rw-r--r-- | www/AIVDM.txt | 38 |
5 files changed, 24 insertions, 24 deletions
diff --git a/driver_aivdm.c b/driver_aivdm.c index fb3164a6..7eeac790 100644 --- a/driver_aivdm.c +++ b/driver_aivdm.c @@ -688,7 +688,7 @@ void aivdm_dump(struct ais_t *ais, bool scaled, bool json, char *buf, size_t buf #define NAVAIDTYPE_DISPLAY(n) (((n) < (sizeof(navaid_type_legends)/sizeof(navaid_type_legends[0]))) ? navaid_type_legends[n] : "INVALID NAVAID TYPE") if (json) - (void)snprintf(buf, buflen, "{\"class\":\"AIS\",\"msgtype\":%u,\"repeat\":%u,\"mmsi\":\"%09u\",", ais->msgtype, ais->repeat, ais->mmsi); + (void)snprintf(buf, buflen, "{\"class\":\"AIS\",\"type\":%u,\"repeat\":%u,\"mmsi\":\"%09u\",", ais->msgtype, ais->repeat, ais->mmsi); else (void)snprintf(buf, buflen, "%u,%u,%09u,", ais->msgtype, ais->repeat, ais->mmsi); /*@ -formatconst @*/ diff --git a/driver_rtcm2.c b/driver_rtcm2.c index 8b26b9c8..43d75977 100644 --- a/driver_rtcm2.c +++ b/driver_rtcm2.c @@ -647,7 +647,7 @@ void rtcm2_json_dump(struct rtcm2_t *rtcm, /*@out@*/char buf[], size_t buflen) for (n = 0; n < rtcm->almanac.nentries; n++) { struct station_t *ssp = &rtcm->almanac.station[n]; (void)snprintf(buf + strlen(buf), buflen - strlen(buf), - "{\"latitude\":%.4f,\"longitude\":%.4f,\"range\":%u,\"frequency\":%.1f,\"health\":%u,\"station_id\":%u,\"bitrate\":%u},", + "{\"lat\":%.4f,\"lon\":%.4f,\"range\":%u,\"frequency\":%.1f,\"health\":%u,\"station_id\":%u,\"bitrate\":%u},", ssp->latitude, ssp->longitude, ssp->range, diff --git a/rtcm2_json.c b/rtcm2_json.c index 878fc024..7f38e519 100644 --- a/rtcm2_json.c +++ b/rtcm2_json.c @@ -122,8 +122,8 @@ int json_rtcm2_read(const char *buf, }; const struct json_attr_t rtcm7_satellite[] = { - {"latitude", real, STRUCTOBJECT(struct station_t, latitude)}, - {"longitude", real, STRUCTOBJECT(struct station_t, longitude)}, + {"lat", real, STRUCTOBJECT(struct station_t, latitude)}, + {"lon", real, STRUCTOBJECT(struct station_t, longitude)}, {"range", uinteger, STRUCTOBJECT(struct station_t, range)}, {"frequency", real, STRUCTOBJECT(struct station_t, frequency)}, {"health", uinteger, STRUCTOBJECT(struct station_t, health)}, diff --git a/test/synthetic-rtcm2.json b/test/synthetic-rtcm2.json index 014b918d..195d8712 100644 --- a/test/synthetic-rtcm2.json +++ b/test/synthetic-rtcm2.json @@ -5,6 +5,6 @@ {"class":"RTCM2","type":4,"station_id":268,"zcount":252.6,"seqnum":3,"length":4,"station_health":0,"system":"GPS","sense":1,"datum":WGS84","dx":25.6,"dy":30.1,"dz":32.7} {"class":"RTCM2","type":5,"station_id":268,"zcount":253.8,"seqnum":4,"length":4,"station_health":0,"satellites":[{"ident":29,"iodl":false,"health":0,"snr":53,"health_en":false,"new_data":true,"los_warning":false,"tou":0},{"ident":12,"iodl":false,"health":0,"snr":26,"health_en":false,"new_data":false,"los_warning":true,"tou":0},{"ident":3,"iodl":false,"health":0,"snr":50,"health_en":false,"new_data":true,"los_warning":false,"tou":0},{"ident":15,"iodl":false,"health":0,"snr":41,"health_en":false,"new_data":false,"los_warning":true,"tou":0}]} {"class":"RTCM2","type":6,"station_id":268,"zcount":255.0,"seqnum":5,"length":0,"station_health":0} -{"class":"RTCM2","type":7,"station_id":268,"zcount":256.8,"seqnum":6,"length":12,"station_health":0,"satellites":[{"latitude":38.8379,"longitude":-121.3532,"range":250,"frequency":313.2,"health":0,"station_id":764,"bitrate":200},{"latitude":39.4229,"longitude":-121.6059,"range":402,"frequency":317.2,"health":0,"station_id":878,"bitrate":100},{"latitude":37.1789,"longitude":-122.3804,"range":333,"frequency":291.3,"health":0,"station_id":883,"bitrate":100},{"latitude":40.4337,"longitude":-124.4020,"range":333,"frequency":290.1,"health":0,"station_id":885,"bitrate":100}]} +{"class":"RTCM2","type":7,"station_id":268,"zcount":256.8,"seqnum":6,"length":12,"station_health":0,"satellites":[{"lat":38.8379,"lon":-121.3532,"range":250,"frequency":313.2,"health":0,"station_id":764,"bitrate":200},{"lat":39.4229,"lon":-121.6059,"range":402,"frequency":317.2,"health":0,"station_id":878,"bitrate":100},{"lat":37.1789,"lon":-122.3804,"range":333,"frequency":291.3,"health":0,"station_id":883,"bitrate":100},{"lat":40.4337,"lon":-124.4020,"range":333,"frequency":290.1,"health":0,"station_id":885,"bitrate":100}]} {"class":"RTCM2","type":16,"station_id":268,"zcount":258.6,"seqnum":7,"length":9,"station_health":0,"message":"ABRACADABRA SHEMHAMPHORASH"} {"class":"RTCM2","type":23,"station_id":268,"zcount":258.6,"seqnum":0,"length":1,"station_health":0,"data":["0xffeeddcc"]} diff --git a/www/AIVDM.txt b/www/AIVDM.txt index e0976ee0..62e6fb59 100644 --- a/www/AIVDM.txt +++ b/www/AIVDM.txt @@ -399,7 +399,7 @@ decoding software. `-------`---`------------------------`--------`-------------------------------- Field Len Description Member Units ------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 1-3 +0-5 6 Message Type type Unsigned integer: 1-3 6-7 2 Repeat Indicator repeat 3 = "Do not repeat"; see below.. 8-37 30 MMSI mmsi Unsigned integer: 9 digits 38-41 4 Navigation Status status See table below @@ -530,7 +530,7 @@ The standard uses "EPFD" to designate any Electronic Position Fixing Device. `-------`----`----------------`--------`---------------------------------------- Field Len Description Member Units -------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 4 +0-5 6 Message Type type Unsigned integer: 4 6-7 2 Repeat Indicator repeat Unknown 8-37 30 MMSI mmsi Unsigned integer: 9 digits 38-51 14 Year year UTC, 1-999, 0 = not available (default) @@ -574,7 +574,7 @@ humans rather than gathered automatically from sensors. `-------`---`----------------------`------------`------------------------------ Field Len Description Member Encoding ------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 5 +0-5 6 Message Type type Unsigned integer: 5 6-7 2 Repeat Indicator repeat Message repeat count 8-37 30 MMSI mmsi Unsigned integer: 9 digits 38-39 2 AIS Version ais_version 0=<<ITU1371>>, @@ -703,7 +703,7 @@ payloads). `-------`---`----------------`--------------`----------------------------------- Field Len Description Member Units -------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 6 +0-5 6 Message Type type Unsigned integer: 6 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 Source MMSI mmsi Unsigned integer: 9 digits 38-39 2 Sequence Number seqno Unsigned integer 0-3 @@ -725,7 +725,7 @@ bits depending on the number of destination MMSIs included. `-------`---`----------------`--------`----------------------------------------- Field Len Description Member Units -------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 7 +0-5 6 Message Type type Unsigned integer: 7 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 Source MMSI mmsi Unsigned integer: 9 digits 38-39 2 Spare Not used @@ -749,7 +749,7 @@ maximum of 1008 bits (up to 5 AIVDM sentence payloads). `-------`---`-----------------`--------------`--------------------------------- Field Len Description Member Units ------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 8 +0-5 6 Message Type type Unsigned integer: 8 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 Source MMSI mmsi Unsigned integer: 9 digits 38-39 2 Spare Not used @@ -766,7 +766,7 @@ bits is 168. `-------`---`------------------`----------`------------------------------------ Field Len Description Member Encoding ------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 9 +0-5 6 Message Type type Unsigned integer: 9 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 MMSI mmsi Unsigned integer: 9 digits 38-49 12 Altitude alt Unsigned integer: See below @@ -805,7 +805,7 @@ number of bits is 72. `-------`---`------------------`----------`------------------------------------ Field Len Description Member Encoding ------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 9 +0-5 6 Message Type type Unsigned integer: 9 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 Source MMSI mmsi Unsigned integer: 9 digits 38-39 2 Spare Not used @@ -826,7 +826,7 @@ six-bit text. This message is variable in length up to a maximum of `-------`---`------------------`-----------`----------------------------------- Field Len Description Member Units ------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 12 +0-5 6 Message Type type Unsigned integer: 12 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 Source MMSI mmsi Unsigned integer: 9 digits 38-39 2 Sequence Number seqno Unsigned integer 0-3 @@ -853,7 +853,7 @@ six-bit text. This message is variable in length up to a maximum of `-------`---`------------------`---------`------------------------------------- Field Len Description Member Units ------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 14 +0-5 6 Message Type type Unsigned integer: 14 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 Source MMSI mmsi Unsigned integer: 9 digits 38-39 2 Spare Not used @@ -875,7 +875,7 @@ a particular time division in the TDMA packet layer. `-------`---`-------------------`---------`------------------------------------- Field Len Description Member Units -------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 15 +0-5 6 Message Type type Unsigned integer: 15 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 Source MMSI mmsi Unsigned integer: 9 digits 38-39 2 Spare Not used @@ -928,7 +928,7 @@ Length may be 96 or 144 bits. `-------`---`-------------------`----------`------------------------------------ Field Len Description Member Units -------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 16 +0-5 6 Message Type type Unsigned integer: 16 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 Source MMSI mmsi Unsigned integer: 9 digits 38-39 2 Spare Not used @@ -962,7 +962,7 @@ depending on payload size. `-------`---`-------------------`----------`------------------------------------ Field Len Description Member Units -------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 16 +0-5 6 Message Type type Unsigned integer: 16 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 Source MMSI mmsi Unsigned integer: 9 digits 38-39 2 Spare Not used @@ -996,7 +996,7 @@ understand these fields." `-------`---`------------------`---------`------------------------------------- Field Len Description Member Units ------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 18 +0-5 6 Message Type type Unsigned integer: 18 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 MMSI mmsi Unsigned integer: 9 digits 38-45 8 Regional Reserved reserved @@ -1040,7 +1040,7 @@ gathered automatically from sensors. `--------`---`----------------------`-------------`----------------------------- Field Len Description Member Units -------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 19 +0-5 6 Message Type type Unsigned integer: 19 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 MMSI mmsi Unsigned integer: 9 digits 38-45 8 Regional Reserved reserved @@ -1078,7 +1078,7 @@ the number of slot reservations (1 to 4) in the message. `--------`---`-----------------`-------------`----------------------------- Field Len Description Member Units --------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 20 +0-5 6 Message Type type Unsigned integer: 20 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 MMSI mmsi Unsigned integer: 9 digits 38-39 2 Spare Not used @@ -1114,7 +1114,7 @@ and 360 bits. `--------`---`----------------------`------------`------------------------------ Field Len Description Member Units -------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 21 +0-5 6 Message Type type Unsigned integer: 21 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 MMSI mmsi Unsigned integer: 9 digits 38-42 5 Aid type type See Below @@ -1213,7 +1213,7 @@ an AIS base station network. Length is 168 bits. `--------`---`----------------`------------`------------------------------------ Field Len Description Member Units -------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 22 +0-5 6 Message Type type Unsigned integer: 22 6-7 2 Repeat Indicator repeat As in Common Navigation Block 8-37 30 MMSI mmsi Unsigned integer: 9 digits 38-39 2 Spare Not used @@ -1248,7 +1248,7 @@ is thanks to Kurt Schwehr. `-------`---`----------------------`---------------`---------------------------- Field Len Description Member Units -------------------------------------------------------------------------------- -0-5 6 Message Type msgtype Unsigned integer: 19 +0-5 6 Message Type type Unsigned integer: 19 6-7 2 Repeat Indicator repeat As in CNB 8-37 30 MMSI mmsi Unsigned integer: 9 digits 38-39 2 Part Number partno Unsigned integer: 0-1 |