LLVMFuzzerTestOneInput:
   27|  2.69k|{//gpsd/tests//test_json.c
   28|       |
   29|  2.69k|    if (Size < kMinInputLength || Size > kMaxInputLength){
  ------------------
  |  |   21|  5.39k|#define kMinInputLength 10
  ------------------
                  if (Size < kMinInputLength || Size > kMaxInputLength){
  ------------------
  |  |   22|  2.69k|#define kMaxInputLength 5120
  ------------------
  |  Branch (29:9): [True: 6, False: 2.69k]
  |  Branch (29:35): [True: 19, False: 2.67k]
  ------------------
   30|     25|        return 0;
   31|     25|    }
   32|       |
   33|  2.67k|    uint8_t *DataFx;
   34|  2.67k|    size_t SizeFx = Size+1;
   35|  2.67k|    DataFx = (uint8_t *)calloc(SizeFx,sizeof(uint8_t));
   36|       |
   37|  2.67k|    memcpy((void *)DataFx,(void *)Data,Size);
   38|       |
   39|  2.67k|    char AddCB[] ={0x7b}; //{
   40|  2.67k|    memcpy((void *)DataFx,(void *)AddCB,sizeof(AddCB));
   41|       |//calloc already added 0x00 at the end of DataFx.
   42|       |
   43|  2.67k|    int status;
   44|  2.67k|    {
   45|  2.67k|        memset((void *)&gpsdata, 0, sizeof(gpsdata));
   46|  2.67k|        status = libgps_json_unpack((char *)DataFx, &gpsdata, NULL);
   47|  2.67k|    }
   48|  2.67k|    {
   49|  2.67k|        memset((void *)&gpsdata, 0, sizeof(gpsdata));
   50|  2.67k|        status = json_toff_read((char *)DataFx, &gpsdata, NULL);
   51|  2.67k|    }
   52|       |
   53|  2.67k|    free(DataFx);
   54|       |
   55|  2.67k|    return status;
   56|  2.69k|}

libgps_json.c:str_starts_with:
   18|  19.2k|{
   19|  19.2k|    return 0 == strncmp(str, prefix, strlen(prefix));
   20|  19.2k|}

json_ais_read:
   43|    331|{
   44|       |    // collected but not actually used yet
   45|    331|    bool scaled;
   46|       |
   47|    331|#define AIS_HEADER \
   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
   50|    331|        {"device",         t_string,   .addr.string = path, \
   51|    331|                                          .len = pathlen}, \
   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
   54|    331|                                          .dflt.boolean = false}, \
   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
   56|       |
   57|    331|#define AIS_TYPE6 \
   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
   59|    331|                                       .dflt.uinteger = 0},\
   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
   61|    331|                                       .dflt.uinteger = 0},\
   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
   63|    331|                                       .dflt.boolean = false},\
   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
   65|    331|                                       .dflt.uinteger = 0},\
   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
   67|    331|                                       .dflt.uinteger = 0},
   68|    331|#define AIS_TYPE8 \
   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
   70|    331|                                       .dflt.uinteger = 0},\
   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
   72|    331|                                       .dflt.uinteger = 0},
   73|       |
   74|    331|    int status;
   75|       |
   76|    331|#include "ais_json.i"           // JSON parser template structures
  ------------------
  |  |    1|       |/*
  |  |    2|       | * This is code generated by jsongen.py. Do not hand-hack it!
  |  |    3|       | */
  |  |    4|    331| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |    5|       |
  |  |    6|       |
  |  |    7|    331|    const struct json_attr_t json_ais1[] = {
  |  |    8|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |    9|    331|	{"status",        t_uinteger,  .addr.uinteger = &ais->type1.status,
  |  |   10|    331|                                       .dflt.uinteger = 0},
  |  |   11|    331|	{"status_text",   t_ignore},
  |  |   12|    331|	{"turn",          t_integer,   .addr.integer = &ais->type1.turn,
  |  |   13|    331|                                       .dflt.integer = AIS_TURN_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1499|    331|#define AIS_TURN_NOT_AVAILABLE  128
  |  |  ------------------
  |  |   14|    331|	{"speed",         t_uinteger,  .addr.uinteger = &ais->type1.speed,
  |  |   15|    331|                                       .dflt.uinteger = AIS_SPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1501|    331|#define AIS_SPEED_NOT_AVAILABLE 1023
  |  |  ------------------
  |  |   16|    331|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type1.accuracy,
  |  |   17|    331|                                       .dflt.boolean = false},
  |  |   18|    331|	{"lon",           t_integer,   .addr.integer = &ais->type1.lon,
  |  |   19|    331|                                       .dflt.integer = AIS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1506|    331|#define AIS_LON_NOT_AVAILABLE   0x6791AC0
  |  |  ------------------
  |  |   20|    331|	{"lat",           t_integer,   .addr.integer = &ais->type1.lat,
  |  |   21|    331|                                       .dflt.integer = AIS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1508|    331|#define AIS_LAT_NOT_AVAILABLE   0x3412140
  |  |  ------------------
  |  |   22|    331|	{"course",        t_uinteger,  .addr.uinteger = &ais->type1.course,
  |  |   23|    331|                                       .dflt.uinteger = AIS_COURSE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1510|    331|#define AIS_COURSE_NOT_AVAILABLE        3600
  |  |  ------------------
  |  |   24|    331|	{"heading",       t_uinteger,  .addr.uinteger = &ais->type1.heading,
  |  |   25|    331|                                       .dflt.uinteger = AIS_HEADING_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1512|    331|#define AIS_HEADING_NOT_AVAILABLE       511
  |  |  ------------------
  |  |   26|    331|	{"second",        t_uinteger,  .addr.uinteger = &ais->type1.second,
  |  |   27|    331|                                       .dflt.uinteger = AIS_SEC_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1517|    331|#define AIS_SEC_NOT_AVAILABLE   60
  |  |  ------------------
  |  |   28|    331|	{"maneuver",      t_uinteger,  .addr.uinteger = &ais->type1.maneuver,
  |  |   29|    331|                                       .dflt.uinteger = AIS_SEC_INOPERATIVE},
  |  |  ------------------
  |  |  |  | 1520|    331|#define AIS_SEC_INOPERATIVE     63
  |  |  ------------------
  |  |   30|    331|	{"raim",          t_boolean,   .addr.boolean = &ais->type1.raim,
  |  |   31|    331|                                       .dflt.boolean = false},
  |  |   32|    331|	{"radio",         t_uinteger,  .addr.uinteger = &ais->type1.radio,
  |  |   33|    331|                                       .dflt.uinteger = 0},
  |  |   34|    331|        {NULL}
  |  |   35|    331|    };
  |  |   36|       |
  |  |   37|    331|    char timestamp[JSON_VAL_MAX+1];
  |  |   38|    331|    const struct json_attr_t json_ais4[] = {
  |  |   39|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |   40|    331|	{"timestamp",     t_string,    .addr.string = timestamp,
  |  |   41|    331|                                       .len = sizeof(timestamp)},
  |  |   42|    331|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type4.accuracy,
  |  |   43|    331|                                       .dflt.boolean = true},
  |  |   44|    331|	{"lon",           t_integer,   .addr.integer = &ais->type4.lon,
  |  |   45|    331|                                       .dflt.integer = AIS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1506|    331|#define AIS_LON_NOT_AVAILABLE   0x6791AC0
  |  |  ------------------
  |  |   46|    331|	{"lat",           t_integer,   .addr.integer = &ais->type4.lat,
  |  |   47|    331|                                       .dflt.integer = AIS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1508|    331|#define AIS_LAT_NOT_AVAILABLE   0x3412140
  |  |  ------------------
  |  |   48|    331|	{"epfd",          t_uinteger,  .addr.uinteger = &ais->type4.epfd,
  |  |   49|    331|                                       .dflt.uinteger = 0},
  |  |   50|    331|	{"epfd_text",   t_ignore},
  |  |   51|    331|	{"raim",          t_boolean,   .addr.boolean = &ais->type4.raim,
  |  |   52|    331|                                       .dflt.boolean = false},
  |  |   53|    331|	{"radio",         t_uinteger,  .addr.uinteger = &ais->type4.radio,
  |  |   54|    331|                                       .dflt.uinteger = 0},
  |  |   55|    331|        {NULL}
  |  |   56|    331|    };
  |  |   57|       |
  |  |   58|    331|    char eta[JSON_VAL_MAX+1];
  |  |   59|    331|    const struct json_attr_t json_ais5[] = {
  |  |   60|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |   61|    331|	{"imo",           t_uinteger,  .addr.uinteger = &ais->type5.imo,
  |  |   62|    331|                                       .dflt.uinteger = 0},
  |  |   63|    331|	{"ais_version",   t_uinteger,  .addr.uinteger = &ais->type5.ais_version,
  |  |   64|    331|                                       .dflt.uinteger = 0},
  |  |   65|    331|	{"callsign",      t_string,    .addr.string = ais->type5.callsign,
  |  |   66|    331|                                       .len = sizeof(ais->type5.callsign)},
  |  |   67|    331|	{"shipname",      t_string,    .addr.string = ais->type5.shipname,
  |  |   68|    331|                                       .len = sizeof(ais->type5.shipname)},
  |  |   69|    331|	{"shiptype",      t_uinteger,  .addr.uinteger = &ais->type5.shiptype,
  |  |   70|    331|                                       .dflt.uinteger = 0},
  |  |   71|    331|	{"shiptype_text",   t_ignore},
  |  |   72|    331|	{"to_bow",        t_uinteger,  .addr.uinteger = &ais->type5.to_bow,
  |  |   73|    331|                                       .dflt.uinteger = 0},
  |  |   74|    331|	{"to_stern",      t_uinteger,  .addr.uinteger = &ais->type5.to_stern,
  |  |   75|    331|                                       .dflt.uinteger = 0},
  |  |   76|    331|	{"to_port",       t_uinteger,  .addr.uinteger = &ais->type5.to_port,
  |  |   77|    331|                                       .dflt.uinteger = 0},
  |  |   78|    331|	{"to_starboard",  t_uinteger,  .addr.uinteger = &ais->type5.to_starboard,
  |  |   79|    331|                                       .dflt.uinteger = 0},
  |  |   80|    331|	{"epfd",          t_uinteger,  .addr.uinteger = &ais->type5.epfd,
  |  |   81|    331|                                       .dflt.uinteger = 0},
  |  |   82|    331|	{"epfd_text",   t_ignore},
  |  |   83|    331|	{"eta",           t_string,    .addr.string = eta,
  |  |   84|    331|                                       .len = sizeof(eta)},
  |  |   85|    331|	{"draught",       t_uinteger,  .addr.uinteger = &ais->type5.draught,
  |  |   86|    331|                                       .dflt.uinteger = 0},
  |  |   87|    331|	{"destination",   t_string,    .addr.string = ais->type5.destination,
  |  |   88|    331|                                       .len = sizeof(ais->type5.destination)},
  |  |   89|    331|	{"dte",           t_uinteger,  .addr.uinteger = &ais->type5.dte,
  |  |   90|    331|                                       .dflt.uinteger = 1},
  |  |   91|    331|        {NULL}
  |  |   92|    331|    };
  |  |   93|       |
  |  |   94|    331|    char data[JSON_VAL_MAX+1];
  |  |   95|    331|    const struct json_attr_t json_ais6[] = {
  |  |   96|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |   97|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |   98|    331|	{"data",          t_string,    .addr.string = data,
  |  |   99|    331|                                       .len = sizeof(data)},
  |  |  100|    331|        {NULL}
  |  |  101|    331|    };
  |  |  102|       |
  |  |  103|    331|    const struct json_attr_t json_ais6_fid10[] = {
  |  |  104|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  105|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  106|    331|	{"ana_int",       t_uinteger,  .addr.uinteger = &ais->type6.dac235fid10.ana_int,
  |  |  107|    331|                                       .dflt.uinteger = 0},
  |  |  108|    331|	{"ana_ext1",      t_uinteger,  .addr.uinteger = &ais->type6.dac235fid10.ana_ext1,
  |  |  109|    331|                                       .dflt.uinteger = 0},
  |  |  110|    331|	{"ana_ext2",      t_uinteger,  .addr.uinteger = &ais->type6.dac235fid10.ana_ext2,
  |  |  111|    331|                                       .dflt.uinteger = 0},
  |  |  112|    331|	{"racon",         t_uinteger,  .addr.uinteger = &ais->type6.dac235fid10.racon,
  |  |  113|    331|                                       .dflt.uinteger = 0},
  |  |  114|    331|	{"racon_text",   t_ignore},
  |  |  115|    331|	{"light",         t_uinteger,  .addr.uinteger = &ais->type6.dac235fid10.light,
  |  |  116|    331|                                       .dflt.uinteger = 0},
  |  |  117|    331|	{"light_text",   t_ignore},
  |  |  118|    331|	{"alarm",         t_boolean,   .addr.boolean = &ais->type6.dac235fid10.alarm,
  |  |  119|    331|                                       .dflt.boolean = false},
  |  |  120|    331|	{"stat_ext",      t_uinteger,  .addr.uinteger = &ais->type6.dac235fid10.stat_ext,
  |  |  121|    331|                                       .dflt.uinteger = 0},
  |  |  122|    331|	{"off_pos",       t_boolean,   .addr.boolean = &ais->type6.dac235fid10.off_pos,
  |  |  123|    331|                                       .dflt.boolean = false},
  |  |  124|    331|        {NULL}
  |  |  125|    331|    };
  |  |  126|       |
  |  |  127|    331|    char departure[JSON_VAL_MAX+1];
  |  |  128|    331|    const struct json_attr_t json_ais6_fid12[] = {
  |  |  129|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  130|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  131|    331|	{"lastport",      t_string,    .addr.string = ais->type6.dac1fid12.lastport,
  |  |  132|    331|                                       .len = sizeof(ais->type6.dac1fid12.lastport)},
  |  |  133|    331|	{"departure",     t_string,    .addr.string = departure,
  |  |  134|    331|                                       .len = sizeof(departure)},
  |  |  135|    331|	{"nextport",      t_string,    .addr.string = ais->type6.dac1fid12.nextport,
  |  |  136|    331|                                       .len = sizeof(ais->type6.dac1fid12.nextport)},
  |  |  137|    331|	{"eta",           t_string,    .addr.string = eta,
  |  |  138|    331|                                       .len = sizeof(eta)},
  |  |  139|    331|	{"dangerous",     t_string,    .addr.string = ais->type6.dac1fid12.dangerous,
  |  |  140|    331|                                       .len = sizeof(ais->type6.dac1fid12.dangerous)},
  |  |  141|    331|	{"imdcat",        t_string,    .addr.string = ais->type6.dac1fid12.imdcat,
  |  |  142|    331|                                       .len = sizeof(ais->type6.dac1fid12.imdcat)},
  |  |  143|    331|	{"unid",          t_uinteger,  .addr.uinteger = &ais->type6.dac1fid12.unid,
  |  |  144|    331|                                       .dflt.uinteger = 0},
  |  |  145|    331|	{"amount",        t_uinteger,  .addr.uinteger = &ais->type6.dac1fid12.amount,
  |  |  146|    331|                                       .dflt.uinteger = 0},
  |  |  147|    331|	{"unit",          t_uinteger,  .addr.uinteger = &ais->type6.dac1fid12.unit,
  |  |  148|    331|                                       .dflt.uinteger = 0},
  |  |  149|    331|        {NULL}
  |  |  150|    331|    };
  |  |  151|       |
  |  |  152|    331|    const struct json_attr_t json_ais6_fid15[] = {
  |  |  153|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  154|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  155|    331|	{"airdraught",    t_uinteger,  .addr.uinteger = &ais->type6.dac1fid15.airdraught,
  |  |  156|    331|                                       .dflt.uinteger = 0},
  |  |  157|    331|        {NULL}
  |  |  158|    331|    };
  |  |  159|       |
  |  |  160|    331|    const struct json_attr_t json_ais6_fid16[] = {
  |  |  161|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  162|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  163|    331|	{"persons",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid16.persons,
  |  |  164|    331|                                       .dflt.uinteger = 0},
  |  |  165|    331|        {NULL}
  |  |  166|    331|    };
  |  |  167|       |
  |  |  168|    331|    char arrival[JSON_VAL_MAX+1];
  |  |  169|    331|    const struct json_attr_t json_ais6_fid18[] = {
  |  |  170|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  171|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  172|    331|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid18.linkage,
  |  |  173|    331|                                       .dflt.uinteger = 0},
  |  |  174|    331|	{"arrival",       t_string,    .addr.string = arrival,
  |  |  175|    331|                                       .len = sizeof(arrival)},
  |  |  176|    331|	{"portname",      t_string,    .addr.string = ais->type6.dac1fid18.portname,
  |  |  177|    331|                                       .len = sizeof(ais->type6.dac1fid18.portname)},
  |  |  178|    331|	{"destination",   t_string,    .addr.string = ais->type6.dac1fid18.destination,
  |  |  179|    331|                                       .len = sizeof(ais->type6.dac1fid18.destination)},
  |  |  180|    331|	{"lon",           t_integer,   .addr.integer = &ais->type6.dac1fid18.lon,
  |  |  181|    331|                                       .dflt.integer = AIS_LON3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1462|    331|#define AIS_LON3_NOT_AVAILABLE  181000
  |  |  ------------------
  |  |  182|    331|	{"lat",           t_integer,   .addr.integer = &ais->type6.dac1fid18.lat,
  |  |  183|    331|                                       .dflt.integer = AIS_LAT3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1463|    331|#define AIS_LAT3_NOT_AVAILABLE  91000
  |  |  ------------------
  |  |  184|    331|        {NULL}
  |  |  185|    331|    };
  |  |  186|       |
  |  |  187|    331|    char berth_name[JSON_VAL_MAX+1];
  |  |  188|    331|    const struct json_attr_t json_ais6_fid20[] = {
  |  |  189|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  190|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  191|    331|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.linkage,
  |  |  192|    331|                                       .dflt.uinteger = 0},
  |  |  193|    331|	{"berth_length",  t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.berth_length,
  |  |  194|    331|                                       .dflt.uinteger = 0},
  |  |  195|    331|	{"berth_depth",   t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.berth_depth,
  |  |  196|    331|                                       .dflt.uinteger = 0},
  |  |  197|    331|	{"position",      t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.position,
  |  |  198|    331|                                       .dflt.uinteger = 0},
  |  |  199|    331|	{"position_text",   t_ignore},
  |  |  200|    331|	{"arrival",       t_string,    .addr.string = arrival,
  |  |  201|    331|                                       .len = sizeof(arrival)},
  |  |  202|    331|	{"availability",  t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.availability,
  |  |  203|    331|                                       .dflt.uinteger = 0},
  |  |  204|    331|	{"agent",         t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.agent,
  |  |  205|    331|                                       .dflt.uinteger = 0},
  |  |  206|    331|	{"fuel",          t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.fuel,
  |  |  207|    331|                                       .dflt.uinteger = 0},
  |  |  208|    331|	{"chandler",      t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.chandler,
  |  |  209|    331|                                       .dflt.uinteger = 0},
  |  |  210|    331|	{"stevedore",     t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.stevedore,
  |  |  211|    331|                                       .dflt.uinteger = 0},
  |  |  212|    331|	{"electrical",    t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.electrical,
  |  |  213|    331|                                       .dflt.uinteger = 0},
  |  |  214|    331|	{"water",         t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.water,
  |  |  215|    331|                                       .dflt.uinteger = 0},
  |  |  216|    331|	{"customs",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.customs,
  |  |  217|    331|                                       .dflt.uinteger = 0},
  |  |  218|    331|	{"cartage",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.cartage,
  |  |  219|    331|                                       .dflt.uinteger = 0},
  |  |  220|    331|	{"crane",         t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.crane,
  |  |  221|    331|                                       .dflt.uinteger = 0},
  |  |  222|    331|	{"lift",          t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.lift,
  |  |  223|    331|                                       .dflt.uinteger = 0},
  |  |  224|    331|	{"medical",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.medical,
  |  |  225|    331|                                       .dflt.uinteger = 0},
  |  |  226|    331|	{"navrepair",     t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.navrepair,
  |  |  227|    331|                                       .dflt.uinteger = 0},
  |  |  228|    331|	{"provisions",    t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.provisions,
  |  |  229|    331|                                       .dflt.uinteger = 0},
  |  |  230|    331|	{"shiprepair",    t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.shiprepair,
  |  |  231|    331|                                       .dflt.uinteger = 0},
  |  |  232|    331|	{"surveyor",      t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.surveyor,
  |  |  233|    331|                                       .dflt.uinteger = 0},
  |  |  234|    331|	{"steam",         t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.steam,
  |  |  235|    331|                                       .dflt.uinteger = 0},
  |  |  236|    331|	{"tugs",          t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.tugs,
  |  |  237|    331|                                       .dflt.uinteger = 0},
  |  |  238|    331|	{"solidwaste",    t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.solidwaste,
  |  |  239|    331|                                       .dflt.uinteger = 0},
  |  |  240|    331|	{"liquidwaste",   t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.liquidwaste,
  |  |  241|    331|                                       .dflt.uinteger = 0},
  |  |  242|    331|	{"hazardouswaste",t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.hazardouswaste,
  |  |  243|    331|                                       .dflt.uinteger = 0},
  |  |  244|    331|	{"ballast",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.ballast,
  |  |  245|    331|                                       .dflt.uinteger = 0},
  |  |  246|    331|	{"additional",    t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.additional,
  |  |  247|    331|                                       .dflt.uinteger = 0},
  |  |  248|    331|	{"regional1",     t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.regional1,
  |  |  249|    331|                                       .dflt.uinteger = 0},
  |  |  250|    331|	{"regional2",     t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.regional2,
  |  |  251|    331|                                       .dflt.uinteger = 0},
  |  |  252|    331|	{"future1",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.future1,
  |  |  253|    331|                                       .dflt.uinteger = 0},
  |  |  254|    331|	{"future2",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.future2,
  |  |  255|    331|                                       .dflt.uinteger = 0},
  |  |  256|    331|	{"berth_name",    t_string,    .addr.string = berth_name,
  |  |  257|    331|                                       .len = sizeof(berth_name)},
  |  |  258|    331|	{"berth_lon",     t_integer,   .addr.integer = &ais->type6.dac1fid20.berth_lon,
  |  |  259|    331|                                       .dflt.integer = AIS_LON3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1462|    331|#define AIS_LON3_NOT_AVAILABLE  181000
  |  |  ------------------
  |  |  260|    331|	{"berth_lat",     t_integer,   .addr.integer = &ais->type6.dac1fid20.berth_lat,
  |  |  261|    331|                                       .dflt.integer = AIS_LAT3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1463|    331|#define AIS_LAT3_NOT_AVAILABLE  91000
  |  |  ------------------
  |  |  262|    331|        {NULL}
  |  |  263|    331|    };
  |  |  264|       |
  |  |  265|    331|    const struct json_attr_t json_ais6_fid21[] = {
  |  |  266|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  267|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  268|    331|	{"country",       t_string,    .addr.string = ais->type6.dac200fid21.country,
  |  |  269|    331|                                       .len = sizeof(ais->type6.dac200fid21.country)},
  |  |  270|    331|	{"locode",        t_string,    .addr.string = ais->type6.dac200fid21.locode,
  |  |  271|    331|                                       .len = sizeof(ais->type6.dac200fid21.locode)},
  |  |  272|    331|	{"section",       t_string,    .addr.string = ais->type6.dac200fid21.section,
  |  |  273|    331|                                       .len = sizeof(ais->type6.dac200fid21.section)},
  |  |  274|    331|	{"terminal",      t_string,    .addr.string = ais->type6.dac200fid21.terminal,
  |  |  275|    331|                                       .len = sizeof(ais->type6.dac200fid21.terminal)},
  |  |  276|    331|	{"hectometre",    t_string,    .addr.string = ais->type6.dac200fid21.hectometre,
  |  |  277|    331|                                       .len = sizeof(ais->type6.dac200fid21.hectometre)},
  |  |  278|    331|	{"eta",           t_string,    .addr.string = eta,
  |  |  279|    331|                                       .len = sizeof(eta)},
  |  |  280|    331|	{"tugs",          t_uinteger,  .addr.uinteger = &ais->type6.dac200fid21.tugs,
  |  |  281|    331|                                       .dflt.uinteger = 0},
  |  |  282|    331|	{"airdraught",    t_uinteger,  .addr.uinteger = &ais->type6.dac200fid21.airdraught,
  |  |  283|    331|                                       .dflt.uinteger = 0},
  |  |  284|    331|        {NULL}
  |  |  285|    331|    };
  |  |  286|       |
  |  |  287|    331|    char rta[JSON_VAL_MAX+1];
  |  |  288|    331|    const struct json_attr_t json_ais6_fid22[] = {
  |  |  289|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  290|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  291|    331|	{"country",       t_string,    .addr.string = ais->type6.dac200fid22.country,
  |  |  292|    331|                                       .len = sizeof(ais->type6.dac200fid22.country)},
  |  |  293|    331|	{"locode",        t_string,    .addr.string = ais->type6.dac200fid22.locode,
  |  |  294|    331|                                       .len = sizeof(ais->type6.dac200fid22.locode)},
  |  |  295|    331|	{"section",       t_string,    .addr.string = ais->type6.dac200fid22.section,
  |  |  296|    331|                                       .len = sizeof(ais->type6.dac200fid22.section)},
  |  |  297|    331|	{"terminal",      t_string,    .addr.string = ais->type6.dac200fid22.terminal,
  |  |  298|    331|                                       .len = sizeof(ais->type6.dac200fid22.terminal)},
  |  |  299|    331|	{"hectometre",    t_string,    .addr.string = ais->type6.dac200fid22.hectometre,
  |  |  300|    331|                                       .len = sizeof(ais->type6.dac200fid22.hectometre)},
  |  |  301|    331|	{"rta",           t_string,    .addr.string = rta,
  |  |  302|    331|                                       .len = sizeof(rta)},
  |  |  303|    331|	{"status",        t_uinteger,  .addr.uinteger = &ais->type6.dac200fid22.status,
  |  |  304|    331|                                       .dflt.uinteger = DAC200FID22_STATUS_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1615|    331|#define DAC200FID22_STATUS_NOT_AVAILABLE        0
  |  |  ------------------
  |  |  305|    331|        {NULL}
  |  |  306|    331|    };
  |  |  307|       |
  |  |  308|    331|    const struct json_attr_t json_ais6_fid25_cargos_subtype[] = {
  |  |  309|    331|	{"code",          t_uinteger,STRUCTOBJECT(struct cargo_t, code),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  310|    331|                                       .dflt.uinteger = 0},
  |  |  311|    331|	{"subtype",       t_uinteger,STRUCTOBJECT(struct cargo_t, subtype),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  312|    331|                                       .dflt.uinteger = 0},
  |  |  313|    331|        {NULL}
  |  |  314|    331|    };
  |  |  315|    331|    const struct json_attr_t json_ais6_fid25[] = {
  |  |  316|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  317|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  318|    331|	{"unit",          t_uinteger,  .addr.uinteger = &ais->type6.dac1fid25.unit,
  |  |  319|    331|                                       .dflt.uinteger = 0},
  |  |  320|    331|	{"amount",        t_uinteger,  .addr.uinteger = &ais->type6.dac1fid25.amount,
  |  |  321|    331|                                       .dflt.uinteger = 0},
  |  |  322|    331|	{"cargos",        t_array,     STRUCTARRAY(ais->type6.dac1fid25.cargos, json_ais6_fid25_cargos_subtype, &ais->type6.dac1fid25.ncargos)},
  |  |  ------------------
  |  |  |  |  190|    331|        .addr.array.element_type = t_structobject, \
  |  |  |  |  191|    331|        .addr.array.arr.objects.subtype = e, \
  |  |  |  |  192|    331|        .addr.array.arr.objects.base = (char*)a, \
  |  |  |  |  193|    331|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  |  |  194|    331|        .addr.array.count = n, \
  |  |  |  |  195|    331|        .addr.array.maxlen = NITEMS(a)
  |  |  |  |  ------------------
  |  |  |  |  |  |    4|    331| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  323|    331|        {NULL}
  |  |  324|    331|    };
  |  |  325|       |
  |  |  326|    331|    char start[JSON_VAL_MAX+1];
  |  |  327|    331|    const struct json_attr_t json_ais6_fid28_waypoints_subtype[] = {
  |  |  328|    331|	{"lon",           t_integer, STRUCTOBJECT(struct waypoint_t, lon),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  329|    331|                                       .dflt.integer = AIS_LON4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1467|    331|#define AIS_LON4_NOT_AVAILABLE  1810000
  |  |  ------------------
  |  |  330|    331|	{"lat",           t_integer, STRUCTOBJECT(struct waypoint_t, lat),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  331|    331|                                       .dflt.integer = AIS_LAT4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1468|    331|#define AIS_LAT4_NOT_AVAILABLE  910000
  |  |  ------------------
  |  |  332|    331|        {NULL}
  |  |  333|    331|    };
  |  |  334|    331|    const struct json_attr_t json_ais6_fid28[] = {
  |  |  335|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  336|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  337|    331|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid28.linkage,
  |  |  338|    331|                                       .dflt.uinteger = 0},
  |  |  339|    331|	{"sender",        t_uinteger,  .addr.uinteger = &ais->type6.dac1fid28.sender,
  |  |  340|    331|                                       .dflt.uinteger = 0},
  |  |  341|    331|	{"rtype",         t_uinteger,  .addr.uinteger = &ais->type6.dac1fid28.rtype,
  |  |  342|    331|                                       .dflt.uinteger = 0},
  |  |  343|    331|	{"rtype_text",   t_ignore},
  |  |  344|    331|	{"start",         t_string,    .addr.string = start,
  |  |  345|    331|                                       .len = sizeof(start)},
  |  |  346|    331|	{"duration",      t_uinteger,  .addr.uinteger = &ais->type6.dac1fid28.duration,
  |  |  347|    331|                                       .dflt.uinteger = 0},
  |  |  348|    331|	{"waypoints",     t_array,     STRUCTARRAY(ais->type6.dac1fid28.waypoints, json_ais6_fid28_waypoints_subtype, &ais->type6.dac1fid28.waycount)},
  |  |  ------------------
  |  |  |  |  190|    331|        .addr.array.element_type = t_structobject, \
  |  |  |  |  191|    331|        .addr.array.arr.objects.subtype = e, \
  |  |  |  |  192|    331|        .addr.array.arr.objects.base = (char*)a, \
  |  |  |  |  193|    331|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  |  |  194|    331|        .addr.array.count = n, \
  |  |  |  |  195|    331|        .addr.array.maxlen = NITEMS(a)
  |  |  |  |  ------------------
  |  |  |  |  |  |    4|    331| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  349|    331|        {NULL}
  |  |  350|    331|    };
  |  |  351|       |
  |  |  352|    331|    const struct json_attr_t json_ais6_fid30[] = {
  |  |  353|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  354|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  355|    331|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid30.linkage,
  |  |  356|    331|                                       .dflt.uinteger = 0},
  |  |  357|    331|	{"text",          t_string,    .addr.string = ais->type6.dac1fid30.text,
  |  |  358|    331|                                       .len = sizeof(ais->type6.dac1fid30.text)},
  |  |  359|    331|        {NULL}
  |  |  360|    331|    };
  |  |  361|       |
  |  |  362|    331|    const struct json_attr_t json_ais6_fid32_tidals_subtype[] = {
  |  |  363|    331|	{"lon",           t_integer, STRUCTOBJECT(struct tidal_t, lon),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  364|    331|                                       .dflt.integer = AIS_LON3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1462|    331|#define AIS_LON3_NOT_AVAILABLE  181000
  |  |  ------------------
  |  |  365|    331|	{"lat",           t_integer, STRUCTOBJECT(struct tidal_t, lat),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  366|    331|                                       .dflt.integer = AIS_LAT3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1463|    331|#define AIS_LAT3_NOT_AVAILABLE  91000
  |  |  ------------------
  |  |  367|    331|	{"from_hour",     t_uinteger,STRUCTOBJECT(struct tidal_t, from_hour),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  368|    331|                                       .dflt.uinteger = AIS_MONTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1531|    331|#define AIS_MONTH_NOT_AVAILABLE 0
  |  |  ------------------
  |  |  369|    331|	{"from_min",      t_uinteger,STRUCTOBJECT(struct tidal_t, from_min),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  370|    331|                                       .dflt.uinteger = AIS_MINUTE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1537|    331|#define AIS_MINUTE_NOT_AVAILABLE        60
  |  |  ------------------
  |  |  371|    331|	{"to_hour",       t_uinteger,STRUCTOBJECT(struct tidal_t, to_hour),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  372|    331|                                       .dflt.uinteger = AIS_HOUR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1535|    331|#define AIS_HOUR_NOT_AVAILABLE  24
  |  |  ------------------
  |  |  373|    331|	{"to_min",        t_uinteger,STRUCTOBJECT(struct tidal_t, to_min),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  374|    331|                                       .dflt.uinteger = AIS_MINUTE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1537|    331|#define AIS_MINUTE_NOT_AVAILABLE        60
  |  |  ------------------
  |  |  375|    331|	{"cdir",          t_uinteger,STRUCTOBJECT(struct tidal_t, cdir),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  376|    331|                                       .dflt.uinteger = DAC1FID32_CDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1831|    331|#define DAC1FID32_CDIR_NOT_AVAILABLE     360
  |  |  ------------------
  |  |  377|    331|	{"cspeed",        t_uinteger,STRUCTOBJECT(struct tidal_t, cspeed),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  378|    331|                                       .dflt.uinteger = DAC1FID32_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1833|    331|#define DAC1FID32_CSPEED_NOT_AVAILABLE   127
  |  |  ------------------
  |  |  379|    331|        {NULL}
  |  |  380|    331|    };
  |  |  381|    331|    const struct json_attr_t json_ais6_fid32[] = {
  |  |  382|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  383|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  384|    331|	{"month",         t_uinteger,  .addr.uinteger = &ais->type6.dac1fid32.month,
  |  |  385|    331|                                       .dflt.uinteger = AIS_MONTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1531|    331|#define AIS_MONTH_NOT_AVAILABLE 0
  |  |  ------------------
  |  |  386|    331|	{"day",           t_uinteger,  .addr.uinteger = &ais->type6.dac1fid32.day,
  |  |  387|    331|                                       .dflt.uinteger = AIS_DAY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1533|    331|#define AIS_DAY_NOT_AVAILABLE   0
  |  |  ------------------
  |  |  388|    331|	{"tidals",        t_array,     STRUCTARRAY(ais->type6.dac1fid32.tidals, json_ais6_fid32_tidals_subtype, &ais->type6.dac1fid32.ntidals)},
  |  |  ------------------
  |  |  |  |  190|    331|        .addr.array.element_type = t_structobject, \
  |  |  |  |  191|    331|        .addr.array.arr.objects.subtype = e, \
  |  |  |  |  192|    331|        .addr.array.arr.objects.base = (char*)a, \
  |  |  |  |  193|    331|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  |  |  194|    331|        .addr.array.count = n, \
  |  |  |  |  195|    331|        .addr.array.maxlen = NITEMS(a)
  |  |  |  |  ------------------
  |  |  |  |  |  |    4|    331| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  389|    331|        {NULL}
  |  |  390|    331|    };
  |  |  391|       |
  |  |  392|    331|    const struct json_attr_t json_ais6_fid55[] = {
  |  |  393|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  394|    331|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   58|    331|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   59|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   60|    331|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   61|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   62|    331|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   63|    331|                                       .dflt.boolean = false},\
  |  |  |  |   64|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   65|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   66|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   67|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  395|    331|	{"crew",          t_uinteger,  .addr.uinteger = &ais->type6.dac200fid55.crew,
  |  |  396|    331|                                       .dflt.uinteger = DAC200FID55_COUNT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1622|    331|#define DAC200FID55_COUNT_NOT_AVAILABLE 255
  |  |  ------------------
  |  |  397|    331|	{"passengers",    t_uinteger,  .addr.uinteger = &ais->type6.dac200fid55.passengers,
  |  |  398|    331|                                       .dflt.uinteger = DAC200FID55_COUNT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1622|    331|#define DAC200FID55_COUNT_NOT_AVAILABLE 255
  |  |  ------------------
  |  |  399|    331|	{"personnel",     t_uinteger,  .addr.uinteger = &ais->type6.dac200fid55.personnel,
  |  |  400|    331|                                       .dflt.uinteger = DAC200FID55_COUNT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1622|    331|#define DAC200FID55_COUNT_NOT_AVAILABLE 255
  |  |  ------------------
  |  |  401|    331|        {NULL}
  |  |  402|    331|    };
  |  |  403|       |
  |  |  404|    331|    const struct json_attr_t json_ais7[] = {
  |  |  405|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  406|    331|	{"mmsi1",         t_uinteger,  .addr.uinteger = &ais->type7.mmsi1,
  |  |  407|    331|                                       .dflt.uinteger = 0},
  |  |  408|    331|	{"mmsi2",         t_uinteger,  .addr.uinteger = &ais->type7.mmsi2,
  |  |  409|    331|                                       .dflt.uinteger = 0},
  |  |  410|    331|	{"mmsi3",         t_uinteger,  .addr.uinteger = &ais->type7.mmsi3,
  |  |  411|    331|                                       .dflt.uinteger = 0},
  |  |  412|    331|	{"mmsi4",         t_uinteger,  .addr.uinteger = &ais->type7.mmsi4,
  |  |  413|    331|                                       .dflt.uinteger = 0},
  |  |  414|    331|	{"seqno1",        t_uinteger,  .addr.uinteger = &ais->type7.seqno1,
  |  |  415|    331|                                       .dflt.uinteger = 0},
  |  |  416|    331|	{"seqno2",        t_uinteger,  .addr.uinteger = &ais->type7.seqno2,
  |  |  417|    331|                                       .dflt.uinteger = 0},
  |  |  418|    331|	{"seqno3",        t_uinteger,  .addr.uinteger = &ais->type7.seqno3,
  |  |  419|    331|                                       .dflt.uinteger = 0},
  |  |  420|    331|	{"seqno4",        t_uinteger,  .addr.uinteger = &ais->type7.seqno4,
  |  |  421|    331|                                       .dflt.uinteger = 0},
  |  |  422|    331|        {NULL}
  |  |  423|    331|    };
  |  |  424|       |
  |  |  425|    331|    const struct json_attr_t json_ais8[] = {
  |  |  426|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  427|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  428|    331|	{"data",          t_string,    .addr.string = data,
  |  |  429|    331|                                       .len = sizeof(data)},
  |  |  430|    331|        {NULL}
  |  |  431|    331|    };
  |  |  432|       |
  |  |  433|    331|    const struct json_attr_t json_ais8_fid10[] = {
  |  |  434|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  435|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  436|    331|	{"vin",           t_string,    .addr.string = ais->type8.dac200fid10.vin,
  |  |  437|    331|                                       .len = sizeof(ais->type8.dac200fid10.vin)},
  |  |  438|    331|	{"length",        t_uinteger,  .addr.uinteger = &ais->type8.dac200fid10.length,
  |  |  439|    331|                                       .dflt.uinteger = 0},
  |  |  440|    331|	{"beam",          t_uinteger,  .addr.uinteger = &ais->type8.dac200fid10.beam,
  |  |  441|    331|                                       .dflt.uinteger = 0},
  |  |  442|    331|	{"shiptype",      t_uinteger,  .addr.uinteger = &ais->type8.dac200fid10.shiptype,
  |  |  443|    331|                                       .dflt.uinteger = 0},
  |  |  444|    331|	{"shiptype_text",   t_ignore},
  |  |  445|    331|	{"hazard",        t_uinteger,  .addr.uinteger = &ais->type8.dac200fid10.hazard,
  |  |  446|    331|                                       .dflt.uinteger = 0},
  |  |  447|    331|	{"hazard_text",   t_ignore},
  |  |  448|    331|	{"draught",       t_uinteger,  .addr.uinteger = &ais->type8.dac200fid10.draught,
  |  |  449|    331|                                       .dflt.uinteger = 0},
  |  |  450|    331|	{"loaded",        t_uinteger,  .addr.uinteger = &ais->type8.dac200fid10.loaded,
  |  |  451|    331|                                       .dflt.uinteger = 0},
  |  |  452|    331|	{"loaded_text",   t_ignore},
  |  |  453|    331|	{"speed_q",       t_boolean,   .addr.boolean = &ais->type8.dac200fid10.speed_q,
  |  |  454|    331|                                       .dflt.boolean = false},
  |  |  455|    331|	{"course_q",      t_boolean,   .addr.boolean = &ais->type8.dac200fid10.course_q,
  |  |  456|    331|                                       .dflt.boolean = false},
  |  |  457|    331|	{"heading_q",     t_boolean,   .addr.boolean = &ais->type8.dac200fid10.heading_q,
  |  |  458|    331|                                       .dflt.boolean = false},
  |  |  459|    331|        {NULL}
  |  |  460|    331|    };
  |  |  461|       |
  |  |  462|    331|    const struct json_attr_t json_ais8_fid11[] = {
  |  |  463|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  464|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  465|    331|	{"lat",           t_integer,   .addr.integer = &ais->type8.dac1fid11.lat,
  |  |  466|    331|                                       .dflt.integer = DAC1FID11_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1933|    331|#define DAC1FID11_LAT_NOT_AVAILABLE     0x7FFFFF
  |  |  ------------------
  |  |  467|    331|	{"lon",           t_integer,   .addr.integer = &ais->type8.dac1fid11.lon,
  |  |  468|    331|                                       .dflt.integer = DAC1FID11_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1931|    331|#define DAC1FID11_LON_NOT_AVAILABLE     0xFFFFFF
  |  |  ------------------
  |  |  469|    331|	{"timestamp",     t_string,    .addr.string = timestamp,
  |  |  470|    331|                                       .len = sizeof(timestamp)},
  |  |  471|    331|	{"wspeed",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.wspeed,
  |  |  472|    331|                                       .dflt.uinteger = DAC1FID11_WSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1939|    331|#define DAC1FID11_WSPEED_NOT_AVAILABLE  127
  |  |  ------------------
  |  |  473|    331|	{"wgust",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.wgust,
  |  |  474|    331|                                       .dflt.uinteger = DAC1FID11_WSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1939|    331|#define DAC1FID11_WSPEED_NOT_AVAILABLE  127
  |  |  ------------------
  |  |  475|    331|	{"wdir",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.wdir,
  |  |  476|    331|                                       .dflt.uinteger = DAC1FID11_WDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1942|    331|#define DAC1FID11_WDIR_NOT_AVAILABLE    511
  |  |  ------------------
  |  |  477|    331|	{"wgustdir",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.wgustdir,
  |  |  478|    331|                                       .dflt.uinteger = DAC1FID11_WDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1942|    331|#define DAC1FID11_WDIR_NOT_AVAILABLE    511
  |  |  ------------------
  |  |  479|    331|	{"airtemp",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.airtemp,
  |  |  480|    331|                                       .dflt.uinteger = DAC1FID11_AIRTEMP_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1944|    331|#define DAC1FID11_AIRTEMP_NOT_AVAILABLE 2047
  |  |  ------------------
  |  |  481|    331|	{"humidity",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.humidity,
  |  |  482|    331|                                       .dflt.uinteger = DAC1FID11_HUMIDITY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1948|    331|#define DAC1FID11_HUMIDITY_NOT_AVAILABLE 127
  |  |  ------------------
  |  |  483|    331|	{"dewpoint",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.dewpoint,
  |  |  484|    331|                                       .dflt.uinteger = DAC1FID11_DEWPOINT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1950|    331|#define DAC1FID11_DEWPOINT_NOT_AVAILABLE 1023
  |  |  ------------------
  |  |  485|    331|	{"pressure",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.pressure,
  |  |  486|    331|                                       .dflt.uinteger = DAC1FID11_PRESSURE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1954|    331|#define DAC1FID11_PRESSURE_NOT_AVAILABLE 511
  |  |  ------------------
  |  |  487|    331|	{"pressuretend",  t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.pressuretend,
  |  |  488|    331|                                       .dflt.uinteger = DAC1FID11_PRESSURETREND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1957|    331|#define DAC1FID11_PRESSURETREND_NOT_AVAILABLE 3
  |  |  ------------------
  |  |  489|    331|	{"visibility",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.visibility,
  |  |  490|    331|                                       .dflt.uinteger = DAC1FID11_VISIBILITY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1959|    331|#define DAC1FID11_VISIBILITY_NOT_AVAILABLE  255
  |  |  ------------------
  |  |  491|    331|	{"waterlevel",    t_integer,   .addr.integer = &ais->type8.dac1fid11.waterlevel,
  |  |  492|    331|                                       .dflt.integer = DAC1FID11_WATERLEVEL_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1962|    331|#define DAC1FID11_WATERLEVEL_NOT_AVAILABLE  511
  |  |  ------------------
  |  |  493|    331|	{"leveltrend",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.leveltrend,
  |  |  494|    331|                                       .dflt.uinteger = DAC1FID11_WATERLEVELTREND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1966|    331|#define DAC1FID11_WATERLEVELTREND_NOT_AVAILABLE 3
  |  |  ------------------
  |  |  495|    331|	{"cspeed",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cspeed,
  |  |  496|    331|                                       .dflt.uinteger = DAC1FID11_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1968|    331|#define DAC1FID11_CSPEED_NOT_AVAILABLE     255
  |  |  ------------------
  |  |  497|    331|	{"cdir",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cdir,
  |  |  498|    331|                                       .dflt.uinteger = DAC1FID11_CDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1971|    331|#define DAC1FID11_CDIR_NOT_AVAILABLE       511
  |  |  ------------------
  |  |  499|    331|	{"cspeed2",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cspeed2,
  |  |  500|    331|                                       .dflt.uinteger = DAC1FID11_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1968|    331|#define DAC1FID11_CSPEED_NOT_AVAILABLE     255
  |  |  ------------------
  |  |  501|    331|	{"cdir2",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cdir2,
  |  |  502|    331|                                       .dflt.uinteger = DAC1FID11_CDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1971|    331|#define DAC1FID11_CDIR_NOT_AVAILABLE       511
  |  |  ------------------
  |  |  503|    331|	{"cdepth2",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cdepth2,
  |  |  504|    331|                                       .dflt.uinteger = DAC1FID11_CDEPTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1975|    331|#define DAC1FID11_CDEPTH_NOT_AVAILABLE     31
  |  |  ------------------
  |  |  505|    331|	{"cspeed3",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cspeed3,
  |  |  506|    331|                                       .dflt.uinteger = DAC1FID11_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1968|    331|#define DAC1FID11_CSPEED_NOT_AVAILABLE     255
  |  |  ------------------
  |  |  507|    331|	{"cdir3",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cdir3,
  |  |  508|    331|                                       .dflt.uinteger = DAC1FID11_CDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1971|    331|#define DAC1FID11_CDIR_NOT_AVAILABLE       511
  |  |  ------------------
  |  |  509|    331|	{"cdepth3",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cdepth3,
  |  |  510|    331|                                       .dflt.uinteger = DAC1FID11_CDEPTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1975|    331|#define DAC1FID11_CDEPTH_NOT_AVAILABLE     31
  |  |  ------------------
  |  |  511|    331|	{"waveheight",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.waveheight,
  |  |  512|    331|                                       .dflt.uinteger = DAC1FID11_WAVEHEIGHT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1980|    331|#define DAC1FID11_WAVEHEIGHT_NOT_AVAILABLE 255
  |  |  ------------------
  |  |  513|    331|	{"waveperiod",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.waveperiod,
  |  |  514|    331|                                       .dflt.uinteger = DAC1FID11_WAVEPERIOD_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1983|    331|#define DAC1FID11_WAVEPERIOD_NOT_AVAILABLE 63
  |  |  ------------------
  |  |  515|    331|	{"wavedir",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.wavedir,
  |  |  516|    331|                                       .dflt.uinteger = DAC1FID11_WAVEDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1985|    331|#define DAC1FID11_WAVEDIR_NOT_AVAILABLE    511
  |  |  ------------------
  |  |  517|    331|	{"swellheight",   t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.swellheight,
  |  |  518|    331|                                       .dflt.uinteger = DAC1FID11_WAVEHEIGHT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1980|    331|#define DAC1FID11_WAVEHEIGHT_NOT_AVAILABLE 255
  |  |  ------------------
  |  |  519|    331|	{"swellperiod",   t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.swellperiod,
  |  |  520|    331|                                       .dflt.uinteger = DAC1FID11_WAVEPERIOD_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1983|    331|#define DAC1FID11_WAVEPERIOD_NOT_AVAILABLE 63
  |  |  ------------------
  |  |  521|    331|	{"swelldir",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.swelldir,
  |  |  522|    331|                                       .dflt.uinteger = DAC1FID11_WAVEDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1985|    331|#define DAC1FID11_WAVEDIR_NOT_AVAILABLE    511
  |  |  ------------------
  |  |  523|    331|	{"seastate",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.seastate,
  |  |  524|    331|                                       .dflt.uinteger = DAC1FID11_SEASTATE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1990|    331|#define DAC1FID11_SEASTATE_NOT_AVAILABLE   15
  |  |  ------------------
  |  |  525|    331|	{"watertemp",     t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.watertemp,
  |  |  526|    331|                                       .dflt.uinteger = DAC1FID11_WATERTEMP_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1992|    331|#define DAC1FID11_WATERTEMP_NOT_AVAILABLE  1023
  |  |  ------------------
  |  |  527|    331|	{"preciptype",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.preciptype,
  |  |  528|    331|                                       .dflt.uinteger = DAC1FID11_PRECIPTYPE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1996|    331|#define DAC1FID11_PRECIPTYPE_NOT_AVAILABLE  7
  |  |  ------------------
  |  |  529|    331|	{"preciptype_text",   t_ignore},
  |  |  530|    331|	{"salinity",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.salinity,
  |  |  531|    331|                                       .dflt.uinteger = DAC1FID11_SALINITY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1998|    331|#define DAC1FID11_SALINITY_NOT_AVAILABLE   511
  |  |  ------------------
  |  |  532|    331|	{"ice",           t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.ice,
  |  |  533|    331|                                       .dflt.uinteger = DAC1FID11_ICE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2001|    331|#define DAC1FID11_ICE_NOT_AVAILABLE        3
  |  |  ------------------
  |  |  534|    331|	{"ice_text",   t_ignore},
  |  |  535|    331|        {NULL}
  |  |  536|    331|    };
  |  |  537|       |
  |  |  538|    331|    char closefrom[JSON_VAL_MAX+1];
  |  |  539|    331|    char closeto[JSON_VAL_MAX+1];
  |  |  540|    331|    const struct json_attr_t json_ais8_fid13[] = {
  |  |  541|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  542|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  543|    331|	{"reason",        t_string,    .addr.string = ais->type8.dac1fid13.reason,
  |  |  544|    331|                                       .len = sizeof(ais->type8.dac1fid13.reason)},
  |  |  545|    331|	{"closefrom",     t_string,    .addr.string = closefrom,
  |  |  546|    331|                                       .len = sizeof(closefrom)},
  |  |  547|    331|	{"closeto",       t_string,    .addr.string = closeto,
  |  |  548|    331|                                       .len = sizeof(closeto)},
  |  |  549|    331|	{"radius",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.radius,
  |  |  550|    331|                                       .dflt.uinteger = AIS_DAC1FID13_RADIUS_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2009|    331|#define AIS_DAC1FID13_RADIUS_NOT_AVAILABLE 10001
  |  |  ------------------
  |  |  551|    331|	{"extunit",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.extunit,
  |  |  552|    331|                                       .dflt.uinteger = AIS_DAC1FID13_EXTUNIT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2011|    331|#define AIS_DAC1FID13_EXTUNIT_NOT_AVAILABLE 0
  |  |  ------------------
  |  |  553|    331|	{"fday",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.fday,
  |  |  554|    331|                                       .dflt.uinteger = AIS_DAY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1533|    331|#define AIS_DAY_NOT_AVAILABLE   0
  |  |  ------------------
  |  |  555|    331|	{"fmonth",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.fmonth,
  |  |  556|    331|                                       .dflt.uinteger = AIS_MONTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1531|    331|#define AIS_MONTH_NOT_AVAILABLE 0
  |  |  ------------------
  |  |  557|    331|	{"fhour",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.fhour,
  |  |  558|    331|                                       .dflt.uinteger = AIS_HOUR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1535|    331|#define AIS_HOUR_NOT_AVAILABLE  24
  |  |  ------------------
  |  |  559|    331|	{"fminute",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.fminute,
  |  |  560|    331|                                       .dflt.uinteger = AIS_MINUTE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1537|    331|#define AIS_MINUTE_NOT_AVAILABLE        60
  |  |  ------------------
  |  |  561|    331|	{"tday",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.tday,
  |  |  562|    331|                                       .dflt.uinteger = AIS_DAY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1533|    331|#define AIS_DAY_NOT_AVAILABLE   0
  |  |  ------------------
  |  |  563|    331|	{"tmonth",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.tmonth,
  |  |  564|    331|                                       .dflt.uinteger = AIS_MONTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1531|    331|#define AIS_MONTH_NOT_AVAILABLE 0
  |  |  ------------------
  |  |  565|    331|	{"thour",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.thour,
  |  |  566|    331|                                       .dflt.uinteger = AIS_HOUR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1535|    331|#define AIS_HOUR_NOT_AVAILABLE  24
  |  |  ------------------
  |  |  567|    331|	{"tminute",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.tminute,
  |  |  568|    331|                                       .dflt.uinteger = AIS_MINUTE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1537|    331|#define AIS_MINUTE_NOT_AVAILABLE        60
  |  |  ------------------
  |  |  569|    331|        {NULL}
  |  |  570|    331|    };
  |  |  571|       |
  |  |  572|    331|    const struct json_attr_t json_ais8_fid15[] = {
  |  |  573|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  574|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  575|    331|	{"airdraught",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid15.airdraught,
  |  |  576|    331|                                       .dflt.uinteger = 0},
  |  |  577|    331|        {NULL}
  |  |  578|    331|    };
  |  |  579|       |
  |  |  580|    331|    const struct json_attr_t json_ais8_fid16[] = {
  |  |  581|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  582|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  583|    331|	{"persons",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid16.persons,
  |  |  584|    331|                                       .dflt.uinteger = 0},
  |  |  585|    331|        {NULL}
  |  |  586|    331|    };
  |  |  587|       |
  |  |  588|    331|    const struct json_attr_t json_ais8_fid17_targets_subtype[] = {
  |  |  589|    331|	{"idtype",        t_uinteger,STRUCTOBJECT(struct target_t, idtype),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  590|    331|                                       .dflt.uinteger = DAC1FID17_IDTYPE_OTHER},
  |  |  ------------------
  |  |  |  | 2036|    331|#define DAC1FID17_IDTYPE_OTHER          3
  |  |  ------------------
  |  |  591|    331|	{"id.mmsi",       t_uinteger,STRUCTOBJECT(struct target_t, id.mmsi),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  592|    331|                                       .dflt.uinteger = 0},
  |  |  593|    331|	{"id.imo",        t_uinteger,STRUCTOBJECT(struct target_t, id.imo),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  594|    331|                                       .dflt.uinteger = 0},
  |  |  595|    331|	{"id.callsign",   t_string,  STRUCTOBJECT(struct target_t, id.callsign),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  596|    331|                                       .len = DAC1FID17_ID_LENGTH},
  |  |  ------------------
  |  |  |  | 2041|    331|#define DAC1FID17_ID_LENGTH             7
  |  |  ------------------
  |  |  597|    331|	{"id.other",      t_string,  STRUCTOBJECT(struct target_t, id.other),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  598|    331|                                       .len = DAC1FID17_ID_LENGTH},
  |  |  ------------------
  |  |  |  | 2041|    331|#define DAC1FID17_ID_LENGTH             7
  |  |  ------------------
  |  |  599|    331|	{"lat",           t_integer, STRUCTOBJECT(struct target_t, lat),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  600|    331|                                       .dflt.integer = AIS_LAT3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1463|    331|#define AIS_LAT3_NOT_AVAILABLE  91000
  |  |  ------------------
  |  |  601|    331|	{"lon",           t_integer, STRUCTOBJECT(struct target_t, lon),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  602|    331|                                       .dflt.integer = AIS_LON3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1462|    331|#define AIS_LON3_NOT_AVAILABLE  181000
  |  |  ------------------
  |  |  603|    331|	{"course",        t_uinteger,STRUCTOBJECT(struct target_t, course),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  604|    331|                                       .dflt.uinteger = DAC1FID17_COURSE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2048|    331|#define DAC1FID17_COURSE_NOT_AVAILABLE  360
  |  |  ------------------
  |  |  605|    331|	{"second",        t_uinteger,STRUCTOBJECT(struct target_t, second),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  606|    331|                                       .dflt.uinteger = AIS_SECOND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1539|    331|#define AIS_SECOND_NOT_AVAILABLE        60
  |  |  ------------------
  |  |  607|    331|	{"speed",         t_uinteger,STRUCTOBJECT(struct target_t, speed),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  608|    331|                                       .dflt.uinteger = DAC1FID17_SPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2051|    331|#define DAC1FID17_SPEED_NOT_AVAILABLE   255
  |  |  ------------------
  |  |  609|    331|        {NULL}
  |  |  610|    331|    };
  |  |  611|    331|    const struct json_attr_t json_ais8_fid17[] = {
  |  |  612|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  613|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  614|    331|	{"targets",       t_array,     STRUCTARRAY(ais->type8.dac1fid17.targets, json_ais8_fid17_targets_subtype, &ais->type8.dac1fid17.ntargets)},
  |  |  ------------------
  |  |  |  |  190|    331|        .addr.array.element_type = t_structobject, \
  |  |  |  |  191|    331|        .addr.array.arr.objects.subtype = e, \
  |  |  |  |  192|    331|        .addr.array.arr.objects.base = (char*)a, \
  |  |  |  |  193|    331|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  |  |  194|    331|        .addr.array.count = n, \
  |  |  |  |  195|    331|        .addr.array.maxlen = NITEMS(a)
  |  |  |  |  ------------------
  |  |  |  |  |  |    4|    331| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  615|    331|        {NULL}
  |  |  616|    331|    };
  |  |  617|       |
  |  |  618|    331|    const struct json_attr_t json_ais8_fid19[] = {
  |  |  619|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  620|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  621|    331|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid19.linkage,
  |  |  622|    331|                                       .dflt.uinteger = 0},
  |  |  623|    331|	{"station",       t_string,    .addr.string = ais->type8.dac1fid19.station,
  |  |  624|    331|                                       .len = sizeof(ais->type8.dac1fid19.station)},
  |  |  625|    331|	{"lon",           t_integer,   .addr.integer = &ais->type8.dac1fid19.lon,
  |  |  626|    331|                                       .dflt.integer = AIS_LON3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1462|    331|#define AIS_LON3_NOT_AVAILABLE  181000
  |  |  ------------------
  |  |  627|    331|	{"lat",           t_integer,   .addr.integer = &ais->type8.dac1fid19.lat,
  |  |  628|    331|                                       .dflt.integer = AIS_LAT3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1463|    331|#define AIS_LAT3_NOT_AVAILABLE  91000
  |  |  ------------------
  |  |  629|    331|	{"status",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid19.status,
  |  |  630|    331|                                       .dflt.uinteger = 0},
  |  |  631|    331|	{"signal",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid19.signal,
  |  |  632|    331|                                       .dflt.uinteger = 0},
  |  |  633|    331|	{"signal_text",   t_ignore},
  |  |  634|    331|	{"hour",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid19.hour,
  |  |  635|    331|                                       .dflt.uinteger = AIS_HOUR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1535|    331|#define AIS_HOUR_NOT_AVAILABLE  24
  |  |  ------------------
  |  |  636|    331|	{"minute",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid19.minute,
  |  |  637|    331|                                       .dflt.uinteger = AIS_MINUTE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1537|    331|#define AIS_MINUTE_NOT_AVAILABLE        60
  |  |  ------------------
  |  |  638|    331|	{"nextsignal",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid19.nextsignal,
  |  |  639|    331|                                       .dflt.uinteger = 0},
  |  |  640|    331|	{"nextsignal_type",   t_ignore},
  |  |  641|    331|        {NULL}
  |  |  642|    331|    };
  |  |  643|       |
  |  |  644|    331|    char end[JSON_VAL_MAX+1];
  |  |  645|    331|    const struct json_attr_t json_ais8_fid23[] = {
  |  |  646|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  647|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  648|    331|	{"start",         t_string,    .addr.string = start,
  |  |  649|    331|                                       .len = sizeof(start)},
  |  |  650|    331|	{"end",           t_string,    .addr.string = end,
  |  |  651|    331|                                       .len = sizeof(end)},
  |  |  652|    331|	{"start_lon",     t_integer,   .addr.integer = &ais->type8.dac200fid23.start_lon,
  |  |  653|    331|                                       .dflt.integer = AIS_LON4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1467|    331|#define AIS_LON4_NOT_AVAILABLE  1810000
  |  |  ------------------
  |  |  654|    331|	{"start_lat",     t_integer,   .addr.integer = &ais->type8.dac200fid23.start_lat,
  |  |  655|    331|                                       .dflt.integer = AIS_LAT4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1468|    331|#define AIS_LAT4_NOT_AVAILABLE  910000
  |  |  ------------------
  |  |  656|    331|	{"end_lon",       t_integer,   .addr.integer = &ais->type8.dac200fid23.end_lon,
  |  |  657|    331|                                       .dflt.integer = AIS_LON4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1467|    331|#define AIS_LON4_NOT_AVAILABLE  1810000
  |  |  ------------------
  |  |  658|    331|	{"end_lat",       t_integer,   .addr.integer = &ais->type8.dac200fid23.end_lat,
  |  |  659|    331|                                       .dflt.integer = AIS_LAT4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1468|    331|#define AIS_LAT4_NOT_AVAILABLE  910000
  |  |  ------------------
  |  |  660|    331|	{"type",          t_uinteger,  .addr.uinteger = &ais->type8.dac200fid23.type,
  |  |  661|    331|                                       .dflt.uinteger = DAC200FID23_TYPE_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1892|    331|#define DAC200FID23_TYPE_UNKNOWN        0
  |  |  ------------------
  |  |  662|    331|	{"type_text",   t_ignore},
  |  |  663|    331|	{"min",           t_integer,   .addr.integer = &ais->type8.dac200fid23.min,
  |  |  664|    331|                                       .dflt.integer = DAC200FID23_MIN_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1894|    331|#define DAC200FID23_MIN_UNKNOWN         255
  |  |  ------------------
  |  |  665|    331|	{"max",           t_integer,   .addr.integer = &ais->type8.dac200fid23.max,
  |  |  666|    331|                                       .dflt.integer = DAC200FID23_MAX_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1896|    331|#define DAC200FID23_MAX_UNKNOWN         255
  |  |  ------------------
  |  |  667|    331|	{"intensity",     t_uinteger,  .addr.uinteger = &ais->type8.dac200fid23.intensity,
  |  |  668|    331|                                       .dflt.uinteger = DAC200FID23_CLASS_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1898|    331|#define DAC200FID23_CLASS_UNKNOWN       0
  |  |  ------------------
  |  |  669|    331|	{"intensity_text",   t_ignore},
  |  |  670|    331|	{"wind",          t_uinteger,  .addr.uinteger = &ais->type8.dac200fid23.wind,
  |  |  671|    331|                                       .dflt.uinteger = DAC200FID23_WIND_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1900|    331|#define DAC200FID23_WIND_UNKNOWN        0
  |  |  ------------------
  |  |  672|    331|	{"wind_text",   t_ignore},
  |  |  673|    331|        {NULL}
  |  |  674|    331|    };
  |  |  675|       |
  |  |  676|    331|    const struct json_attr_t json_ais8_fid24_gauges_subtype[] = {
  |  |  677|    331|	{"id",            t_uinteger,STRUCTOBJECT(struct gauge_t, id),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  678|    331|                                       .dflt.uinteger = DAC200FID24_GAUGE_ID_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1907|    331|#define DAC200FID24_GAUGE_ID_UNKNOWN    0
  |  |  ------------------
  |  |  679|    331|	{"level",         t_integer, STRUCTOBJECT(struct gauge_t, level),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  680|    331|                                       .dflt.integer = DAC200FID24_GAUGE_LEVEL_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1909|    331|#define DAC200FID24_GAUGE_LEVEL_UNKNOWN 0
  |  |  ------------------
  |  |  681|    331|        {NULL}
  |  |  682|    331|    };
  |  |  683|    331|    const struct json_attr_t json_ais8_fid24[] = {
  |  |  684|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  685|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  686|    331|	{"country",       t_string,    .addr.string = ais->type8.dac200fid24.country,
  |  |  687|    331|                                       .len = sizeof(ais->type8.dac200fid24.country)},
  |  |  688|    331|	{"gauges",        t_array,     STRUCTARRAY(ais->type8.dac200fid24.gauges, json_ais8_fid24_gauges_subtype, &ais->type8.dac200fid24.ngauges)},
  |  |  ------------------
  |  |  |  |  190|    331|        .addr.array.element_type = t_structobject, \
  |  |  |  |  191|    331|        .addr.array.arr.objects.subtype = e, \
  |  |  |  |  192|    331|        .addr.array.arr.objects.base = (char*)a, \
  |  |  |  |  193|    331|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  |  |  194|    331|        .addr.array.count = n, \
  |  |  |  |  195|    331|        .addr.array.maxlen = NITEMS(a)
  |  |  |  |  ------------------
  |  |  |  |  |  |    4|    331| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  689|    331|        {NULL}
  |  |  690|    331|    };
  |  |  691|       |
  |  |  692|    331|    const struct json_attr_t json_ais8_fid27_waypoints_subtype[] = {
  |  |  693|    331|	{"lon",           t_integer, STRUCTOBJECT(struct waypoint_t, lon),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  694|    331|                                       .dflt.integer = AIS_LON4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1467|    331|#define AIS_LON4_NOT_AVAILABLE  1810000
  |  |  ------------------
  |  |  695|    331|	{"lat",           t_integer, STRUCTOBJECT(struct waypoint_t, lat),
  |  |  ------------------
  |  |  |  |  188|    331|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  696|    331|                                       .dflt.integer = AIS_LAT4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1468|    331|#define AIS_LAT4_NOT_AVAILABLE  910000
  |  |  ------------------
  |  |  697|    331|        {NULL}
  |  |  698|    331|    };
  |  |  699|    331|    const struct json_attr_t json_ais8_fid27[] = {
  |  |  700|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  701|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  702|    331|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid27.linkage,
  |  |  703|    331|                                       .dflt.uinteger = 0},
  |  |  704|    331|	{"sender",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid27.sender,
  |  |  705|    331|                                       .dflt.uinteger = 0},
  |  |  706|    331|	{"rtype",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid27.rtype,
  |  |  707|    331|                                       .dflt.uinteger = 0},
  |  |  708|    331|	{"rtype_text",   t_ignore},
  |  |  709|    331|	{"start",         t_string,    .addr.string = start,
  |  |  710|    331|                                       .len = sizeof(start)},
  |  |  711|    331|	{"duration",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid27.duration,
  |  |  712|    331|                                       .dflt.uinteger = 0},
  |  |  713|    331|	{"waypoints",     t_array,     STRUCTARRAY(ais->type8.dac1fid27.waypoints, json_ais8_fid27_waypoints_subtype, &ais->type8.dac1fid27.waycount)},
  |  |  ------------------
  |  |  |  |  190|    331|        .addr.array.element_type = t_structobject, \
  |  |  |  |  191|    331|        .addr.array.arr.objects.subtype = e, \
  |  |  |  |  192|    331|        .addr.array.arr.objects.base = (char*)a, \
  |  |  |  |  193|    331|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  |  |  194|    331|        .addr.array.count = n, \
  |  |  |  |  195|    331|        .addr.array.maxlen = NITEMS(a)
  |  |  |  |  ------------------
  |  |  |  |  |  |    4|    331| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  714|    331|        {NULL}
  |  |  715|    331|    };
  |  |  716|       |
  |  |  717|    331|    const struct json_attr_t json_ais8_fid29[] = {
  |  |  718|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  719|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  720|    331|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid29.linkage,
  |  |  721|    331|                                       .dflt.uinteger = 0},
  |  |  722|    331|	{"text",          t_string,    .addr.string = ais->type8.dac1fid29.text,
  |  |  723|    331|                                       .len = sizeof(ais->type8.dac1fid29.text)},
  |  |  724|    331|        {NULL}
  |  |  725|    331|    };
  |  |  726|       |
  |  |  727|    331|    const struct json_attr_t json_ais8_fid31[] = {
  |  |  728|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  729|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  730|    331|	{"lon",           t_integer,   .addr.integer = &ais->type8.dac1fid31.lon,
  |  |  731|    331|                                       .dflt.integer = DAC1FID31_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2080|    331|#define DAC1FID31_LON_NOT_AVAILABLE     (181*60*DAC1FID31_LATLON_SCALE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2078|    331|#define DAC1FID31_LATLON_SCALE  1000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|    331|	{"lat",           t_integer,   .addr.integer = &ais->type8.dac1fid31.lat,
  |  |  733|    331|                                       .dflt.integer = DAC1FID31_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2082|    331|#define DAC1FID31_LAT_NOT_AVAILABLE     (91*60*DAC1FID31_LATLON_SCALE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2078|    331|#define DAC1FID31_LATLON_SCALE  1000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  734|    331|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type8.dac1fid31.accuracy,
  |  |  735|    331|                                       .dflt.boolean = false},
  |  |  736|    331|	{"timestamp",     t_string,    .addr.string = timestamp,
  |  |  737|    331|                                       .len = sizeof(timestamp)},
  |  |  738|    331|	{"wspeed",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.wspeed,
  |  |  739|    331|                                       .dflt.uinteger = DAC1FID31_WIND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2089|    331|#define DAC1FID31_WIND_NOT_AVAILABLE     127
  |  |  ------------------
  |  |  740|    331|	{"wgust",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.wgust,
  |  |  741|    331|                                       .dflt.uinteger = DAC1FID31_WIND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2089|    331|#define DAC1FID31_WIND_NOT_AVAILABLE     127
  |  |  ------------------
  |  |  742|    331|	{"wdir",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.wdir,
  |  |  743|    331|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2092|    331|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  744|    331|	{"wgustdir",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.wgustdir,
  |  |  745|    331|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2092|    331|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  746|    331|	{"airtemp",       t_integer,   .addr.integer = &ais->type8.dac1fid31.airtemp,
  |  |  747|    331|                                       .dflt.integer = DAC1FID31_AIRTEMP_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2094|    331|#define DAC1FID31_AIRTEMP_NOT_AVAILABLE  -1024
  |  |  ------------------
  |  |  748|    331|	{"humidity",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.humidity,
  |  |  749|    331|                                       .dflt.uinteger = DAC1FID31_HUMIDITY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2097|    331|#define DAC1FID31_HUMIDITY_NOT_AVAILABLE 101
  |  |  ------------------
  |  |  750|    331|	{"dewpoint",      t_integer,   .addr.integer = &ais->type8.dac1fid31.dewpoint,
  |  |  751|    331|                                       .dflt.integer = DAC1FID31_DEWPOINT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2099|    331|#define DAC1FID31_DEWPOINT_NOT_AVAILABLE 501
  |  |  ------------------
  |  |  752|    331|	{"pressure",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.pressure,
  |  |  753|    331|                                       .dflt.uinteger = DAC1FID31_PRESSURE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2102|    331|#define DAC1FID31_PRESSURE_NOT_AVAILABLE 511
  |  |  ------------------
  |  |  754|    331|	{"pressuretend",  t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.pressuretend,
  |  |  755|    331|                                       .dflt.uinteger = DAC1FID31_PRESSURETEND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2106|    331|#define DAC1FID31_PRESSURETEND_NOT_AVAILABLE  3
  |  |  ------------------
  |  |  756|    331|	{"visgreater",    t_boolean,   .addr.boolean = &ais->type8.dac1fid31.visgreater,
  |  |  757|    331|                                       .dflt.boolean = false},
  |  |  758|    331|	{"visibility",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.visibility,
  |  |  759|    331|                                       .dflt.uinteger = DAC1FID31_VISIBILITY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2109|    331|#define DAC1FID31_VISIBILITY_NOT_AVAILABLE  127
  |  |  ------------------
  |  |  760|    331|	{"waterlevel",    t_integer,   .addr.integer = &ais->type8.dac1fid31.waterlevel,
  |  |  761|    331|                                       .dflt.integer = DAC1FID31_WATERLEVEL_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2112|    331|#define DAC1FID31_WATERLEVEL_NOT_AVAILABLE 4001
  |  |  ------------------
  |  |  762|    331|	{"leveltrend",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.leveltrend,
  |  |  763|    331|                                       .dflt.uinteger = DAC1FID31_WATERLEVELTREND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2116|    331|#define DAC1FID31_WATERLEVELTREND_NOT_AVAILABLE 3
  |  |  ------------------
  |  |  764|    331|	{"cspeed",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cspeed,
  |  |  765|    331|                                       .dflt.uinteger = DAC1FID31_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2118|    331|#define DAC1FID31_CSPEED_NOT_AVAILABLE     255
  |  |  ------------------
  |  |  766|    331|	{"cdir",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cdir,
  |  |  767|    331|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2092|    331|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  768|    331|	{"cspeed2",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cspeed2,
  |  |  769|    331|                                       .dflt.uinteger = DAC1FID31_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2118|    331|#define DAC1FID31_CSPEED_NOT_AVAILABLE     255
  |  |  ------------------
  |  |  770|    331|	{"cdir2",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cdir2,
  |  |  771|    331|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2092|    331|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  772|    331|	{"cdepth2",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cdepth2,
  |  |  773|    331|                                       .dflt.uinteger = DAC1FID31_CDEPTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2124|    331|#define DAC1FID31_CDEPTH_NOT_AVAILABLE     301
  |  |  ------------------
  |  |  774|    331|	{"cspeed3",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cspeed3,
  |  |  775|    331|                                       .dflt.uinteger = DAC1FID31_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2118|    331|#define DAC1FID31_CSPEED_NOT_AVAILABLE     255
  |  |  ------------------
  |  |  776|    331|	{"cdir3",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cdir3,
  |  |  777|    331|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2092|    331|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  778|    331|	{"cdepth3",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cdepth3,
  |  |  779|    331|                                       .dflt.uinteger = DAC1FID31_CDEPTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2124|    331|#define DAC1FID31_CDEPTH_NOT_AVAILABLE     301
  |  |  ------------------
  |  |  780|    331|	{"waveheight",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.waveheight,
  |  |  781|    331|                                       .dflt.uinteger = DAC1FID31_HEIGHT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2130|    331|#define DAC1FID31_HEIGHT_NOT_AVAILABLE     31
  |  |  ------------------
  |  |  782|    331|	{"waveperiod",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.waveperiod,
  |  |  783|    331|                                       .dflt.uinteger = DAC1FID31_PERIOD_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2133|    331|#define DAC1FID31_PERIOD_NOT_AVAILABLE     63
  |  |  ------------------
  |  |  784|    331|	{"wavedir",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.wavedir,
  |  |  785|    331|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2092|    331|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  786|    331|	{"swellheight",   t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.swellheight,
  |  |  787|    331|                                       .dflt.uinteger = DAC1FID31_HEIGHT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2130|    331|#define DAC1FID31_HEIGHT_NOT_AVAILABLE     31
  |  |  ------------------
  |  |  788|    331|	{"swellperiod",   t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.swellperiod,
  |  |  789|    331|                                       .dflt.uinteger = DAC1FID31_PERIOD_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2133|    331|#define DAC1FID31_PERIOD_NOT_AVAILABLE     63
  |  |  ------------------
  |  |  790|    331|	{"swelldir",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.swelldir,
  |  |  791|    331|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2092|    331|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  792|    331|	{"seastate",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.seastate,
  |  |  793|    331|                                       .dflt.uinteger = DAC1FID31_SEASTATE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2139|    331|#define DAC1FID31_SEASTATE_NOT_AVAILABLE   15
  |  |  ------------------
  |  |  794|    331|	{"watertemp",     t_integer,   .addr.integer = &ais->type8.dac1fid31.watertemp,
  |  |  795|    331|                                       .dflt.integer = DAC1FID31_WATERTEMP_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2141|    331|#define DAC1FID31_WATERTEMP_NOT_AVAILABLE  601
  |  |  ------------------
  |  |  796|    331|	{"preciptype",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.preciptype,
  |  |  797|    331|                                       .dflt.uinteger = DAC1FID31_PRECIPTYPE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2144|    331|#define DAC1FID31_PRECIPTYPE_NOT_AVAILABLE 7
  |  |  ------------------
  |  |  798|    331|	{"preciptype_text",   t_ignore},
  |  |  799|    331|	{"salinity",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.salinity,
  |  |  800|    331|                                       .dflt.uinteger = DAC1FID31_SALINITY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2146|    331|#define DAC1FID31_SALINITY_NOT_AVAILABLE   510
  |  |  ------------------
  |  |  801|    331|	{"ice",           t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.ice,
  |  |  802|    331|                                       .dflt.uinteger = DAC1FID31_ICE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2149|    331|#define DAC1FID31_ICE_NOT_AVAILABLE       3
  |  |  ------------------
  |  |  803|    331|        {NULL}
  |  |  804|    331|    };
  |  |  805|       |
  |  |  806|    331|    const struct json_attr_t json_ais8_fid40[] = {
  |  |  807|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  808|    331|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   69|    331|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   70|    331|                                       .dflt.uinteger = 0},\
  |  |  |  |   71|    331|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   72|    331|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  809|    331|	{"form",          t_uinteger,  .addr.uinteger = &ais->type8.dac200fid40.form,
  |  |  810|    331|                                       .dflt.uinteger = DAC200FID40_FORM_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1916|    331|#define DAC200FID40_FORM_UNKNOWN        0
  |  |  ------------------
  |  |  811|    331|	{"facing",        t_uinteger,  .addr.uinteger = &ais->type8.dac200fid40.facing,
  |  |  812|    331|                                       .dflt.uinteger = DAC200FID40_FACING_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1918|    331|#define DAC200FID40_FACING_UNKNOWN      0
  |  |  ------------------
  |  |  813|    331|	{"direction",     t_uinteger,  .addr.uinteger = &ais->type8.dac200fid40.direction,
  |  |  814|    331|                                       .dflt.uinteger = DAC200FID40_DIRECTION_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1920|    331|#define DAC200FID40_DIRECTION_UNKNOWN   0
  |  |  ------------------
  |  |  815|    331|	{"direction_text",   t_ignore},
  |  |  816|    331|	{"status",        t_uinteger,  .addr.uinteger = &ais->type8.dac200fid40.status,
  |  |  817|    331|                                       .dflt.uinteger = DAC200FID40_STATUS_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1922|    331|#define DAC200FID40_STATUS_UNKNOWN      0
  |  |  ------------------
  |  |  818|    331|	{"status_text",   t_ignore},
  |  |  819|    331|        {NULL}
  |  |  820|    331|    };
  |  |  821|       |
  |  |  822|    331|    const struct json_attr_t json_ais9[] = {
  |  |  823|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  824|    331|	{"alt",           t_uinteger,  .addr.uinteger = &ais->type9.alt,
  |  |  825|    331|                                       .dflt.uinteger = AIS_ALT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2156|    331|#define AIS_ALT_NOT_AVAILABLE   4095
  |  |  ------------------
  |  |  826|    331|	{"speed",         t_uinteger,  .addr.uinteger = &ais->type9.speed,
  |  |  827|    331|                                       .dflt.uinteger = AIS_SPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1501|    331|#define AIS_SPEED_NOT_AVAILABLE 1023
  |  |  ------------------
  |  |  828|    331|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type9.accuracy,
  |  |  829|    331|                                       .dflt.boolean = false},
  |  |  830|    331|	{"lon",           t_integer,   .addr.integer = &ais->type9.lon,
  |  |  831|    331|                                       .dflt.integer = AIS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1506|    331|#define AIS_LON_NOT_AVAILABLE   0x6791AC0
  |  |  ------------------
  |  |  832|    331|	{"lat",           t_integer,   .addr.integer = &ais->type9.lat,
  |  |  833|    331|                                       .dflt.integer = AIS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1508|    331|#define AIS_LAT_NOT_AVAILABLE   0x3412140
  |  |  ------------------
  |  |  834|    331|	{"course",        t_uinteger,  .addr.uinteger = &ais->type9.course,
  |  |  835|    331|                                       .dflt.uinteger = AIS_COURSE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1510|    331|#define AIS_COURSE_NOT_AVAILABLE        3600
  |  |  ------------------
  |  |  836|    331|	{"second",        t_uinteger,  .addr.uinteger = &ais->type9.second,
  |  |  837|    331|                                       .dflt.uinteger = AIS_SEC_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1517|    331|#define AIS_SEC_NOT_AVAILABLE   60
  |  |  ------------------
  |  |  838|    331|	{"regional",      t_uinteger,  .addr.uinteger = &ais->type9.regional,
  |  |  839|    331|                                       .dflt.uinteger = 0},
  |  |  840|    331|	{"dte",           t_uinteger,  .addr.uinteger = &ais->type9.dte,
  |  |  841|    331|                                       .dflt.uinteger = 1},
  |  |  842|    331|	{"raim",          t_boolean,   .addr.boolean = &ais->type9.raim,
  |  |  843|    331|                                       .dflt.boolean = false},
  |  |  844|    331|	{"radio",         t_uinteger,  .addr.uinteger = &ais->type9.radio,
  |  |  845|    331|                                       .dflt.uinteger = 0},
  |  |  846|    331|        {NULL}
  |  |  847|    331|    };
  |  |  848|       |
  |  |  849|    331|    const struct json_attr_t json_ais10[] = {
  |  |  850|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  851|    331|	{"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type10.dest_mmsi,
  |  |  852|    331|                                       .dflt.uinteger = 0},
  |  |  853|    331|        {NULL}
  |  |  854|    331|    };
  |  |  855|       |
  |  |  856|    331|    const struct json_attr_t json_ais12[] = {
  |  |  857|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  858|    331|	{"seqno",         t_uinteger,  .addr.uinteger = &ais->type12.seqno,
  |  |  859|    331|                                       .dflt.uinteger = 0},
  |  |  860|    331|	{"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type12.dest_mmsi,
  |  |  861|    331|                                       .dflt.uinteger = 0},
  |  |  862|    331|	{"retransmit",    t_boolean,   .addr.boolean = &ais->type12.retransmit,
  |  |  863|    331|                                       .dflt.boolean = 0},
  |  |  864|    331|	{"text",          t_string,    .addr.string = ais->type12.text,
  |  |  865|    331|                                       .len = sizeof(ais->type12.text)},
  |  |  866|    331|        {NULL}
  |  |  867|    331|    };
  |  |  868|       |
  |  |  869|    331|    const struct json_attr_t json_ais14[] = {
  |  |  870|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  871|    331|	{"text",          t_string,    .addr.string = ais->type14.text,
  |  |  872|    331|                                       .len = sizeof(ais->type14.text)},
  |  |  873|    331|        {NULL}
  |  |  874|    331|    };
  |  |  875|       |
  |  |  876|    331|    const struct json_attr_t json_ais15[] = {
  |  |  877|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  878|    331|	{"mmsi1",         t_uinteger,  .addr.uinteger = &ais->type15.mmsi1,
  |  |  879|    331|                                       .dflt.uinteger = 0},
  |  |  880|    331|	{"type1_1",       t_uinteger,  .addr.uinteger = &ais->type15.type1_1,
  |  |  881|    331|                                       .dflt.uinteger = 0},
  |  |  882|    331|	{"offset1_1",     t_uinteger,  .addr.uinteger = &ais->type15.offset1_1,
  |  |  883|    331|                                       .dflt.uinteger = 0},
  |  |  884|    331|	{"type1_2",       t_uinteger,  .addr.uinteger = &ais->type15.type1_2,
  |  |  885|    331|                                       .dflt.uinteger = 0},
  |  |  886|    331|	{"offset1_2",     t_uinteger,  .addr.uinteger = &ais->type15.offset1_2,
  |  |  887|    331|                                       .dflt.uinteger = 0},
  |  |  888|    331|	{"mmsi2",         t_uinteger,  .addr.uinteger = &ais->type15.mmsi2,
  |  |  889|    331|                                       .dflt.uinteger = 0},
  |  |  890|    331|	{"type2_1",       t_uinteger,  .addr.uinteger = &ais->type15.type2_1,
  |  |  891|    331|                                       .dflt.uinteger = 0},
  |  |  892|    331|	{"offset2_1",     t_uinteger,  .addr.uinteger = &ais->type15.offset2_1,
  |  |  893|    331|                                       .dflt.uinteger = 0},
  |  |  894|    331|        {NULL}
  |  |  895|    331|    };
  |  |  896|       |
  |  |  897|    331|    const struct json_attr_t json_ais16[] = {
  |  |  898|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  899|    331|	{"mmsi1",         t_uinteger,  .addr.uinteger = &ais->type16.mmsi1,
  |  |  900|    331|                                       .dflt.uinteger = 0},
  |  |  901|    331|	{"offset1",       t_uinteger,  .addr.uinteger = &ais->type16.offset1,
  |  |  902|    331|                                       .dflt.uinteger = 0},
  |  |  903|    331|	{"increment1",    t_uinteger,  .addr.uinteger = &ais->type16.increment1,
  |  |  904|    331|                                       .dflt.uinteger = 0},
  |  |  905|    331|	{"mmsi2",         t_uinteger,  .addr.uinteger = &ais->type16.mmsi2,
  |  |  906|    331|                                       .dflt.uinteger = 0},
  |  |  907|    331|	{"offset2",       t_uinteger,  .addr.uinteger = &ais->type16.offset2,
  |  |  908|    331|                                       .dflt.uinteger = 0},
  |  |  909|    331|	{"increment2",    t_uinteger,  .addr.uinteger = &ais->type16.increment2,
  |  |  910|    331|                                       .dflt.uinteger = 0},
  |  |  911|    331|        {NULL}
  |  |  912|    331|    };
  |  |  913|       |
  |  |  914|    331|    const struct json_attr_t json_ais17[] = {
  |  |  915|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  916|    331|	{"lon",           t_integer,   .addr.integer = &ais->type17.lon,
  |  |  917|    331|                                       .dflt.integer = AIS_GNS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2239|    331|#define AIS_GNS_LON_NOT_AVAILABLE       0x1a838
  |  |  ------------------
  |  |  918|    331|	{"lat",           t_integer,   .addr.integer = &ais->type17.lat,
  |  |  919|    331|                                       .dflt.integer = AIS_GNS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2241|    331|#define AIS_GNS_LAT_NOT_AVAILABLE       0xd548
  |  |  ------------------
  |  |  920|    331|	{"data",          t_string,    .addr.string = data,
  |  |  921|    331|                                       .len = sizeof(data)},
  |  |  922|    331|        {NULL}
  |  |  923|    331|    };
  |  |  924|       |
  |  |  925|    331|    const struct json_attr_t json_ais18[] = {
  |  |  926|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  927|    331|	{"reserved",      t_uinteger,  .addr.uinteger = &ais->type18.reserved,
  |  |  928|    331|                                       .dflt.uinteger = 0},
  |  |  929|    331|	{"speed",         t_uinteger,  .addr.uinteger = &ais->type18.speed,
  |  |  930|    331|                                       .dflt.uinteger = AIS_SPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1501|    331|#define AIS_SPEED_NOT_AVAILABLE 1023
  |  |  ------------------
  |  |  931|    331|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type18.accuracy,
  |  |  932|    331|                                       .dflt.boolean = false},
  |  |  933|    331|	{"lon",           t_integer,   .addr.integer = &ais->type18.lon,
  |  |  934|    331|                                       .dflt.integer = AIS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1506|    331|#define AIS_LON_NOT_AVAILABLE   0x6791AC0
  |  |  ------------------
  |  |  935|    331|	{"lat",           t_integer,   .addr.integer = &ais->type18.lat,
  |  |  936|    331|                                       .dflt.integer = AIS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1508|    331|#define AIS_LAT_NOT_AVAILABLE   0x3412140
  |  |  ------------------
  |  |  937|    331|	{"course",        t_uinteger,  .addr.uinteger = &ais->type18.course,
  |  |  938|    331|                                       .dflt.uinteger = AIS_COURSE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1510|    331|#define AIS_COURSE_NOT_AVAILABLE        3600
  |  |  ------------------
  |  |  939|    331|	{"heading",       t_uinteger,  .addr.uinteger = &ais->type18.heading,
  |  |  940|    331|                                       .dflt.uinteger = AIS_HEADING_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1512|    331|#define AIS_HEADING_NOT_AVAILABLE       511
  |  |  ------------------
  |  |  941|    331|	{"second",        t_uinteger,  .addr.uinteger = &ais->type18.second,
  |  |  942|    331|                                       .dflt.uinteger = AIS_SEC_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1517|    331|#define AIS_SEC_NOT_AVAILABLE   60
  |  |  ------------------
  |  |  943|    331|	{"regional",      t_uinteger,  .addr.uinteger = &ais->type18.regional,
  |  |  944|    331|                                       .dflt.uinteger = 0},
  |  |  945|    331|	{"cs",            t_boolean,   .addr.boolean = &ais->type18.cs,
  |  |  946|    331|                                       .dflt.boolean = false},
  |  |  947|    331|	{"display",       t_boolean,   .addr.boolean = &ais->type18.display,
  |  |  948|    331|                                       .dflt.boolean = false},
  |  |  949|    331|	{"dsc",           t_boolean,   .addr.boolean = &ais->type18.dsc,
  |  |  950|    331|                                       .dflt.boolean = false},
  |  |  951|    331|	{"band",          t_boolean,   .addr.boolean = &ais->type18.band,
  |  |  952|    331|                                       .dflt.boolean = false},
  |  |  953|    331|	{"msg22",         t_boolean,   .addr.boolean = &ais->type18.msg22,
  |  |  954|    331|                                       .dflt.boolean = false},
  |  |  955|    331|	{"raim",          t_boolean,   .addr.boolean = &ais->type18.raim,
  |  |  956|    331|                                       .dflt.boolean = false},
  |  |  957|    331|	{"radio",         t_uinteger,  .addr.uinteger = &ais->type18.radio,
  |  |  958|    331|                                       .dflt.uinteger = 0},
  |  |  959|    331|        {NULL}
  |  |  960|    331|    };
  |  |  961|       |
  |  |  962|    331|    const struct json_attr_t json_ais19[] = {
  |  |  963|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  964|    331|	{"reserved",      t_uinteger,  .addr.uinteger = &ais->type19.reserved,
  |  |  965|    331|                                       .dflt.uinteger = 0},
  |  |  966|    331|	{"speed",         t_uinteger,  .addr.uinteger = &ais->type19.speed,
  |  |  967|    331|                                       .dflt.uinteger = AIS_SPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1501|    331|#define AIS_SPEED_NOT_AVAILABLE 1023
  |  |  ------------------
  |  |  968|    331|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type19.accuracy,
  |  |  969|    331|                                       .dflt.boolean = false},
  |  |  970|    331|	{"lon",           t_integer,   .addr.integer = &ais->type19.lon,
  |  |  971|    331|                                       .dflt.integer = AIS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1506|    331|#define AIS_LON_NOT_AVAILABLE   0x6791AC0
  |  |  ------------------
  |  |  972|    331|	{"lat",           t_integer,   .addr.integer = &ais->type19.lat,
  |  |  973|    331|                                       .dflt.integer = AIS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1508|    331|#define AIS_LAT_NOT_AVAILABLE   0x3412140
  |  |  ------------------
  |  |  974|    331|	{"course",        t_uinteger,  .addr.uinteger = &ais->type19.course,
  |  |  975|    331|                                       .dflt.uinteger = AIS_COURSE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1510|    331|#define AIS_COURSE_NOT_AVAILABLE        3600
  |  |  ------------------
  |  |  976|    331|	{"heading",       t_uinteger,  .addr.uinteger = &ais->type19.heading,
  |  |  977|    331|                                       .dflt.uinteger = AIS_HEADING_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1512|    331|#define AIS_HEADING_NOT_AVAILABLE       511
  |  |  ------------------
  |  |  978|    331|	{"second",        t_uinteger,  .addr.uinteger = &ais->type19.second,
  |  |  979|    331|                                       .dflt.uinteger = AIS_SEC_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1517|    331|#define AIS_SEC_NOT_AVAILABLE   60
  |  |  ------------------
  |  |  980|    331|	{"regional",      t_uinteger,  .addr.uinteger = &ais->type19.regional,
  |  |  981|    331|                                       .dflt.uinteger = 0},
  |  |  982|    331|	{"shipname",      t_string,    .addr.string = ais->type19.shipname,
  |  |  983|    331|                                       .len = sizeof(ais->type19.shipname)},
  |  |  984|    331|	{"shiptype",      t_uinteger,  .addr.uinteger = &ais->type19.shiptype,
  |  |  985|    331|                                       .dflt.uinteger = 0},
  |  |  986|    331|	{"shiptype_text",   t_ignore},
  |  |  987|    331|	{"to_bow",        t_uinteger,  .addr.uinteger = &ais->type19.to_bow,
  |  |  988|    331|                                       .dflt.uinteger = 0},
  |  |  989|    331|	{"to_stern",      t_uinteger,  .addr.uinteger = &ais->type19.to_stern,
  |  |  990|    331|                                       .dflt.uinteger = 0},
  |  |  991|    331|	{"to_port",       t_uinteger,  .addr.uinteger = &ais->type19.to_port,
  |  |  992|    331|                                       .dflt.uinteger = 0},
  |  |  993|    331|	{"to_starboard",  t_uinteger,  .addr.uinteger = &ais->type19.to_starboard,
  |  |  994|    331|                                       .dflt.uinteger = 0},
  |  |  995|    331|	{"epfd",          t_uinteger,  .addr.uinteger = &ais->type19.epfd,
  |  |  996|    331|                                       .dflt.uinteger = 0},
  |  |  997|    331|	{"epfd_text",   t_ignore},
  |  |  998|    331|	{"raim",          t_boolean,   .addr.boolean = &ais->type19.raim,
  |  |  999|    331|                                       .dflt.boolean = false},
  |  | 1000|    331|	{"dte",           t_uinteger,  .addr.uinteger = &ais->type19.dte,
  |  | 1001|    331|                                       .dflt.uinteger = 1},
  |  | 1002|    331|	{"assigned",      t_boolean,   .addr.boolean = &ais->type19.assigned,
  |  | 1003|    331|                                       .dflt.boolean = false},
  |  | 1004|    331|        {NULL}
  |  | 1005|    331|    };
  |  | 1006|       |
  |  | 1007|    331|    const struct json_attr_t json_ais20[] = {
  |  | 1008|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1009|    331|	{"offset1",       t_uinteger,  .addr.uinteger = &ais->type20.offset1,
  |  | 1010|    331|                                       .dflt.uinteger = 0},
  |  | 1011|    331|	{"number1",       t_uinteger,  .addr.uinteger = &ais->type20.number1,
  |  | 1012|    331|                                       .dflt.uinteger = 0},
  |  | 1013|    331|	{"timeout1",      t_uinteger,  .addr.uinteger = &ais->type20.timeout1,
  |  | 1014|    331|                                       .dflt.uinteger = 0},
  |  | 1015|    331|	{"increment1",    t_uinteger,  .addr.uinteger = &ais->type20.increment1,
  |  | 1016|    331|                                       .dflt.uinteger = 0},
  |  | 1017|    331|	{"offset2",       t_uinteger,  .addr.uinteger = &ais->type20.offset2,
  |  | 1018|    331|                                       .dflt.uinteger = 0},
  |  | 1019|    331|	{"number2",       t_uinteger,  .addr.uinteger = &ais->type20.number2,
  |  | 1020|    331|                                       .dflt.uinteger = 0},
  |  | 1021|    331|	{"timeout2",      t_uinteger,  .addr.uinteger = &ais->type20.timeout2,
  |  | 1022|    331|                                       .dflt.uinteger = 0},
  |  | 1023|    331|	{"increment2",    t_uinteger,  .addr.uinteger = &ais->type20.increment2,
  |  | 1024|    331|                                       .dflt.uinteger = 0},
  |  | 1025|    331|	{"offset3",       t_uinteger,  .addr.uinteger = &ais->type20.offset3,
  |  | 1026|    331|                                       .dflt.uinteger = 0},
  |  | 1027|    331|	{"number3",       t_uinteger,  .addr.uinteger = &ais->type20.number3,
  |  | 1028|    331|                                       .dflt.uinteger = 0},
  |  | 1029|    331|	{"timeout3",      t_uinteger,  .addr.uinteger = &ais->type20.timeout3,
  |  | 1030|    331|                                       .dflt.uinteger = 0},
  |  | 1031|    331|	{"increment3",    t_uinteger,  .addr.uinteger = &ais->type20.increment3,
  |  | 1032|    331|                                       .dflt.uinteger = 0},
  |  | 1033|    331|	{"offset4",       t_uinteger,  .addr.uinteger = &ais->type20.offset4,
  |  | 1034|    331|                                       .dflt.uinteger = 0},
  |  | 1035|    331|	{"number4",       t_uinteger,  .addr.uinteger = &ais->type20.number4,
  |  | 1036|    331|                                       .dflt.uinteger = 0},
  |  | 1037|    331|	{"timeout4",      t_uinteger,  .addr.uinteger = &ais->type20.timeout4,
  |  | 1038|    331|                                       .dflt.uinteger = 0},
  |  | 1039|    331|	{"increment4",    t_uinteger,  .addr.uinteger = &ais->type20.increment4,
  |  | 1040|    331|                                       .dflt.uinteger = 0},
  |  | 1041|    331|        {NULL}
  |  | 1042|    331|    };
  |  | 1043|       |
  |  | 1044|    331|    const struct json_attr_t json_ais21[] = {
  |  | 1045|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1046|    331|	{"aid_type",      t_uinteger,  .addr.uinteger = &ais->type21.aid_type,
  |  | 1047|    331|                                       .dflt.uinteger = 0},
  |  | 1048|    331|	{"aid_type_text",   t_ignore},
  |  | 1049|    331|	{"name",          t_string,    .addr.string = ais->type21.name,
  |  | 1050|    331|                                       .len = sizeof(ais->type21.name)},
  |  | 1051|    331|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type21.accuracy,
  |  | 1052|    331|                                       .dflt.boolean = false},
  |  | 1053|    331|	{"lon",           t_integer,   .addr.integer = &ais->type21.lon,
  |  | 1054|    331|                                       .dflt.integer = AIS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1506|    331|#define AIS_LON_NOT_AVAILABLE   0x6791AC0
  |  |  ------------------
  |  | 1055|    331|	{"lat",           t_integer,   .addr.integer = &ais->type21.lat,
  |  | 1056|    331|                                       .dflt.integer = AIS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1508|    331|#define AIS_LAT_NOT_AVAILABLE   0x3412140
  |  |  ------------------
  |  | 1057|    331|	{"to_bow",        t_uinteger,  .addr.uinteger = &ais->type21.to_bow,
  |  | 1058|    331|                                       .dflt.uinteger = 0},
  |  | 1059|    331|	{"to_stern",      t_uinteger,  .addr.uinteger = &ais->type21.to_stern,
  |  | 1060|    331|                                       .dflt.uinteger = 0},
  |  | 1061|    331|	{"to_port",       t_uinteger,  .addr.uinteger = &ais->type21.to_port,
  |  | 1062|    331|                                       .dflt.uinteger = 0},
  |  | 1063|    331|	{"to_starboard",  t_uinteger,  .addr.uinteger = &ais->type21.to_starboard,
  |  | 1064|    331|                                       .dflt.uinteger = 0},
  |  | 1065|    331|	{"epfd",          t_uinteger,  .addr.uinteger = &ais->type21.epfd,
  |  | 1066|    331|                                       .dflt.uinteger = 0},
  |  | 1067|    331|	{"epfd_text",   t_ignore},
  |  | 1068|    331|	{"second",        t_uinteger,  .addr.uinteger = &ais->type21.second,
  |  | 1069|    331|                                       .dflt.uinteger = 0},
  |  | 1070|    331|	{"regional",      t_uinteger,  .addr.uinteger = &ais->type21.regional,
  |  | 1071|    331|                                       .dflt.uinteger = 0},
  |  | 1072|    331|	{"off_position",  t_boolean,   .addr.boolean = &ais->type21.off_position,
  |  | 1073|    331|                                       .dflt.boolean = false},
  |  | 1074|    331|	{"raim",          t_boolean,   .addr.boolean = &ais->type21.raim,
  |  | 1075|    331|                                       .dflt.boolean = false},
  |  | 1076|    331|	{"virtual_aid",   t_boolean,   .addr.boolean = &ais->type21.virtual_aid,
  |  | 1077|    331|                                       .dflt.boolean = false},
  |  | 1078|    331|        {NULL}
  |  | 1079|    331|    };
  |  | 1080|       |
  |  | 1081|    331|    const struct json_attr_t json_ais22[] = {
  |  | 1082|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1083|    331|	{"channel_a",     t_uinteger,  .addr.uinteger = &ais->type22.channel_a,
  |  | 1084|    331|                                       .dflt.uinteger = 0},
  |  | 1085|    331|	{"channel_b",     t_uinteger,  .addr.uinteger = &ais->type22.channel_b,
  |  | 1086|    331|                                       .dflt.uinteger = 0},
  |  | 1087|    331|	{"txrx",          t_uinteger,  .addr.uinteger = &ais->type22.txrx,
  |  | 1088|    331|                                       .dflt.uinteger = 0},
  |  | 1089|    331|	{"power",         t_boolean,   .addr.boolean = &ais->type22.power,
  |  | 1090|    331|                                       .dflt.boolean = false},
  |  | 1091|    331|	{"ne_lon",        t_integer,   .addr.integer = &ais->type22.area.ne_lon,
  |  | 1092|    331|                                       .dflt.integer = AIS_GNS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2239|    331|#define AIS_GNS_LON_NOT_AVAILABLE       0x1a838
  |  |  ------------------
  |  | 1093|    331|	{"ne_lat",        t_integer,   .addr.integer = &ais->type22.area.ne_lat,
  |  | 1094|    331|                                       .dflt.integer = AIS_GNS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2241|    331|#define AIS_GNS_LAT_NOT_AVAILABLE       0xd548
  |  |  ------------------
  |  | 1095|    331|	{"sw_lon",        t_integer,   .addr.integer = &ais->type22.area.sw_lon,
  |  | 1096|    331|                                       .dflt.integer = AIS_GNS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2239|    331|#define AIS_GNS_LON_NOT_AVAILABLE       0x1a838
  |  |  ------------------
  |  | 1097|    331|	{"sw_lat",        t_integer,   .addr.integer = &ais->type22.area.sw_lat,
  |  | 1098|    331|                                       .dflt.integer = AIS_GNS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2241|    331|#define AIS_GNS_LAT_NOT_AVAILABLE       0xd548
  |  |  ------------------
  |  | 1099|    331|	{"dest1",         t_uinteger,  .addr.uinteger = &ais->type22.mmsi.dest1,
  |  | 1100|    331|                                       .dflt.uinteger = 0},
  |  | 1101|    331|	{"dest2",         t_uinteger,  .addr.uinteger = &ais->type22.mmsi.dest2,
  |  | 1102|    331|                                       .dflt.uinteger = 0},
  |  | 1103|    331|	{"addressed",     t_boolean,   .addr.boolean = &ais->type22.addressed,
  |  | 1104|    331|                                       .dflt.boolean = false},
  |  | 1105|    331|	{"band_a",        t_boolean,   .addr.boolean = &ais->type22.band_a,
  |  | 1106|    331|                                       .dflt.boolean = false},
  |  | 1107|    331|	{"band_b",        t_boolean,   .addr.boolean = &ais->type22.band_b,
  |  | 1108|    331|                                       .dflt.boolean = false},
  |  | 1109|    331|	{"zonesize",      t_uinteger,  .addr.uinteger = &ais->type22.zonesize,
  |  | 1110|    331|                                       .dflt.uinteger = 0},
  |  | 1111|    331|        {NULL}
  |  | 1112|    331|    };
  |  | 1113|       |
  |  | 1114|    331|    const struct json_attr_t json_ais23[] = {
  |  | 1115|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1116|    331|	{"ne_lon",        t_integer,   .addr.integer = &ais->type23.ne_lon,
  |  | 1117|    331|                                       .dflt.integer = AIS_GNS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2239|    331|#define AIS_GNS_LON_NOT_AVAILABLE       0x1a838
  |  |  ------------------
  |  | 1118|    331|	{"ne_lat",        t_integer,   .addr.integer = &ais->type23.ne_lat,
  |  | 1119|    331|                                       .dflt.integer = AIS_GNS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2241|    331|#define AIS_GNS_LAT_NOT_AVAILABLE       0xd548
  |  |  ------------------
  |  | 1120|    331|	{"sw_lon",        t_integer,   .addr.integer = &ais->type23.sw_lon,
  |  | 1121|    331|                                       .dflt.integer = AIS_GNS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2239|    331|#define AIS_GNS_LON_NOT_AVAILABLE       0x1a838
  |  |  ------------------
  |  | 1122|    331|	{"sw_lat",        t_integer,   .addr.integer = &ais->type23.sw_lat,
  |  | 1123|    331|                                       .dflt.integer = AIS_GNS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2241|    331|#define AIS_GNS_LAT_NOT_AVAILABLE       0xd548
  |  |  ------------------
  |  | 1124|    331|	{"stationtype",   t_uinteger,  .addr.uinteger = &ais->type23.stationtype,
  |  | 1125|    331|                                       .dflt.uinteger = 0},
  |  | 1126|    331|	{"stationtype_text",   t_ignore},
  |  | 1127|    331|	{"shiptype",      t_uinteger,  .addr.uinteger = &ais->type23.shiptype,
  |  | 1128|    331|                                       .dflt.uinteger = 0},
  |  | 1129|    331|	{"shiptype_text",   t_ignore},
  |  | 1130|    331|	{"txrx",          t_uinteger,  .addr.uinteger = &ais->type23.txrx,
  |  | 1131|    331|                                       .dflt.uinteger = 0},
  |  | 1132|    331|	{"interval",      t_uinteger,  .addr.uinteger = &ais->type23.interval,
  |  | 1133|    331|                                       .dflt.uinteger = 0},
  |  | 1134|    331|	{"quiet",         t_uinteger,  .addr.uinteger = &ais->type23.quiet,
  |  | 1135|    331|                                       .dflt.uinteger = 0},
  |  | 1136|    331|        {NULL}
  |  | 1137|    331|    };
  |  | 1138|       |
  |  | 1139|    331|    const struct json_attr_t json_ais24[] = {
  |  | 1140|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1141|    331|	{"shipname",      t_string,    .addr.string = ais->type24.shipname,
  |  | 1142|    331|                                       .len = sizeof(ais->type24.shipname)},
  |  | 1143|    331|	{"shiptype",      t_uinteger,  .addr.uinteger = &ais->type24.shiptype,
  |  | 1144|    331|                                       .dflt.uinteger = 0},
  |  | 1145|    331|	{"shiptype_text",   t_ignore},
  |  | 1146|    331|	{"vendorid",      t_string,    .addr.string = ais->type24.vendorid,
  |  | 1147|    331|                                       .len = sizeof(ais->type24.vendorid)},
  |  | 1148|    331|	{"model",         t_uinteger,  .addr.uinteger = &ais->type24.model,
  |  | 1149|    331|                                       .dflt.uinteger = 0},
  |  | 1150|    331|	{"serial",        t_uinteger,  .addr.uinteger = &ais->type24.serial,
  |  | 1151|    331|                                       .dflt.uinteger = 0},
  |  | 1152|    331|	{"callsign",      t_string,    .addr.string = ais->type24.callsign,
  |  | 1153|    331|                                       .len = sizeof(ais->type24.callsign)},
  |  | 1154|    331|	{"mothership_mmsi",t_uinteger,  .addr.uinteger = &ais->type24.mothership_mmsi,
  |  | 1155|    331|                                       .dflt.uinteger = 0},
  |  | 1156|    331|	{"to_bow",        t_uinteger,  .addr.uinteger = &ais->type24.dim.to_bow,
  |  | 1157|    331|                                       .dflt.uinteger = 0},
  |  | 1158|    331|	{"to_stern",      t_uinteger,  .addr.uinteger = &ais->type24.dim.to_stern,
  |  | 1159|    331|                                       .dflt.uinteger = 0},
  |  | 1160|    331|	{"to_port",       t_uinteger,  .addr.uinteger = &ais->type24.dim.to_port,
  |  | 1161|    331|                                       .dflt.uinteger = 0},
  |  | 1162|    331|	{"to_starboard",  t_uinteger,  .addr.uinteger = &ais->type24.dim.to_starboard,
  |  | 1163|    331|                                       .dflt.uinteger = 0},
  |  | 1164|    331|        {NULL}
  |  | 1165|    331|    };
  |  | 1166|       |
  |  | 1167|    331|    const struct json_attr_t json_ais25[] = {
  |  | 1168|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1169|    331|	{"addressed",     t_boolean,   .addr.boolean = &ais->type25.addressed,
  |  | 1170|    331|                                       .dflt.boolean = false},
  |  | 1171|    331|	{"structured",    t_boolean,   .addr.boolean = &ais->type25.structured,
  |  | 1172|    331|                                       .dflt.boolean = false},
  |  | 1173|    331|	{"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type25.dest_mmsi,
  |  | 1174|    331|                                       .dflt.uinteger = 0},
  |  | 1175|    331|	{"app_id",        t_uinteger,  .addr.uinteger = &ais->type25.app_id,
  |  | 1176|    331|                                       .dflt.uinteger = 0},
  |  | 1177|    331|	{"data",          t_string,    .addr.string = data,
  |  | 1178|    331|                                       .len = sizeof(data)},
  |  | 1179|    331|        {NULL}
  |  | 1180|    331|    };
  |  | 1181|       |
  |  | 1182|    331|    const struct json_attr_t json_ais26[] = {
  |  | 1183|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1184|    331|	{"addressed",     t_boolean,   .addr.boolean = &ais->type26.addressed,
  |  | 1185|    331|                                       .dflt.boolean = false},
  |  | 1186|    331|	{"structured",    t_boolean,   .addr.boolean = &ais->type26.structured,
  |  | 1187|    331|                                       .dflt.boolean = false},
  |  | 1188|    331|	{"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type26.dest_mmsi,
  |  | 1189|    331|                                       .dflt.uinteger = 0},
  |  | 1190|    331|	{"app_id",        t_uinteger,  .addr.uinteger = &ais->type26.app_id,
  |  | 1191|    331|                                       .dflt.uinteger = 0},
  |  | 1192|    331|	{"data",          t_string,    .addr.string = data,
  |  | 1193|    331|                                       .len = sizeof(data)},
  |  | 1194|    331|	{"radio",         t_uinteger,  .addr.uinteger = &ais->type26.radio,
  |  | 1195|    331|                                       .dflt.uinteger = 0},
  |  | 1196|    331|        {NULL}
  |  | 1197|    331|    };
  |  | 1198|       |
  |  | 1199|    331|    const struct json_attr_t json_ais27[] = {
  |  | 1200|    331|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   48|    331|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   49|    331|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   50|    331|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   51|    331|                                          .len = pathlen}, \
  |  |  |  |   52|    331|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   53|    331|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   54|    331|                                          .dflt.boolean = false}, \
  |  |  |  |   55|    331|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1201|    331|	{"status",        t_uinteger,  .addr.uinteger = &ais->type27.status,
  |  | 1202|    331|                                       .dflt.uinteger = 0},
  |  | 1203|    331|	{"speed",         t_uinteger,  .addr.uinteger = &ais->type27.speed,
  |  | 1204|    331|                                       .dflt.uinteger = AIS_LONGRANGE_SPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2423|    331|#define AIS_LONGRANGE_SPEED_NOT_AVAILABLE 63
  |  |  ------------------
  |  | 1205|    331|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type27.accuracy,
  |  | 1206|    331|                                       .dflt.boolean = false},
  |  | 1207|    331|	{"lon",           t_integer,   .addr.integer = &ais->type27.lon,
  |  | 1208|    331|                                       .dflt.integer = AIS_LONGRANGE_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2419|    331|#define AIS_LONGRANGE_LON_NOT_AVAILABLE 0x1a838
  |  |  ------------------
  |  | 1209|    331|	{"lat",           t_integer,   .addr.integer = &ais->type27.lat,
  |  | 1210|    331|                                       .dflt.integer = AIS_LONGRANGE_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2421|    331|#define AIS_LONGRANGE_LAT_NOT_AVAILABLE 0xd548
  |  |  ------------------
  |  | 1211|    331|	{"course",        t_uinteger,  .addr.uinteger = &ais->type27.course,
  |  | 1212|    331|                                       .dflt.uinteger = AIS_LONGRANGE_COURSE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2425|    331|#define AIS_LONGRANGE_COURSE_NOT_AVAILABLE 511
  |  |  ------------------
  |  | 1213|    331|	{"raim",          t_boolean,   .addr.boolean = &ais->type27.raim,
  |  | 1214|    331|                                       .dflt.boolean = false},
  |  | 1215|    331|	{"gnss",          t_boolean,   .addr.boolean = &ais->type27.gnss,
  |  | 1216|    331|                                       .dflt.boolean = true},
  |  | 1217|    331|        {NULL}
  |  | 1218|    331|    };
  |  | 1219|       |
  |  | 1220|       |
  |  | 1221|       |
  |  | 1222|       |/* Generated code ends. */
  |  | 1223|       |
  ------------------
   77|       |
   78|    331|#undef AIS_HEADER
   79|       |
   80|    331|    memset(ais, '\0', sizeof(struct ais_t));
   81|       |
   82|    331|    if (NULL != strstr(buf, "\"type\":1,") ||
  ------------------
  |  Branch (82:9): [True: 2, False: 329]
  ------------------
   83|    331|        NULL != strstr(buf, "\"type\":2,") ||
  ------------------
  |  Branch (83:9): [True: 1, False: 328]
  ------------------
   84|    331|        NULL != strstr(buf, "\"type\":3,")) {
  ------------------
  |  Branch (84:9): [True: 1, False: 327]
  ------------------
   85|      4|        status = json_read_object(buf, json_ais1, endptr);
   86|    327|    } else if (NULL != strstr(buf, "\"type\":4,") ||
  ------------------
  |  Branch (86:16): [True: 6, False: 321]
  ------------------
   87|    327|               NULL != strstr(buf, "\"type\":11,")) {
  ------------------
  |  Branch (87:16): [True: 1, False: 320]
  ------------------
   88|      7|        status = json_read_object(buf, json_ais4, endptr);
   89|      7|        if (0 == status) {
  ------------------
  |  Branch (89:13): [True: 1, False: 6]
  ------------------
   90|      1|            ais->type4.year = AIS_YEAR_NOT_AVAILABLE;
  ------------------
  |  | 1529|      1|#define AIS_YEAR_NOT_AVAILABLE  0
  ------------------
   91|      1|            ais->type4.month = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      1|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
   92|      1|            ais->type4.day = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      1|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
   93|      1|            ais->type4.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
   94|      1|            ais->type4.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
   95|      1|            ais->type4.second = AIS_SECOND_NOT_AVAILABLE;
  ------------------
  |  | 1539|      1|#define AIS_SECOND_NOT_AVAILABLE        60
  ------------------
   96|       |            /* We use %09u for the date to allow for dodgy years (>9999)
   97|       |             * to go through. */
   98|      1|            (void)sscanf(timestamp, "%09u-%02u-%02uT%02u:%02u:%02uZ",
   99|      1|                         &ais->type4.year,
  100|      1|                         &ais->type4.month,
  101|      1|                         &ais->type4.day,
  102|      1|                         &ais->type4.hour,
  103|      1|                         &ais->type4.minute,
  104|      1|                         &ais->type4.second);
  105|      1|        }
  106|    320|    } else if (strstr(buf, "\"type\":5,") != NULL) {
  ------------------
  |  Branch (106:16): [True: 15, False: 305]
  ------------------
  107|     15|        status = json_read_object(buf, json_ais5, endptr);
  108|     15|        if (status == 0) {
  ------------------
  |  Branch (108:13): [True: 2, False: 13]
  ------------------
  109|      2|            ais->type5.month = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      2|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
  110|      2|            ais->type5.day = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      2|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  111|      2|            ais->type5.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      2|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  112|      2|            ais->type5.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      2|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  113|      2|            (void)sscanf(eta, "%02u-%02uT%02u:%02uZ",
  114|      2|                         &ais->type5.month,
  115|      2|                         &ais->type5.day,
  116|      2|                         &ais->type5.hour,
  117|      2|                         &ais->type5.minute);
  118|      2|        }
  119|    305|    } else if (strstr(buf, "\"type\":6,") != NULL) {
  ------------------
  |  Branch (119:16): [True: 113, False: 192]
  ------------------
  120|    113|        bool structured = false;
  121|    113|        if (strstr(buf, "\"dac\":1,") != NULL) {
  ------------------
  |  Branch (121:13): [True: 22, False: 91]
  ------------------
  122|     22|            if (strstr(buf, "\"fid\":12,") != NULL) {
  ------------------
  |  Branch (122:17): [True: 3, False: 19]
  ------------------
  123|      3|                status = json_read_object(buf, json_ais6_fid12, endptr);
  124|      3|                if (status == 0) {
  ------------------
  |  Branch (124:21): [True: 1, False: 2]
  ------------------
  125|      1|                    ais->type6.dac1fid12.lmonth = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      1|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
  126|      1|                    ais->type6.dac1fid12.lday = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      1|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  127|      1|                    ais->type6.dac1fid12.lhour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  128|      1|                    ais->type6.dac1fid12.lminute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  129|      1|                    (void)sscanf(departure, "%02u-%02uT%02u:%02uZ",
  130|      1|                                 &ais->type6.dac1fid12.lmonth,
  131|      1|                                 &ais->type6.dac1fid12.lday,
  132|      1|                                 &ais->type6.dac1fid12.lhour,
  133|      1|                                 &ais->type6.dac1fid12.lminute);
  134|      1|                    ais->type6.dac1fid12.nmonth = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      1|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
  135|      1|                    ais->type6.dac1fid12.nday = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      1|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  136|      1|                    ais->type6.dac1fid12.nhour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  137|      1|                    ais->type6.dac1fid12.nminute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  138|      1|                    (void)sscanf(eta, "%02u-%02uT%02u:%02uZ",
  139|      1|                                 &ais->type6.dac1fid12.nmonth,
  140|      1|                                 &ais->type6.dac1fid12.nday,
  141|      1|                                 &ais->type6.dac1fid12.nhour,
  142|      1|                                 &ais->type6.dac1fid12.nminute);
  143|      1|                }
  144|      3|                structured = true;
  145|      3|            }
  146|     19|            else if (strstr(buf, "\"fid\":15,") != NULL) {
  ------------------
  |  Branch (146:22): [True: 1, False: 18]
  ------------------
  147|      1|                status = json_read_object(buf, json_ais6_fid15, endptr);
  148|      1|                structured = true;
  149|      1|            }
  150|     18|            else if (strstr(buf, "\"fid\":16,") != NULL) {
  ------------------
  |  Branch (150:22): [True: 1, False: 17]
  ------------------
  151|      1|                status = json_read_object(buf, json_ais6_fid16, endptr);
  152|      1|                structured = true;
  153|      1|            }
  154|     17|            else if (strstr(buf, "\"fid\":18,") != NULL) {
  ------------------
  |  Branch (154:22): [True: 2, False: 15]
  ------------------
  155|      2|                status = json_read_object(buf, json_ais6_fid18, endptr);
  156|      2|                if (status == 0) {
  ------------------
  |  Branch (156:21): [True: 1, False: 1]
  ------------------
  157|      1|                    ais->type6.dac1fid18.day = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      1|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  158|      1|                    ais->type6.dac1fid18.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  159|      1|                    ais->type6.dac1fid18.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  160|      1|                    (void)sscanf(arrival, "%02u-%02uT%02u:%02uZ",
  161|      1|                                 &ais->type6.dac1fid18.month,
  162|      1|                                 &ais->type6.dac1fid18.day,
  163|      1|                                 &ais->type6.dac1fid18.hour,
  164|      1|                                 &ais->type6.dac1fid18.minute);
  165|      1|                }
  166|      2|                structured = true;
  167|      2|            }
  168|     15|            else if (strstr(buf, "\"fid\":20,") != NULL) {
  ------------------
  |  Branch (168:22): [True: 5, False: 10]
  ------------------
  169|      5|                status = json_read_object(buf, json_ais6_fid20, endptr);
  170|      5|                if (status == 0) {
  ------------------
  |  Branch (170:21): [True: 2, False: 3]
  ------------------
  171|      2|                    ais->type6.dac1fid20.month = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      2|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
  172|      2|                    ais->type6.dac1fid20.day = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      2|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  173|      2|                    ais->type6.dac1fid20.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      2|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  174|      2|                    ais->type6.dac1fid20.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      2|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  175|      2|                    (void)sscanf(arrival, "%02u-%02uT%02u:%02uZ",
  176|      2|                                 &ais->type6.dac1fid20.month,
  177|      2|                                 &ais->type6.dac1fid20.day,
  178|      2|                                 &ais->type6.dac1fid20.hour,
  179|      2|                                 &ais->type6.dac1fid20.minute);
  180|      2|                }
  181|      5|                structured = true;
  182|      5|            }
  183|     10|            else if (strstr(buf, "\"fid\":25,") != NULL) {
  ------------------
  |  Branch (183:22): [True: 1, False: 9]
  ------------------
  184|      1|                status = json_read_object(buf, json_ais6_fid25, endptr);
  185|      1|                structured = true;
  186|      1|            }
  187|      9|            else if (strstr(buf, "\"fid\":28,") != NULL) {
  ------------------
  |  Branch (187:22): [True: 5, False: 4]
  ------------------
  188|      5|                status = json_read_object(buf, json_ais6_fid28, endptr);
  189|      5|                if (status == 0) {
  ------------------
  |  Branch (189:21): [True: 1, False: 4]
  ------------------
  190|      1|                    ais->type6.dac1fid28.month = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      1|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
  191|      1|                    ais->type6.dac1fid28.day = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      1|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  192|      1|                    ais->type6.dac1fid28.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  193|      1|                    ais->type6.dac1fid28.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  194|      1|                    (void)sscanf(start, "%02u-%02uT%02u:%02uZ",
  195|      1|                                 &ais->type6.dac1fid28.month,
  196|      1|                                 &ais->type6.dac1fid28.day,
  197|      1|                                 &ais->type6.dac1fid28.hour,
  198|      1|                                 &ais->type6.dac1fid28.minute);
  199|      1|                }
  200|      5|                structured = true;
  201|      5|            }
  202|      4|            else if (strstr(buf, "\"fid\":30,") != NULL) {
  ------------------
  |  Branch (202:22): [True: 1, False: 3]
  ------------------
  203|      1|                status = json_read_object(buf, json_ais6_fid30, endptr);
  204|      1|                structured = true;
  205|      1|            }
  206|      3|            else if (strstr(buf, "\"fid\":32,") != NULL ||
  ------------------
  |  Branch (206:22): [True: 1, False: 2]
  ------------------
  207|      3|                     strstr(buf, "\"fid\":14,") != NULL) {
  ------------------
  |  Branch (207:22): [True: 1, False: 1]
  ------------------
  208|      2|                status = json_read_object(buf, json_ais6_fid32, endptr);
  209|      2|                structured = true;
  210|      2|            }
  211|     22|        }
  212|     91|        else if (strstr(buf, "\"dac\":235,") != NULL ||
  ------------------
  |  Branch (212:18): [True: 2, False: 89]
  ------------------
  213|     91|                 strstr(buf, "\"dac\":250,") != NULL) {
  ------------------
  |  Branch (213:18): [True: 2, False: 87]
  ------------------
  214|      4|            if (strstr(buf, "\"fid\":10,") != NULL) {
  ------------------
  |  Branch (214:17): [True: 2, False: 2]
  ------------------
  215|      2|                status = json_read_object(buf, json_ais6_fid10, endptr);
  216|      2|                structured = true;
  217|      2|            }
  218|      4|        }
  219|     87|        else if (strstr(buf, "\"dac\":200,") != NULL) {
  ------------------
  |  Branch (219:18): [True: 11, False: 76]
  ------------------
  220|     11|            if (strstr(buf, "\"fid\":21,") != NULL) {
  ------------------
  |  Branch (220:17): [True: 5, False: 6]
  ------------------
  221|      5|                status = json_read_object(buf, json_ais6_fid21, endptr);
  222|      5|                structured = true;
  223|      5|                if (status == 0) {
  ------------------
  |  Branch (223:21): [True: 1, False: 4]
  ------------------
  224|      1|                    ais->type6.dac200fid21.month = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      1|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
  225|      1|                    ais->type6.dac200fid21.day = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      1|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  226|      1|                    ais->type6.dac200fid21.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  227|      1|                    ais->type6.dac200fid21.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  228|      1|                    (void)sscanf(eta, "%02u-%02uT%02u:%02u",
  229|      1|                                 &ais->type6.dac200fid21.month,
  230|      1|                                 &ais->type6.dac200fid21.day,
  231|      1|                                 &ais->type6.dac200fid21.hour,
  232|      1|                                 &ais->type6.dac200fid21.minute);
  233|      1|                }
  234|      5|            }
  235|      6|            else if (strstr(buf, "\"fid\":22,") != NULL) {
  ------------------
  |  Branch (235:22): [True: 4, False: 2]
  ------------------
  236|      4|                status = json_read_object(buf, json_ais6_fid22, endptr);
  237|      4|                structured = true;
  238|      4|                if (status == 0) {
  ------------------
  |  Branch (238:21): [True: 1, False: 3]
  ------------------
  239|      1|                    ais->type6.dac200fid22.month = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      1|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
  240|      1|                    ais->type6.dac200fid22.day = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      1|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  241|      1|                    ais->type6.dac200fid22.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  242|      1|                    ais->type6.dac200fid22.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  243|      1|                    (void)sscanf(rta, "%02u-%02uT%02u:%02u",
  244|      1|                                 &ais->type6.dac200fid22.month,
  245|      1|                                 &ais->type6.dac200fid22.day,
  246|      1|                                 &ais->type6.dac200fid22.hour,
  247|      1|                                 &ais->type6.dac200fid22.minute);
  248|      1|                }
  249|      4|            }
  250|      2|            else if (strstr(buf, "\"fid\":55,") != NULL) {
  ------------------
  |  Branch (250:22): [True: 1, False: 1]
  ------------------
  251|      1|                status = json_read_object(buf, json_ais6_fid55, endptr);
  252|      1|                structured = true;
  253|      1|            }
  254|     11|        }
  255|    113|        if (!structured) {
  ------------------
  |  Branch (255:13): [True: 80, False: 33]
  ------------------
  256|     80|            status = json_read_object(buf, json_ais6, endptr);
  257|     80|            if (status == 0)
  ------------------
  |  Branch (257:17): [True: 70, False: 10]
  ------------------
  258|     70|                lenhex_unpack(data, &ais->type6.bitcount,
  259|     70|                              ais->type6.bitdata, sizeof(ais->type6.bitdata));
  260|     80|        }
  261|    113|        ais->type6.structured = structured;
  262|    192|    } else if (strstr(buf, "\"type\":7,") != NULL
  ------------------
  |  Branch (262:16): [True: 2, False: 190]
  ------------------
  263|    192|               || strstr(buf, "\"type\":13,") != NULL) {
  ------------------
  |  Branch (263:19): [True: 1, False: 189]
  ------------------
  264|      3|        status = json_read_object(buf, json_ais7, endptr);
  265|    189|    } else if (strstr(buf, "\"type\":8,") != NULL) {
  ------------------
  |  Branch (265:16): [True: 121, False: 68]
  ------------------
  266|    121|        bool structured = false;
  267|    121|        if (strstr(buf, "\"dac\":1,") != NULL) {
  ------------------
  |  Branch (267:13): [True: 77, False: 44]
  ------------------
  268|     77|            if (strstr(buf, "\"fid\":11,") != NULL) {
  ------------------
  |  Branch (268:17): [True: 4, False: 73]
  ------------------
  269|      4|                status = json_read_object(buf, json_ais8_fid11, endptr);
  270|      4|                if (status == 0) {
  ------------------
  |  Branch (270:21): [True: 1, False: 3]
  ------------------
  271|      1|                    ais->type8.dac1fid11.day = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      1|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  272|      1|                    ais->type8.dac1fid11.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  273|      1|                    ais->type8.dac1fid11.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  274|      1|                    (void)sscanf(timestamp, "%02uT%02u:%02uZ",
  275|      1|                                 &ais->type8.dac1fid11.day,
  276|      1|                                 &ais->type8.dac1fid11.hour,
  277|      1|                                 &ais->type8.dac1fid11.minute);
  278|      1|                }
  279|      4|                structured = true;
  280|      4|            }
  281|     73|            else if (strstr(buf, "\"fid\":13,") != NULL) {
  ------------------
  |  Branch (281:22): [True: 5, False: 68]
  ------------------
  282|      5|                status = json_read_object(buf, json_ais8_fid13, endptr);
  283|      5|                if (status == 0) {
  ------------------
  |  Branch (283:21): [True: 1, False: 4]
  ------------------
  284|      1|                    ais->type8.dac1fid13.fmonth = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      1|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
  285|      1|                    ais->type8.dac1fid13.fday = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      1|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  286|      1|                    ais->type8.dac1fid13.fhour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  287|      1|                    ais->type8.dac1fid13.fminute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  288|      1|                    (void)sscanf(departure, "%02u-%02uT%02u:%02uZ",
  289|      1|                                 &ais->type8.dac1fid13.fmonth,
  290|      1|                                 &ais->type8.dac1fid13.fday,
  291|      1|                                 &ais->type8.dac1fid13.fhour,
  292|      1|                                 &ais->type8.dac1fid13.fminute);
  293|      1|                    ais->type8.dac1fid13.tmonth = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      1|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
  294|      1|                    ais->type8.dac1fid13.tday = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      1|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  295|      1|                    ais->type8.dac1fid13.thour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  296|      1|                    ais->type8.dac1fid13.tminute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  297|      1|                    (void)sscanf(eta, "%02u-%02uT%02u:%02uZ",
  298|      1|                                 &ais->type8.dac1fid13.tmonth,
  299|      1|                                 &ais->type8.dac1fid13.tday,
  300|      1|                                 &ais->type8.dac1fid13.thour,
  301|      1|                                 &ais->type8.dac1fid13.tminute);
  302|      1|                }
  303|      5|                structured = true;
  304|      5|            }
  305|     68|            else if (strstr(buf, "\"fid\":15,") != NULL) {
  ------------------
  |  Branch (305:22): [True: 1, False: 67]
  ------------------
  306|      1|                status = json_read_object(buf, json_ais8_fid15, endptr);
  307|      1|                structured = true;
  308|      1|            }
  309|     67|            else if (strstr(buf, "\"fid\":16,") != NULL) {
  ------------------
  |  Branch (309:22): [True: 49, False: 18]
  ------------------
  310|     49|                status = json_read_object(buf, json_ais8_fid16, endptr);
  311|     49|                if (status == 0) {
  ------------------
  |  Branch (311:21): [True: 1, False: 48]
  ------------------
  312|      1|                        structured = true;
  313|      1|                }
  314|     49|            }
  315|     18|            else if (strstr(buf, "\"fid\":17,") != NULL) {
  ------------------
  |  Branch (315:22): [True: 1, False: 17]
  ------------------
  316|      1|                status = json_read_object(buf, json_ais8_fid17, endptr);
  317|      1|                structured = true;
  318|      1|            }
  319|     17|            else if (strstr(buf, "\"fid\":19,") != NULL) {
  ------------------
  |  Branch (319:22): [True: 1, False: 16]
  ------------------
  320|      1|                status = json_read_object(buf, json_ais8_fid19, endptr);
  321|      1|                structured = true;
  322|      1|            }
  323|     16|            else if (strstr(buf, "\"fid\":23,") != NULL) {
  ------------------
  |  Branch (323:22): [True: 2, False: 14]
  ------------------
  324|      2|                status = json_read_object(buf, json_ais8_fid23, endptr);
  325|      2|                ais->type8.dac200fid23.start_year = AIS_YEAR_NOT_AVAILABLE;
  ------------------
  |  | 1529|      2|#define AIS_YEAR_NOT_AVAILABLE  0
  ------------------
  326|      2|                ais->type8.dac200fid23.start_month = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      2|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
  327|      2|                ais->type8.dac200fid23.start_day = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      2|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  328|      2|                ais->type8.dac200fid23.start_hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      2|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  329|      2|                ais->type8.dac200fid23.start_minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      2|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  330|      2|                ais->type8.dac200fid23.end_year = AIS_YEAR_NOT_AVAILABLE;
  ------------------
  |  | 1529|      2|#define AIS_YEAR_NOT_AVAILABLE  0
  ------------------
  331|      2|                ais->type8.dac200fid23.end_month = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      2|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
  332|      2|                ais->type8.dac200fid23.end_day = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      2|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  333|      2|                ais->type8.dac200fid23.end_hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      2|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  334|      2|                ais->type8.dac200fid23.end_minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      2|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  335|      2|                (void)sscanf(start, "%09u-%02u-%02uT%02u:%02u",
  336|      2|                         &ais->type8.dac200fid23.start_year,
  337|      2|                         &ais->type8.dac200fid23.start_month,
  338|      2|                         &ais->type8.dac200fid23.start_day,
  339|      2|                         &ais->type8.dac200fid23.start_hour,
  340|      2|                         &ais->type8.dac200fid23.start_minute);
  341|      2|                (void)sscanf(end, "%09u-%02u-%02uT%02u:%02u",
  342|      2|                         &ais->type8.dac200fid23.end_year,
  343|      2|                         &ais->type8.dac200fid23.end_month,
  344|      2|                         &ais->type8.dac200fid23.end_day,
  345|      2|                         &ais->type8.dac200fid23.end_hour,
  346|      2|                         &ais->type8.dac200fid23.end_minute);
  347|      2|                structured = true;
  348|      2|            }
  349|     14|            else if (strstr(buf, "\"fid\":24,") != NULL) {
  ------------------
  |  Branch (349:22): [True: 1, False: 13]
  ------------------
  350|      1|                status = json_read_object(buf, json_ais8_fid24, endptr);
  351|      1|                structured = true;
  352|      1|            }
  353|     13|            else if (strstr(buf, "\"fid\":27,") != NULL) {
  ------------------
  |  Branch (353:22): [True: 5, False: 8]
  ------------------
  354|      5|                status = json_read_object(buf, json_ais8_fid27, endptr);
  355|      5|                if (status == 0) {
  ------------------
  |  Branch (355:21): [True: 1, False: 4]
  ------------------
  356|      1|                    ais->type8.dac1fid27.month = AIS_MONTH_NOT_AVAILABLE;
  ------------------
  |  | 1531|      1|#define AIS_MONTH_NOT_AVAILABLE 0
  ------------------
  357|      1|                    ais->type8.dac1fid27.day = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      1|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  358|      1|                    ais->type8.dac1fid27.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  359|      1|                    ais->type8.dac1fid27.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  360|      1|                    (void)sscanf(start, "%02u-%02uT%02u:%02uZ",
  361|      1|                                 &ais->type8.dac1fid27.month,
  362|      1|                                 &ais->type8.dac1fid27.day,
  363|      1|                                 &ais->type8.dac1fid27.hour,
  364|      1|                                 &ais->type8.dac1fid27.minute);
  365|      1|                }
  366|      5|                structured = true;
  367|      5|            }
  368|      8|            else if (strstr(buf, "\"fid\":29,") != NULL) {
  ------------------
  |  Branch (368:22): [True: 1, False: 7]
  ------------------
  369|      1|                status = json_read_object(buf, json_ais8_fid29, endptr);
  370|      1|                structured = true;
  371|      1|            }
  372|      7|            else if (strstr(buf, "\"fid\":31,") != NULL) {
  ------------------
  |  Branch (372:22): [True: 6, False: 1]
  ------------------
  373|      6|                status = json_read_object(buf, json_ais8_fid31, endptr);
  374|      6|                if (status == 0) {
  ------------------
  |  Branch (374:21): [True: 2, False: 4]
  ------------------
  375|      2|                    ais->type8.dac1fid31.day = AIS_DAY_NOT_AVAILABLE;
  ------------------
  |  | 1533|      2|#define AIS_DAY_NOT_AVAILABLE   0
  ------------------
  376|      2|                    ais->type8.dac1fid31.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1535|      2|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  377|      2|                    ais->type8.dac1fid31.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1537|      2|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  378|      2|                    (void)sscanf(timestamp, "%02uT%02u:%02uZ",
  379|      2|                                 &ais->type8.dac1fid31.day,
  380|      2|                                 &ais->type8.dac1fid31.hour,
  381|      2|                                 &ais->type8.dac1fid31.minute);
  382|      2|                }
  383|      6|                structured = true;
  384|      6|            }
  385|     77|        }
  386|     44|        else if (strstr(buf, "\"dac\":200,") != NULL &&
  ------------------
  |  Branch (386:18): [True: 7, False: 37]
  ------------------
  387|     44|                 strstr(buf,"data")==NULL) {
  ------------------
  |  Branch (387:18): [True: 6, False: 1]
  ------------------
  388|      6|            if (strstr(buf, "\"fid\":10,") != NULL) {
  ------------------
  |  Branch (388:17): [True: 4, False: 2]
  ------------------
  389|      4|                status = json_read_object(buf, json_ais8_fid10, endptr);
  390|      4|                structured = true;
  391|      4|            }
  392|      6|            if (strstr(buf, "\"fid\":40,") != NULL) {
  ------------------
  |  Branch (392:17): [True: 4, False: 2]
  ------------------
  393|      4|                status = json_read_object(buf, json_ais8_fid40, endptr);
  394|      4|                structured = true;
  395|      4|            }
  396|      6|        }
  397|    121|        if (!structured) {
  ------------------
  |  Branch (397:13): [True: 88, False: 33]
  ------------------
  398|     88|            status = json_read_object(buf, json_ais8, endptr);
  399|     88|            if (status == 0)
  ------------------
  |  Branch (399:17): [True: 32, False: 56]
  ------------------
  400|     32|                lenhex_unpack(data, &ais->type8.bitcount,
  401|     32|                              ais->type8.bitdata, sizeof(ais->type8.bitdata));
  402|     88|        }
  403|    121|        ais->type8.structured = structured;
  404|    121|    } else if (strstr(buf, "\"type\":9,") != NULL) {
  ------------------
  |  Branch (404:16): [True: 1, False: 67]
  ------------------
  405|      1|        status = json_read_object(buf, json_ais9, endptr);
  406|     67|    } else if (strstr(buf, "\"type\":10,") != NULL) {
  ------------------
  |  Branch (406:16): [True: 1, False: 66]
  ------------------
  407|      1|        status = json_read_object(buf, json_ais10, endptr);
  408|     66|    } else if (strstr(buf, "\"type\":12,") != NULL) {
  ------------------
  |  Branch (408:16): [True: 3, False: 63]
  ------------------
  409|      3|        status = json_read_object(buf, json_ais12, endptr);
  410|     63|    } else if (strstr(buf, "\"type\":14,") != NULL) {
  ------------------
  |  Branch (410:16): [True: 2, False: 61]
  ------------------
  411|      2|        status = json_read_object(buf, json_ais14, endptr);
  412|     61|    } else if (strstr(buf, "\"type\":15,") != NULL) {
  ------------------
  |  Branch (412:16): [True: 1, False: 60]
  ------------------
  413|      1|        status = json_read_object(buf, json_ais15, endptr);
  414|     60|    } else if (strstr(buf, "\"type\":16,") != NULL) {
  ------------------
  |  Branch (414:16): [True: 1, False: 59]
  ------------------
  415|      1|        status = json_read_object(buf, json_ais16, endptr);
  416|     59|    } else if (strstr(buf, "\"type\":17,") != NULL) {
  ------------------
  |  Branch (416:16): [True: 5, False: 54]
  ------------------
  417|      5|        status = json_read_object(buf, json_ais17, endptr);
  418|      5|        if (status == 0)
  ------------------
  |  Branch (418:13): [True: 1, False: 4]
  ------------------
  419|      1|            lenhex_unpack(data, &ais->type17.bitcount,
  420|      1|                          ais->type17.bitdata, sizeof(ais->type17.bitdata));
  421|     54|    } else if (strstr(buf, "\"type\":18,") != NULL) {
  ------------------
  |  Branch (421:16): [True: 3, False: 51]
  ------------------
  422|      3|        status = json_read_object(buf, json_ais18, endptr);
  423|     51|    } else if (strstr(buf, "\"type\":19,") != NULL) {
  ------------------
  |  Branch (423:16): [True: 1, False: 50]
  ------------------
  424|      1|        status = json_read_object(buf, json_ais19, endptr);
  425|     50|    } else if (strstr(buf, "\"type\":20,") != NULL) {
  ------------------
  |  Branch (425:16): [True: 1, False: 49]
  ------------------
  426|      1|        status = json_read_object(buf, json_ais20, endptr);
  427|     49|    } else if (strstr(buf, "\"type\":21,") != NULL) {
  ------------------
  |  Branch (427:16): [True: 2, False: 47]
  ------------------
  428|      2|        status = json_read_object(buf, json_ais21, endptr);
  429|     47|    } else if (strstr(buf, "\"type\":22,") != NULL) {
  ------------------
  |  Branch (429:16): [True: 2, False: 45]
  ------------------
  430|      2|        status = json_read_object(buf, json_ais22, endptr);
  431|     45|    } else if (strstr(buf, "\"type\":23,") != NULL) {
  ------------------
  |  Branch (431:16): [True: 18, False: 27]
  ------------------
  432|     18|        status = json_read_object(buf, json_ais23, endptr);
  433|     27|    } else if (strstr(buf, "\"type\":24,") != NULL) {
  ------------------
  |  Branch (433:16): [True: 1, False: 26]
  ------------------
  434|      1|        status = json_read_object(buf, json_ais24, endptr);
  435|     26|    } else if (strstr(buf, "\"type\":25,") != NULL) {
  ------------------
  |  Branch (435:16): [True: 15, False: 11]
  ------------------
  436|     15|        status = json_read_object(buf, json_ais25, endptr);
  437|     15|        if (status == 0)
  ------------------
  |  Branch (437:13): [True: 11, False: 4]
  ------------------
  438|     11|            lenhex_unpack(data, &ais->type25.bitcount,
  439|     11|                          ais->type25.bitdata, sizeof(ais->type25.bitdata));
  440|     15|    } else if (strstr(buf, "\"type\":26,") != NULL) {
  ------------------
  |  Branch (440:16): [True: 8, False: 3]
  ------------------
  441|      8|        status = json_read_object(buf, json_ais26, endptr);
  442|      8|        if (status == 0)
  ------------------
  |  Branch (442:13): [True: 4, False: 4]
  ------------------
  443|      4|            lenhex_unpack(data, &ais->type26.bitcount,
  444|      4|                          ais->type26.bitdata, sizeof(ais->type26.bitdata));
  445|      8|    } else if (strstr(buf, "\"type\":27,") != NULL) {
  ------------------
  |  Branch (445:16): [True: 1, False: 2]
  ------------------
  446|      1|        status = json_read_object(buf, json_ais27, endptr);
  447|      2|    } else {
  448|      2|        if (NULL != endptr) {
  ------------------
  |  Branch (448:13): [True: 0, False: 2]
  ------------------
  449|      0|            *endptr = NULL;
  450|      0|        }
  451|      2|        return JSON_ERR_MISC;
  ------------------
  |  |  172|      2|#define JSON_ERR_MISC          21      // other data conversion error
  ------------------
  452|      2|    }
  453|    329|    return status;
  454|    331|}
ais_json.c:lenhex_unpack:
   30|    118|{
   31|    118|    char *colon = strchr(from, ':');
   32|       |
   33|    118|    *plen = (size_t)atoi(from);
   34|    118|    if (NULL != colon) {
  ------------------
  |  Branch (34:9): [True: 109, False: 9]
  ------------------
   35|    109|        (void)gps_hexpack(colon + 1, (unsigned char *)to, maxlen);
   36|    109|    }
   37|    118|}

safe_atof:
  135|  4.99k|{
  136|  4.99k|    static int maxExponent = 511;   /* Largest possible base 10 exponent.  Any
  137|       |                                     * exponent larger than this will already
  138|       |                                     * produce underflow or overflow, so there's
  139|       |                                     * no need to worry about additional digits.
  140|       |                                     */
  141|       |    /* Table giving binary powers of 10.  Entry is 10^2^i.
  142|       |     * Used to convert decimal exponents into floating-point numbers. */
  143|  4.99k|    static double powersOf10[] = {
  144|  4.99k|        10.,
  145|  4.99k|        100.,
  146|  4.99k|        1.0e4,
  147|  4.99k|        1.0e8,
  148|  4.99k|        1.0e16,
  149|  4.99k|        1.0e32,
  150|  4.99k|        1.0e64,
  151|  4.99k|        1.0e128,
  152|  4.99k|        1.0e256
  153|  4.99k|    };
  154|       |
  155|  4.99k|    bool sign = false, expSign = false;
  156|  4.99k|    double fraction, dblExp, *d;
  157|  4.99k|    const char *p;
  158|  4.99k|    int c;
  159|  4.99k|    int exp = 0;                // Exponent read from "EX" field.
  160|  4.99k|    int fracExp = 0;            /* Exponent that derives from the fractional
  161|       |                                 * part.  Under normal circumstatnces, it is
  162|       |                                 * the negative of the number of digits in F.
  163|       |                                 * However, if I is very long, the last digits
  164|       |                                 * of I get dropped (otherwise a long I with a
  165|       |                                 * large negative exponent could cause an
  166|       |                                 * unnecessary overflow on I alone).  In this
  167|       |                                 * case, fracExp is incremented one for each
  168|       |                                 * dropped digit. */
  169|  4.99k|    int mantSize;               // Number of digits in mantissa.
  170|  4.99k|    int decPt;                  /* Number of mantissa digits BEFORE decimal
  171|       |                                 * point. */
  172|  4.99k|    const char *pExp;           /* Temporarily holds location of exponent
  173|       |                                 * in string. */
  174|       |
  175|       |    /*
  176|       |     * Strip off leading blanks and check for a sign.
  177|       |     */
  178|       |
  179|  4.99k|    p = string;
  180|  4.99k|    while (isspace((int)*p)) {
  181|      0|        p += 1;
  182|      0|    }
  183|  4.99k|    if (isdigit((int)*p)) {
  184|       |        // ignore
  185|  2.98k|    } else if ('-' == *p) {
  ------------------
  |  Branch (185:16): [True: 392, False: 1.62k]
  ------------------
  186|    392|        sign = true;
  187|    392|        p += 1;
  188|  1.62k|    } else if ('+' == *p) {
  ------------------
  |  Branch (188:16): [True: 207, False: 1.41k]
  ------------------
  189|    207|        p += 1;
  190|  1.41k|    } else if ('.' == *p) {
  ------------------
  |  Branch (190:16): [True: 779, False: 640]
  ------------------
  191|       |        // ignore
  192|    779|    } else {
  193|    640|        return NAN;
  194|    640|    }
  195|       |
  196|       |    /*
  197|       |     * Count the number of digits in the mantissa (including the decimal
  198|       |     * point), and also locate the decimal point.
  199|       |     */
  200|       |
  201|  4.35k|    decPt = -1;
  202|  23.5k|    for (mantSize = 0; ; mantSize += 1) {
  203|  23.5k|        c = *p;
  204|  23.5k|        if (!isdigit((int)c)) {
  ------------------
  |  Branch (204:13): [True: 5.38k, False: 18.2k]
  ------------------
  205|  5.38k|            if ((c != '.') || (decPt >= 0)) {
  ------------------
  |  Branch (205:17): [True: 4.15k, False: 1.22k]
  |  Branch (205:31): [True: 202, False: 1.02k]
  ------------------
  206|  4.35k|                break;
  207|  4.35k|            }
  208|  1.02k|            decPt = mantSize;
  209|  1.02k|        }
  210|  19.2k|        p += 1;
  211|  19.2k|    }
  212|       |
  213|       |    /*
  214|       |     * Now suck up the digits in the mantissa.  Use two integers to
  215|       |     * collect 9 digits each (this is faster than using floating-point).
  216|       |     * If the mantissa has more than 18 digits, ignore the extras, since
  217|       |     * they can't affect the value anyway.
  218|       |     */
  219|       |
  220|  4.35k|    pExp  = p;
  221|  4.35k|    p -= mantSize;
  222|  4.35k|    if (decPt < 0) {
  ------------------
  |  Branch (222:9): [True: 3.33k, False: 1.02k]
  ------------------
  223|  3.33k|        decPt = mantSize;
  224|  3.33k|    } else {
  225|  1.02k|        mantSize -= 1;                  // One of the digits was the point.
  226|  1.02k|    }
  227|  4.35k|    if (mantSize > 18) {
  ------------------
  |  Branch (227:9): [True: 404, False: 3.95k]
  ------------------
  228|    404|        fracExp = decPt - 18;
  229|    404|        mantSize = 18;
  230|  3.95k|    } else {
  231|  3.95k|        fracExp = decPt - mantSize;
  232|  3.95k|    }
  233|  4.35k|    if (mantSize == 0) {
  ------------------
  |  Branch (233:9): [True: 989, False: 3.37k]
  ------------------
  234|    989|        fraction = 0.0;
  235|       |        // p = string;
  236|    989|        goto done;
  237|  3.37k|    } else {
  238|  3.37k|        int frac1, frac2;
  239|       |
  240|  3.37k|        frac1 = 0;
  241|  8.00k|        for ( ; mantSize > 9; mantSize -= 1) {
  ------------------
  |  Branch (241:17): [True: 4.63k, False: 3.37k]
  ------------------
  242|  4.63k|            c = *p;
  243|  4.63k|            p += 1;
  244|  4.63k|            if ('.' == c) {
  ------------------
  |  Branch (244:17): [True: 194, False: 4.44k]
  ------------------
  245|    194|                c = *p;
  246|    194|                p += 1;
  247|    194|            }
  248|  4.63k|            frac1 = 10*frac1 + (c - '0');
  249|  4.63k|        }
  250|  3.37k|        frac2 = 0;
  251|  14.2k|        for (; mantSize > 0; mantSize -= 1) {
  ------------------
  |  Branch (251:16): [True: 10.8k, False: 3.37k]
  ------------------
  252|  10.8k|            c = *p;
  253|  10.8k|            p += 1;
  254|  10.8k|            if ('.' == c) {
  ------------------
  |  Branch (254:17): [True: 228, False: 10.6k]
  ------------------
  255|    228|                c = *p;
  256|    228|                p += 1;
  257|    228|            }
  258|  10.8k|            frac2 = 10*frac2 + (c - '0');
  259|  10.8k|        }
  260|  3.37k|        fraction = (1.0e9 * frac1) + frac2;
  261|  3.37k|    }
  262|       |
  263|       |    /*
  264|       |     * Skim off the exponent.
  265|       |     */
  266|       |
  267|  3.37k|    p = pExp;
  268|  3.37k|    if (('E' == *p) ||
  ------------------
  |  Branch (268:9): [True: 548, False: 2.82k]
  ------------------
  269|  3.37k|        ('e' == *p)) {
  ------------------
  |  Branch (269:9): [True: 1.10k, False: 1.71k]
  ------------------
  270|  1.65k|        p += 1;
  271|  1.65k|        if ('-' == *p) {
  ------------------
  |  Branch (271:13): [True: 409, False: 1.24k]
  ------------------
  272|    409|            expSign = true;
  273|    409|            p += 1;
  274|  1.24k|        } else {
  275|  1.24k|            if ('+' == *p) {
  ------------------
  |  Branch (275:17): [True: 194, False: 1.05k]
  ------------------
  276|    194|                p += 1;
  277|    194|            }
  278|  1.24k|            expSign = false;
  279|  1.24k|        }
  280|  2.78k|        while (isdigit((int) *p)) {
  281|  2.78k|            exp = exp * 10 + (*p - '0');
  282|  2.78k|            if (1024 < exp) {
  ------------------
  |  Branch (282:17): [True: 397, False: 2.38k]
  ------------------
  283|    397|                if (true == expSign) {
  ------------------
  |  Branch (283:21): [True: 201, False: 196]
  ------------------
  284|       |                    // exponent underflow!
  285|    201|                    return 0.0;
  286|    201|                } // else  exponent overflow!
  287|    196|                return INFINITY;
  288|    397|            }
  289|  2.38k|            p += 1;
  290|  2.38k|        }
  291|  1.65k|    }
  292|  2.97k|    if (expSign) {
  ------------------
  |  Branch (292:9): [True: 208, False: 2.76k]
  ------------------
  293|    208|        exp = fracExp - exp;
  294|  2.76k|    } else {
  295|  2.76k|        exp = fracExp + exp;
  296|  2.76k|    }
  297|       |
  298|       |    /*
  299|       |     * Generate a floating-point number that represents the exponent.
  300|       |     * Do this by processing the exponent one bit at a time to combine
  301|       |     * many powers of 2 of 10. Then combine the exponent with the
  302|       |     * fraction.
  303|       |     */
  304|       |
  305|  2.97k|    if (0 > exp) {
  ------------------
  |  Branch (305:9): [True: 436, False: 2.53k]
  ------------------
  306|    436|        expSign = true;
  307|    436|        exp = -exp;
  308|  2.53k|    } else {
  309|  2.53k|        expSign = false;
  310|  2.53k|    }
  311|  2.97k|    if (exp > maxExponent) {
  ------------------
  |  Branch (311:9): [True: 226, False: 2.74k]
  ------------------
  312|    226|        exp = maxExponent;
  313|    226|        errno = ERANGE;
  314|    226|    }
  315|  2.97k|    dblExp = 1.0;
  316|  7.25k|    for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
  ------------------
  |  Branch (316:26): [True: 4.28k, False: 2.97k]
  ------------------
  317|  4.28k|        if (exp & 01) {
  ------------------
  |  Branch (317:13): [True: 3.43k, False: 845]
  ------------------
  318|  3.43k|            dblExp *= *d;
  319|  3.43k|        }
  320|  4.28k|    }
  321|  2.97k|    if (expSign) {
  ------------------
  |  Branch (321:9): [True: 436, False: 2.53k]
  ------------------
  322|    436|        fraction /= dblExp;
  323|  2.53k|    } else {
  324|  2.53k|        fraction *= dblExp;
  325|  2.53k|    }
  326|       |
  327|  3.96k|done:
  328|  3.96k|    if (sign) {
  ------------------
  |  Branch (328:9): [True: 392, False: 3.57k]
  ------------------
  329|    392|        return -fraction;
  330|    392|    }
  331|  3.57k|    return fraction;
  332|  3.96k|}
mkgmtime:
  641|  2.10k|{
  642|  2.10k|    int year;
  643|  2.10k|    time_t result;
  644|  2.10k|    static const int cumdays[MONTHSPERYEAR] =
  645|  2.10k|        { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
  646|       |
  647|  2.10k|    year = 1900 + t->tm_year + t->tm_mon / MONTHSPERYEAR;
  ------------------
  |  |  334|  2.10k|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  648|  2.10k|    result = (year - 1970) * 365 + cumdays[t->tm_mon % MONTHSPERYEAR];
  ------------------
  |  |  334|  2.10k|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  649|  2.10k|    result += (year - 1968) / 4;
  650|  2.10k|    result -= (year - 1900) / 100;
  651|  2.10k|    result += (year - 1600) / 400;
  652|  2.10k|    if (0 == (year % 4) &&
  ------------------
  |  Branch (652:9): [True: 1.43k, False: 675]
  ------------------
  653|  2.10k|        (0 != (year % 100) ||
  ------------------
  |  Branch (653:10): [True: 369, False: 1.06k]
  ------------------
  654|  1.43k|         0 == (year % 400)) &&
  ------------------
  |  Branch (654:10): [True: 604, False: 461]
  ------------------
  655|  2.10k|        (2 > (t->tm_mon % MONTHSPERYEAR))) {
  ------------------
  |  |  334|    973|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  |  Branch (655:9): [True: 590, False: 383]
  ------------------
  656|    590|        result--;
  657|    590|    }
  658|  2.10k|    result += t->tm_mday - 1;
  659|  2.10k|    result *= 24;
  660|  2.10k|    result += t->tm_hour;
  661|  2.10k|    result *= 60;
  662|  2.10k|    result += t->tm_min;
  663|  2.10k|    result *= 60;
  664|  2.10k|    result += t->tm_sec;
  665|       |    /* this is UTC, no DST
  666|       |     * if (t->tm_isdst == 1)
  667|       |     * result -= 3600;
  668|       |     */
  669|  2.10k|    return (result);
  670|  2.10k|}
iso8601_to_timespec:
  674|  2.10k|{
  675|  2.10k|    timespec_t ret;
  676|       |
  677|  2.10k|#ifndef __clang_analyzer__
  678|       |#ifdef USE_QT
  679|       |    double usec = 0;
  680|       |
  681|       |    QString t(isotime);
  682|       |    QDateTime d = QDateTime::fromString(isotime, Qt::ISODate);
  683|       |    QStringList sl = t.split(".");
  684|       |    if (1 < sl.size()) {
  685|       |        usec = sl[1].toInt() / pow(10., (double)sl[1].size());
  686|       |    }
  687|       |    ret.tv_sec = d.toTime_t();
  688|       |    ret.tv_nsec = usec * 1e9;
  689|       |#else  // USE_QT
  690|  2.10k|    double usec = 0;
  691|  2.10k|    struct tm tm = {0};
  692|       |
  693|  2.10k|    {
  694|  2.10k|        char *dp = NULL;
  695|  2.10k|        dp = strptime(isotime, "%Y-%m-%dT%H:%M:%S", &tm);
  696|  2.10k|        if (NULL != dp &&
  ------------------
  |  Branch (696:13): [True: 634, False: 1.47k]
  ------------------
  697|  2.10k|            '.' == *dp) {
  ------------------
  |  Branch (697:13): [True: 203, False: 431]
  ------------------
  698|    203|            usec = strtod(dp, NULL);
  699|    203|        }
  700|  2.10k|    }
  701|       |
  702|       |    /*
  703|       |     * It would be nice if we could say mktime(&tm) - timezone + usec instead,
  704|       |     * but timezone is not available at all on some BSDs. Besides, when working
  705|       |     * with historical dates the value of timezone after an ordinary tzset(3)
  706|       |     * can be wrong; you have to do a redirect through the IANA historical
  707|       |     * timezone database to get it right.
  708|       |     */
  709|  2.10k|    ret.tv_sec = mkgmtime(&tm);
  710|  2.10k|    ret.tv_nsec = usec * 1e9;
  711|  2.10k|#endif  // USE_QT
  712|  2.10k|#endif  // __clang_analyzer__
  713|       |
  714|  2.10k|#if 4 < SIZEOF_TIME_T
  715|  2.10k|    if (253402300799LL < ret.tv_sec) {
  ------------------
  |  Branch (715:9): [True: 209, False: 1.90k]
  ------------------
  716|       |        // enforce max "9999-12-31T23:59:59.999Z"
  717|    209|        ret.tv_sec = 253402300799LL;
  718|    209|    }
  719|  2.10k|#endif
  720|  2.10k|    return ret;
  721|  2.10k|}

gps_hexpack:
  119|    109|{
  120|    109|    ssize_t i, j;
  121|       |
  122|    109|    j = strnlen(src, BUFSIZ) / 2;
  123|    109|    if ((1 > j) ||
  ------------------
  |  Branch (123:9): [True: 2, False: 107]
  ------------------
  124|    109|        ((size_t)j > len)) {
  ------------------
  |  Branch (124:9): [True: 11, False: 96]
  ------------------
  125|     13|        return -2;
  126|     13|    }
  127|       |
  128|    415|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (128:17): [True: 373, False: 42]
  ------------------
  129|    373|        int k;
  130|    373|        if (-1 == (k = hex2bin(src + i * 2))) {
  ------------------
  |  Branch (130:13): [True: 54, False: 319]
  ------------------
  131|     54|            return -1;
  132|     54|        }
  133|    319|        dst[i] = (char)(k & 0xff);
  134|    319|    }
  135|     42|    (void)memset(dst + i, '\0', (size_t)(len - i));
  136|     42|    return j;
  137|     96|}
hex.c:hex2bin:
   82|    373|{
   83|    373|    int a, b;
   84|       |
   85|    373|    a = s[0] & 0xff;
   86|    373|    b = s[1] & 0xff;
   87|       |
   88|    373|    if ((a >= 'a') &&
  ------------------
  |  Branch (88:9): [True: 114, False: 259]
  ------------------
   89|    373|        (a <= 'f')) {
  ------------------
  |  Branch (89:9): [True: 107, False: 7]
  ------------------
   90|    107|        a = a + 10 - 'a';
   91|    266|    } else if ((a >= 'A') &&
  ------------------
  |  Branch (91:16): [True: 133, False: 133]
  ------------------
   92|    266|               (a <= 'F')) {
  ------------------
  |  Branch (92:16): [True: 121, False: 12]
  ------------------
   93|    121|        a = a + 10 - 'A';
   94|    145|    } else if ((a >= '0') &&
  ------------------
  |  Branch (94:16): [True: 136, False: 9]
  ------------------
   95|    145|               (a <= '9')) {
  ------------------
  |  Branch (95:16): [True: 119, False: 17]
  ------------------
   96|    119|        a -= '0';
   97|    119|    } else {
   98|     26|        return -1;
   99|     26|    }
  100|       |
  101|    347|    if ((b >= 'a') &&
  ------------------
  |  Branch (101:9): [True: 103, False: 244]
  ------------------
  102|    347|        (b <= 'f')) {
  ------------------
  |  Branch (102:9): [True: 94, False: 9]
  ------------------
  103|     94|        b = b + 10 - 'a';
  104|    253|    } else if ((b >= 'A') &&
  ------------------
  |  Branch (104:16): [True: 128, False: 125]
  ------------------
  105|    253|               (b <= 'F')) {
  ------------------
  |  Branch (105:16): [True: 113, False: 15]
  ------------------
  106|    113|        b = b + 10 - 'A';
  107|    140|    } else if ((b >= '0') &&
  ------------------
  |  Branch (107:16): [True: 131, False: 9]
  ------------------
  108|    140|               (b <= '9')) {
  ------------------
  |  Branch (108:16): [True: 112, False: 19]
  ------------------
  109|    112|        b -= '0';
  110|    112|    } else {
  111|     28|        return -1;
  112|     28|    }
  113|       |
  114|    319|    return ((a << 4) + b);
  115|    347|}

json_read_array:
  746|  1.16k|{
  747|  1.16k|    int substatus, offset, arrcount;
  748|  1.16k|    char *tp;
  749|       |
  750|  1.16k|    if (NULL != end)
  ------------------
  |  Branch (750:9): [True: 1.16k, False: 0]
  ------------------
  751|  1.16k|        *end = NULL;    // give it a well-defined value on parse failure
  752|       |
  753|  1.16k|    json_debug_trace((1, "Entered json_read_array()\n"));
  ------------------
  |  |  110|  1.16k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  754|       |
  755|  1.16k|    while (isspace((unsigned char)*cp)) {
  756|      0|        cp++;
  757|      0|    }
  758|  1.16k|    if (*cp != '[') {
  ------------------
  |  Branch (758:9): [True: 0, False: 1.16k]
  ------------------
  759|      0|        json_debug_trace((1, "Didn't find expected array start\n"));
  ------------------
  |  |  110|      0|#define json_debug_trace(args) (void) json_trace args
  ------------------
  760|      0|        return JSON_ERR_ARRAYSTART;
  ------------------
  |  |  161|      0|#define JSON_ERR_ARRAYSTART    10      // didn't find expected array start
  ------------------
  761|      0|    }
  762|  1.16k|    cp++;
  763|       |
  764|  1.16k|    tp = arr->arr.strings.store;
  765|  1.16k|    arrcount = 0;
  766|       |
  767|       |    // Check for empty array
  768|  1.16k|    while (isspace((unsigned char)*cp)) {
  769|    396|        cp++;
  770|    396|    }
  771|  1.16k|    if (*cp == ']') {
  ------------------
  |  Branch (771:9): [True: 451, False: 717]
  ------------------
  772|    451|        goto breakout;
  773|    451|    }
  774|       |
  775|  8.51k|    for (offset = 0; offset < arr->maxlen; offset++) {
  ------------------
  |  Branch (775:22): [True: 8.51k, False: 1]
  ------------------
  776|  8.51k|        char *ep = NULL;
  777|       |
  778|  8.51k|        json_debug_trace((1, "Looking at %s\n", cp));
  ------------------
  |  |  110|  8.51k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  779|  8.51k|        switch (arr->element_type) {
  ------------------
  |  Branch (779:17): [True: 0, False: 8.51k]
  ------------------
  780|  3.11k|        case t_string:
  ------------------
  |  Branch (780:9): [True: 3.11k, False: 5.39k]
  ------------------
  781|  3.11k|            if (isspace((unsigned char) *cp)) {
  782|    196|                cp++;
  783|    196|            }
  784|  3.11k|            if (*cp != '"') {
  ------------------
  |  Branch (784:17): [True: 15, False: 3.10k]
  ------------------
  785|     15|                return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     15|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  786|  3.10k|            } else {
  787|  3.10k|                ++cp;
  788|  3.10k|            }
  789|  3.10k|            arr->arr.strings.ptrs[offset] = tp;
  790|  14.0k|            for (; tp - arr->arr.strings.store < arr->arr.strings.storelen;
  ------------------
  |  Branch (790:20): [True: 14.0k, False: 3]
  ------------------
  791|  10.9k|                 tp++)
  792|  14.0k|                if (*cp == '"') {
  ------------------
  |  Branch (792:21): [True: 3.09k, False: 10.9k]
  ------------------
  793|  3.09k|                    ++cp;
  794|  3.09k|                    *tp++ = '\0';
  795|  3.09k|                    goto stringend;
  796|  10.9k|                } else if (*cp == '\0') {
  ------------------
  |  Branch (796:28): [True: 1, False: 10.9k]
  ------------------
  797|      1|                    json_debug_trace((1,
  ------------------
  |  |  110|      1|#define json_debug_trace(args) (void) json_trace args
  ------------------
  798|      1|                                      "Bad string syntax in string list.\n"));
  799|      1|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      1|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  800|  10.9k|                } else {
  801|  10.9k|                    *tp = *cp++;
  802|  10.9k|                }
  803|      3|            json_debug_trace((1, "Bad string syntax in string list.\n"));
  ------------------
  |  |  110|      3|#define json_debug_trace(args) (void) json_trace args
  ------------------
  804|      3|            return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      3|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  805|  3.09k|          stringend:
  806|  3.09k|            break;
  807|      0|        case t_object:
  ------------------
  |  Branch (807:9): [True: 0, False: 8.51k]
  ------------------
  808|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  809|  5.39k|        case t_structobject:
  ------------------
  |  Branch (809:9): [True: 5.39k, False: 3.11k]
  ------------------
  810|  5.39k|            substatus =
  811|  5.39k|                json_internal_read_object(cp, arr->arr.objects.subtype, arr,
  812|  5.39k|                                          offset, &cp);
  813|  5.39k|            if (substatus != 0) {
  ------------------
  |  Branch (813:17): [True: 116, False: 5.28k]
  ------------------
  814|    116|                if (NULL != end) {
  ------------------
  |  Branch (814:21): [True: 116, False: 0]
  ------------------
  815|    116|                    *end = cp;
  816|    116|                }
  817|    116|                return substatus;
  818|    116|            }
  819|  5.28k|            break;
  820|  5.28k|        case t_integer:
  ------------------
  |  Branch (820:9): [True: 0, False: 8.51k]
  ------------------
  821|      0|            arr->arr.integers.store[offset] = (int)strtol(cp, &ep, 0);
  822|      0|            if (ep == cp) {
  ------------------
  |  Branch (822:17): [True: 0, False: 0]
  ------------------
  823|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  824|      0|            }
  825|      0|            cp = ep;
  826|      0|            break;
  827|      0|        case t_uinteger:
  ------------------
  |  Branch (827:9): [True: 0, False: 8.51k]
  ------------------
  828|      0|            arr->arr.uintegers.store[offset] = (unsigned int)strtoul(cp,
  829|      0|                                                                     &ep, 0);
  830|      0|            if (ep == cp) {
  ------------------
  |  Branch (830:17): [True: 0, False: 0]
  ------------------
  831|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  832|      0|            }
  833|      0|            cp = ep;
  834|      0|            break;
  835|      0|        case t_longint:
  ------------------
  |  Branch (835:9): [True: 0, False: 8.51k]
  ------------------
  836|      0|            arr->arr.longint.store[offset] = strtol(cp, &ep, 0);
  837|      0|            if (ep == cp) {
  ------------------
  |  Branch (837:17): [True: 0, False: 0]
  ------------------
  838|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  839|      0|            }
  840|      0|            cp = ep;
  841|      0|            break;
  842|      0|        case t_ulongint:
  ------------------
  |  Branch (842:9): [True: 0, False: 8.51k]
  ------------------
  843|      0|            arr->arr.ulongint.store[offset] = strtoul(cp, &ep, 0);
  844|      0|            if (ep == cp) {
  ------------------
  |  Branch (844:17): [True: 0, False: 0]
  ------------------
  845|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  846|      0|            }
  847|      0|            cp = ep;
  848|      0|            break;
  849|      0|        case t_byte:
  ------------------
  |  Branch (849:9): [True: 0, False: 8.51k]
  ------------------
  850|      0|            arr->arr.bytes.store[offset] = (char)strtol(cp, &ep, 0);
  851|      0|            if (ep == cp) {
  ------------------
  |  Branch (851:17): [True: 0, False: 0]
  ------------------
  852|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  853|      0|            }
  854|      0|            cp = ep;
  855|      0|            break;
  856|      0|        case t_ubyte:
  ------------------
  |  Branch (856:9): [True: 0, False: 8.51k]
  ------------------
  857|      0|            arr->arr.ubytes.store[offset] = (unsigned char)strtoul(cp,
  858|      0|                                                                   &ep, 0);
  859|      0|            if (ep == cp) {
  ------------------
  |  Branch (859:17): [True: 0, False: 0]
  ------------------
  860|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  861|      0|            }
  862|      0|            cp = ep;
  863|      0|            break;
  864|      0|        case t_short:
  ------------------
  |  Branch (864:9): [True: 0, False: 8.51k]
  ------------------
  865|      0|            arr->arr.shorts.store[offset] = (short)strtol(cp, &ep, 0);
  866|      0|            if (ep == cp) {
  ------------------
  |  Branch (866:17): [True: 0, False: 0]
  ------------------
  867|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  868|      0|            }
  869|      0|            cp = ep;
  870|      0|            break;
  871|      0|        case t_ushort:
  ------------------
  |  Branch (871:9): [True: 0, False: 8.51k]
  ------------------
  872|      0|            arr->arr.ushorts.store[offset] = (unsigned short)strtoul(cp,
  873|      0|                                                                     &ep, 0);
  874|      0|            if (ep == cp) {
  ------------------
  |  Branch (874:17): [True: 0, False: 0]
  ------------------
  875|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  876|      0|            }
  877|      0|            cp = ep;
  878|      0|            break;
  879|      0|        case t_time:
  ------------------
  |  Branch (879:9): [True: 0, False: 8.51k]
  ------------------
  880|      0|            {
  881|      0|                timespec_t ts_tmp;
  882|      0|                if (*cp != '"') {
  ------------------
  |  Branch (882:21): [True: 0, False: 0]
  ------------------
  883|      0|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      0|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  884|      0|                } else {
  885|      0|                    ++cp;
  886|      0|                }
  887|      0|                ts_tmp = iso8601_to_timespec(cp);
  888|      0|                arr->arr.timespecs.store[offset] = ts_tmp;
  889|      0|                while (*cp &&
  ------------------
  |  Branch (889:24): [True: 0, False: 0]
  ------------------
  890|      0|                       *cp != '"') {
  ------------------
  |  Branch (890:24): [True: 0, False: 0]
  ------------------
  891|      0|                    cp++;
  892|      0|                }
  893|      0|                if (*cp != '"') {
  ------------------
  |  Branch (893:21): [True: 0, False: 0]
  ------------------
  894|      0|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      0|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  895|      0|                }
  896|      0|                ++cp;
  897|      0|            }
  898|      0|            break;
  899|      0|        case t_timespec:
  ------------------
  |  Branch (899:9): [True: 0, False: 8.51k]
  ------------------
  900|       |            // TODO not sure how to implement this
  901|      0|            return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  902|      0|            break;
  903|      0|        case t_real:
  ------------------
  |  Branch (903:9): [True: 0, False: 8.51k]
  ------------------
  904|      0|            arr->arr.reals.store[offset] = strtod(cp, &ep);
  905|      0|            if (ep == cp) {
  ------------------
  |  Branch (905:17): [True: 0, False: 0]
  ------------------
  906|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  907|      0|            }
  908|      0|            cp = ep;
  909|      0|            break;
  910|      0|        case t_boolean:
  ------------------
  |  Branch (910:9): [True: 0, False: 8.51k]
  ------------------
  911|      0|            if (str_starts_with(cp, "true")) {
  ------------------
  |  Branch (911:17): [True: 0, False: 0]
  ------------------
  912|      0|                arr->arr.booleans.store[offset] = true;
  913|      0|                cp += 4;
  914|      0|            } else if (str_starts_with(cp, "false")) {
  ------------------
  |  Branch (914:24): [True: 0, False: 0]
  ------------------
  915|      0|                arr->arr.booleans.store[offset] = false;
  916|      0|                cp += 5;
  917|      0|            }
  918|      0|            break;
  919|      0|        case t_character:
  ------------------
  |  Branch (919:9): [True: 0, False: 8.51k]
  ------------------
  920|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  921|      0|        case t_array:
  ------------------
  |  Branch (921:9): [True: 0, False: 8.51k]
  ------------------
  922|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  923|      0|        case t_check:
  ------------------
  |  Branch (923:9): [True: 0, False: 8.51k]
  ------------------
  924|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  925|      0|        case t_ignore:
  ------------------
  |  Branch (925:9): [True: 0, False: 8.51k]
  ------------------
  926|      0|            json_debug_trace((1, "Invalid array subtype.\n"));
  ------------------
  |  |  110|      0|#define json_debug_trace(args) (void) json_trace args
  ------------------
  927|      0|            return JSON_ERR_SUBTYPE;
  ------------------
  |  |  165|      0|#define JSON_ERR_SUBTYPE       14      // unsupported array element type
  ------------------
  928|  8.51k|        }
  929|  8.38k|        arrcount++;
  930|  8.38k|        if (isspace((unsigned char)*cp)) {
  931|    194|            cp++;
  932|    194|        }
  933|  8.38k|        if (*cp == ']') {
  ------------------
  |  Branch (933:13): [True: 405, False: 7.97k]
  ------------------
  934|    405|            json_debug_trace((1, "End of array found.\n"));
  ------------------
  |  |  110|    405|#define json_debug_trace(args) (void) json_trace args
  ------------------
  935|    405|            goto breakout;
  936|    405|        }
  937|  7.97k|        if (*cp == ',') {
  ------------------
  |  Branch (937:13): [True: 7.79k, False: 176]
  ------------------
  938|  7.79k|            cp++;
  939|  7.79k|        } else {
  940|    176|            json_debug_trace((1, "Bad trailing syntax on array.\n"));
  ------------------
  |  |  110|    176|#define json_debug_trace(args) (void) json_trace args
  ------------------
  941|    176|            return JSON_ERR_BADSUBTRAIL;
  ------------------
  |  |  164|    176|#define JSON_ERR_BADSUBTRAIL   13      // garbage while expecting array comma
  ------------------
  942|    176|        }
  943|  7.97k|    }
  944|      1|    json_debug_trace((1, "Too many elements in array.\n"));
  ------------------
  |  |  110|      1|#define json_debug_trace(args) (void) json_trace args
  ------------------
  945|      1|    if (NULL != end) {
  ------------------
  |  Branch (945:9): [True: 1, False: 0]
  ------------------
  946|      1|        *end = cp;
  947|      1|    }
  948|      1|    return JSON_ERR_SUBTOOLONG;
  ------------------
  |  |  163|      1|#define JSON_ERR_SUBTOOLONG    12      // too many array elements
  ------------------
  949|    856|  breakout:
  950|    856|    if (NULL != arr->count) {
  ------------------
  |  Branch (950:9): [True: 856, False: 0]
  ------------------
  951|    856|        *(arr->count) = arrcount;
  952|    856|    }
  953|    856|    if (NULL != end) {
  ------------------
  |  Branch (953:9): [True: 856, False: 0]
  ------------------
  954|    856|        *end = cp;
  955|    856|    }
  956|    856|    json_debug_trace((1, "leaving json_read_array() with %d elements\n",
  ------------------
  |  |  110|    856|#define json_debug_trace(args) (void) json_trace args
  ------------------
  957|    856|                      arrcount));
  958|    856|    return 0;
  959|    717|}
json_read_object:
  963|  4.78k|{
  964|  4.78k|    int st;
  965|       |
  966|  4.78k|    json_debug_trace((1, "json_read_object() sees '%s'\n", cp));
  ------------------
  |  |  110|  4.78k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  967|  4.78k|    st = json_internal_read_object(cp, attrs, NULL, 0, end);
  968|  4.78k|    return st;
  969|  4.78k|}
json.c:json_trace:
   95|  1.18M|{
   96|  1.18M|    if (errlevel <= debuglevel &&
  ------------------
  |  Branch (96:9): [True: 0, False: 1.18M]
  ------------------
   97|  1.18M|        NULL != debugfp) {
  ------------------
  |  Branch (97:9): [True: 0, False: 0]
  ------------------
   98|      0|        char buf[BUFSIZ] = {0};
   99|      0|        va_list ap;
  100|       |
  101|      0|        (void)strlcpy(buf, "json: ", sizeof(buf));
  102|      0|        va_start(ap, fmt);
  103|      0|        str_vappendf(buf, sizeof(buf), fmt, ap);
  104|      0|        va_end(ap);
  105|       |
  106|      0|        (void)fputs(buf, debugfp);
  107|      0|    }
  108|  1.18M|}
json.c:json_internal_read_object:
  187|  10.1k|{
  188|  10.1k|    enum
  189|  10.1k|    { init, await_attr, in_attr, await_value, in_val_string,
  190|  10.1k|        in_escape, in_val_token, post_val, post_element
  191|  10.1k|    } state = 0;
  192|  10.1k|    char *statenames[] = {
  193|  10.1k|        "init", "await_attr", "in_attr", "await_value", "in_val_string",
  194|  10.1k|        "in_escape", "in_val_token", "post_val", "post_element",
  195|  10.1k|    };
  196|  10.1k|    char attrbuf[JSON_ATTR_MAX + 1], *pattr = NULL;
  197|  10.1k|    char valbuf[JSON_VAL_MAX + 1], *pval = NULL;
  198|  10.1k|    bool value_quoted = false;
  199|  10.1k|    char uescape[5];            // enough space for 4 hex digits and a NUL
  200|  10.1k|    const struct json_attr_t *cursor;
  201|  10.1k|    int substatus, maxlen = 0;
  202|  10.1k|    unsigned int u;
  203|  10.1k|    const struct json_enum_t *mp;
  204|  10.1k|    char *lptr;
  205|       |
  206|  10.1k|    if (NULL != end) {
  ------------------
  |  Branch (206:9): [True: 5.39k, False: 4.78k]
  ------------------
  207|  5.39k|        *end = NULL;    // give it a well-defined value on parse failure
  208|  5.39k|    }
  209|       |
  210|       |    // stuff fields with defaults in case they're omitted in the JSON input
  211|   147k|    for (cursor = attrs; cursor->attribute != NULL; cursor++)
  ------------------
  |  Branch (211:26): [True: 137k, False: 10.1k]
  ------------------
  212|   137k|        if (!cursor->nodefault) {
  ------------------
  |  Branch (212:13): [True: 137k, False: 159]
  ------------------
  213|   137k|            lptr = json_target_address(cursor, parent, offset);
  214|   137k|            if (NULL != lptr)
  ------------------
  |  Branch (214:17): [True: 127k, False: 9.57k]
  ------------------
  215|   127k|                switch (cursor->type) {
  ------------------
  |  Branch (215:25): [True: 0, False: 127k]
  ------------------
  216|  3.07k|                case t_byte:
  ------------------
  |  Branch (216:17): [True: 3.07k, False: 124k]
  ------------------
  217|  3.07k|                    lptr[0] = cursor->dflt.byte;
  218|  3.07k|                    break;
  219|  23.0k|                case t_ubyte:
  ------------------
  |  Branch (219:17): [True: 23.0k, False: 104k]
  ------------------
  220|  23.0k|                    lptr[0] = cursor->dflt.ubyte;
  221|  23.0k|                    break;
  222|  15.1k|                case t_integer:
  ------------------
  |  Branch (222:17): [True: 15.1k, False: 112k]
  ------------------
  223|  15.1k|                    memcpy(lptr, &cursor->dflt.integer, sizeof(int));
  224|  15.1k|                    break;
  225|  7.86k|                case t_uinteger:
  ------------------
  |  Branch (225:17): [True: 7.86k, False: 119k]
  ------------------
  226|  7.86k|                    memcpy(lptr, &cursor->dflt.uinteger, sizeof(unsigned int));
  227|  7.86k|                    break;
  228|      0|                case t_longint:
  ------------------
  |  Branch (228:17): [True: 0, False: 127k]
  ------------------
  229|      0|                    memcpy(lptr, &cursor->dflt.longint, sizeof(long));
  230|      0|                    break;
  231|    116|                case t_ulongint:
  ------------------
  |  Branch (231:17): [True: 116, False: 127k]
  ------------------
  232|    116|                    memcpy(lptr, &cursor->dflt.ulongint,
  233|    116|                           sizeof(unsigned long));
  234|    116|                    break;
  235|  3.07k|                case t_short:
  ------------------
  |  Branch (235:17): [True: 3.07k, False: 124k]
  ------------------
  236|  3.07k|                    memcpy(lptr, &cursor->dflt.shortint, sizeof(short));
  237|  3.07k|                    break;
  238|      0|                case t_ushort:
  ------------------
  |  Branch (238:17): [True: 0, False: 127k]
  ------------------
  239|      0|                    memcpy(lptr, &cursor->dflt.ushortint,
  240|      0|                           sizeof(unsigned short));
  241|      0|                    break;
  242|  1.44k|                case t_time:
  ------------------
  |  Branch (242:17): [True: 1.44k, False: 126k]
  ------------------
  243|  1.44k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  244|  1.44k|                    break;
  245|  1.03k|                case t_timespec:
  ------------------
  |  Branch (245:17): [True: 1.03k, False: 126k]
  ------------------
  246|  1.03k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  247|  1.03k|                    break;
  248|  50.8k|                case t_real:
  ------------------
  |  Branch (248:17): [True: 50.8k, False: 76.6k]
  ------------------
  249|  50.8k|                    memcpy(lptr, &cursor->dflt.real, sizeof(double));
  250|  50.8k|                    break;
  251|  10.7k|                case t_string:
  ------------------
  |  Branch (251:17): [True: 10.7k, False: 116k]
  ------------------
  252|  10.7k|                    if (parent != NULL
  ------------------
  |  Branch (252:25): [True: 4.90k, False: 5.83k]
  ------------------
  253|  10.7k|                        && parent->element_type != t_structobject
  ------------------
  |  Branch (253:28): [True: 0, False: 4.90k]
  ------------------
  254|  10.7k|                        && offset > 0)
  ------------------
  |  Branch (254:28): [True: 0, False: 0]
  ------------------
  255|      0|                        return JSON_ERR_NOPARSTR;
  ------------------
  |  |  168|      0|#define JSON_ERR_NOPARSTR      17      // no strings in parallel arrays
  ------------------
  256|  10.7k|                    lptr[0] = '\0';
  257|  10.7k|                    break;
  258|  4.21k|                case t_boolean:
  ------------------
  |  Branch (258:17): [True: 4.21k, False: 123k]
  ------------------
  259|  4.21k|                    memcpy(lptr, &cursor->dflt.boolean, sizeof(bool));
  260|  4.21k|                    break;
  261|  1.00k|                case t_character:
  ------------------
  |  Branch (261:17): [True: 1.00k, False: 126k]
  ------------------
  262|  1.00k|                    lptr[0] = cursor->dflt.character;
  263|  1.00k|                    break;
  264|      0|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (264:17): [True: 0, False: 127k]
  ------------------
  265|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  266|      0|                case t_structobject:
  ------------------
  |  Branch (266:17): [True: 0, False: 127k]
  ------------------
  267|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  268|      0|                case t_array:
  ------------------
  |  Branch (268:17): [True: 0, False: 127k]
  ------------------
  269|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  270|    518|                case t_check:
  ------------------
  |  Branch (270:17): [True: 518, False: 127k]
  ------------------
  271|    518|                    FALLTHROUGH
  ------------------
  |  |   55|    518|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  272|  5.90k|                case t_ignore:
  ------------------
  |  Branch (272:17): [True: 5.38k, False: 122k]
  ------------------
  273|  5.90k|                    break;
  274|   127k|                }
  275|   137k|        }
  276|       |
  277|  10.1k|    json_debug_trace((1, "JSON parse of '%s' begins.\n", cp));
  ------------------
  |  |  110|  10.1k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  278|       |
  279|       |    // parse input JSON
  280|   474k|    for (; *cp != '\0'; cp++) {
  ------------------
  |  Branch (280:12): [True: 472k, False: 2.12k]
  ------------------
  281|   472k|        json_debug_trace((2, "State %-14s, looking at '%c' (%p)\n",
  ------------------
  |  |  110|   472k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  282|   472k|                          statenames[state], *cp, cp));
  283|   472k|        switch (state) {
  ------------------
  |  Branch (283:17): [True: 0, False: 472k]
  ------------------
  284|  10.5k|        case init:
  ------------------
  |  Branch (284:9): [True: 10.5k, False: 462k]
  ------------------
  285|  10.5k|            if (isspace((unsigned char) *cp)) {
  286|    411|                continue;
  287|    411|            }
  288|  10.1k|            if (*cp == '{') {
  ------------------
  |  Branch (288:17): [True: 10.1k, False: 29]
  ------------------
  289|  10.1k|                state = await_attr;
  290|  10.1k|            } else {
  291|     29|                json_debug_trace((1,
  ------------------
  |  |  110|     29|#define json_debug_trace(args) (void) json_trace args
  ------------------
  292|     29|                                  "Non-WS when expecting object start.\n"));
  293|     29|                if (NULL != end) {
  ------------------
  |  Branch (293:21): [True: 29, False: 0]
  ------------------
  294|     29|                    *end = cp;
  295|     29|                }
  296|     29|                return JSON_ERR_OBSTART;
  ------------------
  |  |  152|     29|#define JSON_ERR_OBSTART        1      // non-WS when expecting object start
  ------------------
  297|     29|            }
  298|  10.1k|            break;
  299|  39.9k|        case await_attr:
  ------------------
  |  Branch (299:9): [True: 39.9k, False: 432k]
  ------------------
  300|  39.9k|            if (isspace((unsigned char) *cp)) {
  301|    208|                continue;
  302|    208|            }
  303|  39.7k|            if (*cp == '"') {
  ------------------
  |  Branch (303:17): [True: 39.3k, False: 319]
  ------------------
  304|  39.3k|                state = in_attr;
  305|  39.3k|                pattr = attrbuf;
  306|  39.3k|                if (NULL != end) {
  ------------------
  |  Branch (306:21): [True: 7.12k, False: 32.2k]
  ------------------
  307|  7.12k|                    *end = cp;
  308|  7.12k|                }
  309|  39.3k|            } else if (*cp == '}') {
  ------------------
  |  Branch (309:24): [True: 205, False: 114]
  ------------------
  310|    205|                break;
  311|    205|            } else {
  312|    114|                json_debug_trace((1, "Non-WS when expecting attribute.\n"));
  ------------------
  |  |  110|    114|#define json_debug_trace(args) (void) json_trace args
  ------------------
  313|    114|                if (NULL != end) {
  ------------------
  |  Branch (313:21): [True: 1, False: 113]
  ------------------
  314|      1|                    *end = cp;
  315|      1|                }
  316|    114|                return JSON_ERR_ATTRSTART;
  ------------------
  |  |  153|    114|#define JSON_ERR_ATTRSTART      2      // non-WS when expecting attrib start
  ------------------
  317|    114|            }
  318|  39.3k|            break;
  319|   158k|        case in_attr:
  ------------------
  |  Branch (319:9): [True: 158k, False: 314k]
  ------------------
  320|   158k|            if (NULL == pattr) {
  ------------------
  |  Branch (320:17): [True: 0, False: 158k]
  ------------------
  321|       |                // don't update end here, leave at attribute start
  322|      0|                return JSON_ERR_NULLPTR;
  ------------------
  |  |  174|      0|#define JSON_ERR_NULLPTR       23      // unexpected null value or attribute
  ------------------
  323|      0|            }
  324|   158k|            if (*cp == '"') {
  ------------------
  |  Branch (324:17): [True: 39.3k, False: 118k]
  ------------------
  325|  39.3k|                *pattr++ = '\0';
  326|  39.3k|                json_debug_trace((1, "Collected attribute name %s\n",
  ------------------
  |  |  110|  39.3k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  327|  39.3k|                                  attrbuf));
  328|   428k|                for (cursor = attrs; cursor->attribute != NULL; cursor++) {
  ------------------
  |  Branch (328:38): [True: 428k, False: 59]
  ------------------
  329|   428k|                    json_debug_trace((2, "Checking against %s\n",
  ------------------
  |  |  110|   428k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  330|   428k|                                      cursor->attribute));
  331|   428k|                    if (strcmp(cursor->attribute, attrbuf) == 0) {
  ------------------
  |  Branch (331:25): [True: 26.9k, False: 401k]
  ------------------
  332|  26.9k|                        break;
  333|  26.9k|                    }
  334|   401k|                    if (cursor->type == t_ignore &&
  ------------------
  |  Branch (334:25): [True: 12.5k, False: 389k]
  ------------------
  335|   401k|                        strncmp(cursor->attribute, "", 1) == 0) {
  ------------------
  |  Branch (335:25): [True: 12.3k, False: 235]
  ------------------
  336|  12.3k|                        break;
  337|  12.3k|                    }
  338|   401k|                }
  339|  39.3k|                if (NULL == cursor->attribute) {
  ------------------
  |  Branch (339:21): [True: 59, False: 39.2k]
  ------------------
  340|     59|                    json_debug_trace((1,
  ------------------
  |  |  110|     59|#define json_debug_trace(args) (void) json_trace args
  ------------------
  341|     59|                                      "Unknown attribute name '%s'"
  342|     59|                                      " (attributes begin with '%s').\n",
  343|     59|                                      attrbuf, attrs->attribute));
  344|       |                    // don't update end here, leave at attribute start
  345|     59|                    return JSON_ERR_BADATTR;
  ------------------
  |  |  154|     59|#define JSON_ERR_BADATTR        3      // unknown attribute name
  ------------------
  346|     59|                }
  347|  39.2k|                state = await_value;
  348|  39.2k|                if (cursor->type == t_string) {
  ------------------
  |  Branch (348:21): [True: 1.10k, False: 38.1k]
  ------------------
  349|  1.10k|                    maxlen = (int)cursor->len - 1;
  350|  38.1k|                } else if (cursor->type == t_check) {
  ------------------
  |  Branch (350:28): [True: 1.83k, False: 36.3k]
  ------------------
  351|  1.83k|                    maxlen = (int)strnlen(cursor->dflt.check, JSON_VAL_MAX);
  ------------------
  |  |  135|  1.83k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  352|  36.3k|                } else if (cursor->type == t_time ||
  ------------------
  |  Branch (352:28): [True: 2.32k, False: 34.0k]
  ------------------
  353|  36.3k|                           cursor->type == t_ignore) {
  ------------------
  |  Branch (353:28): [True: 19.4k, False: 14.5k]
  ------------------
  354|  21.7k|                    maxlen = JSON_VAL_MAX;
  ------------------
  |  |  135|  21.7k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  355|  21.7k|                } else if (NULL != cursor->map) {
  ------------------
  |  Branch (355:28): [True: 447, False: 14.1k]
  ------------------
  356|    447|                    maxlen = (int)sizeof(valbuf) - 1;
  357|    447|                }
  358|  39.2k|                pval = valbuf;
  359|   118k|            } else if (pattr >= attrbuf + JSON_ATTR_MAX - 1) {
  ------------------
  |  |  134|   118k|#define JSON_ATTR_MAX   31      // max chars in JSON attribute name
  ------------------
  |  Branch (359:24): [True: 9, False: 118k]
  ------------------
  360|      9|                json_debug_trace((1, "Attribute name too long.\n"));
  ------------------
  |  |  110|      9|#define json_debug_trace(args) (void) json_trace args
  ------------------
  361|       |                // don't update end here, leave at attribute start
  362|      9|                return JSON_ERR_ATTRLEN;
  ------------------
  |  |  155|      9|#define JSON_ERR_ATTRLEN        4      // attribute name too long
  ------------------
  363|   118k|            } else {
  364|   118k|                *pattr++ = *cp;
  365|   118k|            }
  366|   158k|            break;
  367|   158k|        case await_value:
  ------------------
  |  Branch (367:9): [True: 41.4k, False: 431k]
  ------------------
  368|  41.4k|            if (isspace((unsigned char) *cp) ||
  369|  41.4k|                *cp == ':') {
  ------------------
  |  Branch (369:17): [True: 2.00k, False: 39.1k]
  ------------------
  370|  2.22k|                continue;
  371|  2.22k|            }
  372|  39.1k|            if (*cp == '[') {
  ------------------
  |  Branch (372:17): [True: 1.61k, False: 37.5k]
  ------------------
  373|  1.61k|                if (cursor->type != t_array) {
  ------------------
  |  Branch (373:21): [True: 446, False: 1.16k]
  ------------------
  374|    446|                    json_debug_trace((1,
  ------------------
  |  |  110|    446|#define json_debug_trace(args) (void) json_trace args
  ------------------
  375|    446|                                      "Saw [ when not expecting array.\n"));
  376|    446|                    if (NULL != end) {
  ------------------
  |  Branch (376:25): [True: 2, False: 444]
  ------------------
  377|      2|                        *end = cp;
  378|      2|                    }
  379|    446|                    return JSON_ERR_NOARRAY;
  ------------------
  |  |  156|    446|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  ------------------
  380|    446|                }
  381|  1.16k|                substatus = json_read_array(cp, &cursor->addr.array, &cp);
  382|  1.16k|                if (substatus != 0) {
  ------------------
  |  Branch (382:21): [True: 312, False: 856]
  ------------------
  383|    312|                    return substatus;
  384|    312|                }
  385|    856|                state = post_element;
  386|  37.5k|            } else if (cursor->type == t_array) {
  ------------------
  |  Branch (386:24): [True: 1, False: 37.5k]
  ------------------
  387|      1|                json_debug_trace((1,
  ------------------
  |  |  110|      1|#define json_debug_trace(args) (void) json_trace args
  ------------------
  388|      1|                                  "Array element was specified, but no [.\n"));
  389|      1|                if (NULL != end) {
  ------------------
  |  Branch (389:21): [True: 0, False: 1]
  ------------------
  390|      0|                    *end = cp;
  391|      0|                }
  392|      1|                return JSON_ERR_NOBRAK;
  ------------------
  |  |  157|      1|#define JSON_ERR_NOBRAK         6      // array element specified, but no [
  ------------------
  393|  37.5k|            } else if (*cp == '"') {
  ------------------
  |  Branch (393:24): [True: 9.42k, False: 28.1k]
  ------------------
  394|  9.42k|                value_quoted = true;
  395|  9.42k|                state = in_val_string;
  396|  9.42k|                pval = valbuf;
  397|  28.1k|            } else {
  398|  28.1k|                value_quoted = false;
  399|  28.1k|                state = in_val_token;
  400|  28.1k|                pval = valbuf;
  401|  28.1k|                *pval++ = *cp;
  402|  28.1k|            }
  403|  38.4k|            break;
  404|  65.0k|        case in_val_string:
  ------------------
  |  Branch (404:9): [True: 65.0k, False: 407k]
  ------------------
  405|  65.0k|            if (NULL == pval) {
  ------------------
  |  Branch (405:17): [True: 0, False: 65.0k]
  ------------------
  406|       |                // don't update end here, leave at value start
  407|      0|                return JSON_ERR_NULLPTR;
  ------------------
  |  |  174|      0|#define JSON_ERR_NULLPTR       23      // unexpected null value or attribute
  ------------------
  408|      0|            }
  409|  65.0k|            if (*cp == '\\') {
  ------------------
  |  Branch (409:17): [True: 1.89k, False: 63.2k]
  ------------------
  410|  1.89k|                state = in_escape;
  411|  63.2k|            } else if (*cp == '"') {
  ------------------
  |  Branch (411:24): [True: 8.96k, False: 54.2k]
  ------------------
  412|  8.96k|                *pval++ = '\0';
  413|  8.96k|                json_debug_trace((1, "Collected string value %s\n", valbuf));
  ------------------
  |  |  110|  8.96k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  414|  8.96k|                state = post_val;
  415|  54.2k|            } else if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  54.2k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (415:24): [True: 3, False: 54.2k]
  ------------------
  416|  54.2k|                       pval > valbuf + maxlen - 1) {
  ------------------
  |  Branch (416:24): [True: 155, False: 54.0k]
  ------------------
  417|    158|                json_debug_trace((1, "String value too long.\n"));
  ------------------
  |  |  110|    158|#define json_debug_trace(args) (void) json_trace args
  ------------------
  418|       |                // don't update end here, leave at value start
  419|    158|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|    158|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  420|  54.0k|            } else {
  421|  54.0k|                *pval++ = *cp;
  422|  54.0k|            }
  423|  64.9k|            break;
  424|  64.9k|        case in_escape:
  ------------------
  |  Branch (424:9): [True: 1.89k, False: 470k]
  ------------------
  425|  1.89k|            if (NULL == pval) {
  ------------------
  |  Branch (425:17): [True: 0, False: 1.89k]
  ------------------
  426|       |                /* don't update end here, leave at value start */
  427|      0|                return JSON_ERR_NULLPTR;
  ------------------
  |  |  174|      0|#define JSON_ERR_NULLPTR       23      // unexpected null value or attribute
  ------------------
  428|      0|            }
  429|  1.89k|            if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  1.89k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (429:17): [True: 3, False: 1.89k]
  ------------------
  430|  1.89k|                pval > valbuf + maxlen) {
  ------------------
  |  Branch (430:17): [True: 6, False: 1.88k]
  ------------------
  431|      9|                json_debug_trace((1, "String value too long.\n"));
  ------------------
  |  |  110|      9|#define json_debug_trace(args) (void) json_trace args
  ------------------
  432|       |                // don't update end here, leave at value start
  433|      9|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|      9|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  434|      9|            }
  435|  1.88k|            switch (*cp) {
  436|    209|            case 'b':
  ------------------
  |  Branch (436:13): [True: 209, False: 1.67k]
  ------------------
  437|    209|                *pval++ = '\b';
  438|    209|                break;
  439|    324|            case 'f':
  ------------------
  |  Branch (439:13): [True: 324, False: 1.56k]
  ------------------
  440|    324|                *pval++ = '\f';
  441|    324|                break;
  442|    198|            case 'n':
  ------------------
  |  Branch (442:13): [True: 198, False: 1.68k]
  ------------------
  443|    198|                *pval++ = '\n';
  444|    198|                break;
  445|    212|            case 'r':
  ------------------
  |  Branch (445:13): [True: 212, False: 1.67k]
  ------------------
  446|    212|                *pval++ = '\r';
  447|    212|                break;
  448|    356|            case 't':
  ------------------
  |  Branch (448:13): [True: 356, False: 1.52k]
  ------------------
  449|    356|                *pval++ = '\t';
  450|    356|                break;
  451|    274|            case 'u':
  ------------------
  |  Branch (451:13): [True: 274, False: 1.61k]
  ------------------
  452|    274|                {
  453|    274|                    unsigned n;
  454|       |
  455|    274|                    cp++;                   // skip the 'u'
  456|       |                    // NetBSD 6 wants the cast
  457|  1.09k|                    for (n = 0; n < 4 && isxdigit((int)*cp); n++) {
  ------------------
  |  Branch (457:33): [True: 899, False: 195]
  ------------------
  458|    820|                        uescape[n] = *cp++;
  459|    820|                    }
  460|    274|                    uescape[n] = '\0';      // terminate
  461|    274|                    --cp;
  462|       |                    // ECMA-404 says JSON \u must have 4 hex digits
  463|    274|                    if ((4 != n) ||
  ------------------
  |  Branch (463:25): [True: 79, False: 195]
  ------------------
  464|    274|                        (1 != sscanf(uescape, "%4x", &u))) {
  ------------------
  |  Branch (464:25): [True: 0, False: 195]
  ------------------
  465|     79|                        return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     79|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  466|     79|                    }
  467|       |                    // truncate values above 0xff
  468|    195|                    *pval++ = (unsigned char)u;
  469|    195|                }
  470|      0|                break;
  471|    311|            default:            // handles double quote and solidus
  ------------------
  |  Branch (471:13): [True: 311, False: 1.57k]
  ------------------
  472|    311|                *pval++ = *cp;
  473|    311|                break;
  474|  1.88k|            }
  475|  1.80k|            state = in_val_string;
  476|  1.80k|            break;
  477|   118k|        case in_val_token:
  ------------------
  |  Branch (477:9): [True: 118k, False: 354k]
  ------------------
  478|   118k|            if (NULL == pval) {
  ------------------
  |  Branch (478:17): [True: 0, False: 118k]
  ------------------
  479|       |                // don't update end here, leave at value start
  480|      0|                return JSON_ERR_NULLPTR;
  ------------------
  |  |  174|      0|#define JSON_ERR_NULLPTR       23      // unexpected null value or attribute
  ------------------
  481|      0|            }
  482|   118k|            if (isspace((unsigned char) *cp) ||
  483|   118k|                *cp == ',' ||
  ------------------
  |  Branch (483:17): [True: 22.3k, False: 95.4k]
  ------------------
  484|   118k|                *cp == '}') {
  ------------------
  |  Branch (484:17): [True: 5.27k, False: 90.1k]
  ------------------
  485|  27.9k|                *pval = '\0';
  486|  27.9k|                json_debug_trace((1, "Collected token value %s.\n", valbuf));
  ------------------
  |  |  110|  27.9k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  487|  27.9k|                state = post_val;
  488|  27.9k|                if (*cp == '}' ||
  ------------------
  |  Branch (488:21): [True: 5.27k, False: 22.7k]
  ------------------
  489|  27.9k|                    *cp == ',') {
  ------------------
  |  Branch (489:21): [True: 22.3k, False: 324]
  ------------------
  490|  27.6k|                    --cp;
  491|  27.6k|                }
  492|  90.1k|            } else if (pval > valbuf + JSON_VAL_MAX - 1) {
  ------------------
  |  |  135|  90.1k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (492:24): [True: 6, False: 90.1k]
  ------------------
  493|      6|                json_debug_trace((1, "Token value too long.\n"));
  ------------------
  |  |  110|      6|#define json_debug_trace(args) (void) json_trace args
  ------------------
  494|       |                // don't update end here, leave at value start
  495|      6|                return JSON_ERR_TOKLONG;
  ------------------
  |  |  159|      6|#define JSON_ERR_TOKLONG        8      // token value too long
  ------------------
  496|  90.1k|            } else {
  497|  90.1k|                *pval++ = *cp;
  498|  90.1k|            }
  499|   118k|            break;
  500|       |            // coverity[unterminated_case]
  501|   118k|        case post_val:
  ------------------
  |  Branch (501:9): [True: 36.1k, False: 436k]
  ------------------
  502|       |            // Ignore whitespace after either string or token values.
  503|  36.1k|            if (isspace(*cp)) {
  504|    638|                while (*cp != '\0' && isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (504:24): [True: 620, False: 18]
  ------------------
  505|    415|                    ++cp;
  506|    415|                }
  507|    223|                json_debug_trace((1,
  ------------------
  |  |  110|    223|#define json_debug_trace(args) (void) json_trace args
  ------------------
  508|    223|                    "Skipped trailing whitespace: value \"%s\"\n", valbuf));
  509|    223|            }
  510|       |            /*
  511|       |             * We know that cursor points at the first spec matching
  512|       |             * the current attribute.  We don't know that it's *the*
  513|       |             * correct spec; our dialect allows there to be any number
  514|       |             * of adjacent ones with the same attrname but different
  515|       |             * types.  Here's where we try to seek forward for a
  516|       |             * matching type/attr pair if we're not looking at one.
  517|       |             */
  518|  36.3k|            for (;;) {
  519|  36.3k|                int seeking = cursor->type;
  520|       |
  521|  36.3k|                if (value_quoted &&
  ------------------
  |  Branch (521:21): [True: 8.23k, False: 28.1k]
  ------------------
  522|  36.3k|                    (cursor->type == t_string ||
  ------------------
  |  Branch (522:22): [True: 1.06k, False: 7.16k]
  ------------------
  523|  8.23k|                     cursor->type == t_time)) {
  ------------------
  |  Branch (523:22): [True: 2.10k, False: 5.05k]
  ------------------
  524|  3.17k|                    break;
  525|  3.17k|                }
  526|  33.2k|                if ((strcmp(valbuf, "true") == 0 ||
  ------------------
  |  Branch (526:22): [True: 1.78k, False: 31.4k]
  ------------------
  527|  33.2k|                     strcmp(valbuf, "false") == 0) &&
  ------------------
  |  Branch (527:22): [True: 266, False: 31.1k]
  ------------------
  528|  33.2k|                    seeking == t_boolean) {
  ------------------
  |  Branch (528:21): [True: 1.52k, False: 532]
  ------------------
  529|  1.52k|                    break;
  530|  1.52k|                }
  531|  31.6k|                if (isdigit((unsigned char) valbuf[0])) {
  532|  16.3k|                    bool decimal = strchr(valbuf, '.') != NULL;
  533|       |
  534|  16.3k|                    if (decimal &&
  ------------------
  |  Branch (534:25): [True: 951, False: 15.3k]
  ------------------
  535|  16.3k|                        seeking == t_real) {
  ------------------
  |  Branch (535:25): [True: 249, False: 702]
  ------------------
  536|    249|                        break;
  537|    249|                    }
  538|  16.0k|                    if (!decimal && (seeking == t_byte ||
  ------------------
  |  Branch (538:25): [True: 15.3k, False: 702]
  |  Branch (538:38): [True: 224, False: 15.1k]
  ------------------
  539|  15.3k|                                     seeking == t_ubyte ||
  ------------------
  |  Branch (539:38): [True: 437, False: 14.7k]
  ------------------
  540|  15.3k|                                     seeking == t_integer ||
  ------------------
  |  Branch (540:38): [True: 1.09k, False: 13.6k]
  ------------------
  541|  15.3k|                                     seeking == t_uinteger ||
  ------------------
  |  Branch (541:38): [True: 506, False: 13.1k]
  ------------------
  542|  15.3k|                                     seeking == t_longint ||
  ------------------
  |  Branch (542:38): [True: 0, False: 13.1k]
  ------------------
  543|  15.3k|                                     seeking == t_ulongint ||
  ------------------
  |  Branch (543:38): [True: 507, False: 12.5k]
  ------------------
  544|  15.3k|                                     seeking == t_short ||
  ------------------
  |  Branch (544:38): [True: 1.55k, False: 11.0k]
  ------------------
  545|  15.3k|                                     seeking == t_ushort))
  ------------------
  |  Branch (545:38): [True: 0, False: 11.0k]
  ------------------
  546|  4.32k|                        break;
  547|  16.0k|                }
  548|  27.1k|                if (NULL == cursor[1].attribute) {  // out of possibilities
  ------------------
  |  Branch (548:21): [True: 18.7k, False: 8.34k]
  ------------------
  549|  18.7k|                    break;
  550|  18.7k|                }
  551|  8.34k|                if (0 != strcmp(cursor[1].attribute, attrbuf)) {
  ------------------
  |  Branch (551:21): [True: 8.14k, False: 194]
  ------------------
  552|  8.14k|                    break;
  553|  8.14k|                }
  554|    194|                ++cursor;
  555|    194|            }
  556|  36.1k|            if (value_quoted &&
  ------------------
  |  Branch (556:17): [True: 8.23k, False: 27.9k]
  ------------------
  557|  36.1k|                (cursor->type != t_string &&
  ------------------
  |  Branch (557:18): [True: 7.16k, False: 1.06k]
  ------------------
  558|  8.23k|                 cursor->type != t_character &&
  ------------------
  |  Branch (558:18): [True: 6.96k, False: 202]
  ------------------
  559|  8.23k|                 cursor->type != t_check &&
  ------------------
  |  Branch (559:18): [True: 6.18k, False: 772]
  ------------------
  560|  8.23k|                 cursor->type != t_time &&
  ------------------
  |  Branch (560:18): [True: 4.08k, False: 2.10k]
  ------------------
  561|  8.23k|                 cursor->type != t_ignore &&
  ------------------
  |  Branch (561:18): [True: 453, False: 3.62k]
  ------------------
  562|  8.23k|                 cursor->map == 0)) {
  ------------------
  |  Branch (562:18): [True: 13, False: 440]
  ------------------
  563|     13|                json_debug_trace((1, "Saw quoted value when expecting"
  ------------------
  |  |  110|     13|#define json_debug_trace(args) (void) json_trace args
  ------------------
  564|     13|                                  " non-string.\n"));
  565|     13|                return JSON_ERR_QNONSTRING;
  ------------------
  |  |  170|     13|#define JSON_ERR_QNONSTRING    19      // quoted value when expecting nonstring
  ------------------
  566|     13|            }
  567|  36.1k|            if (!value_quoted &&
  ------------------
  |  Branch (567:17): [True: 27.9k, False: 8.21k]
  ------------------
  568|  36.1k|                (cursor->type == t_string ||
  ------------------
  |  Branch (568:18): [True: 20, False: 27.9k]
  ------------------
  569|  27.9k|                 cursor->type == t_check ||
  ------------------
  |  Branch (569:18): [True: 27, False: 27.9k]
  ------------------
  570|  27.9k|                 cursor->type == t_time ||
  ------------------
  |  Branch (570:18): [True: 10, False: 27.9k]
  ------------------
  571|  27.9k|                 cursor->map != 0)) {
  ------------------
  |  Branch (571:18): [True: 7, False: 27.8k]
  ------------------
  572|     64|                json_debug_trace((1, "Didn't see quoted value when expecting"
  ------------------
  |  |  110|     64|#define json_debug_trace(args) (void) json_trace args
  ------------------
  573|     64|                                  " string.\n"));
  574|     64|                return JSON_ERR_NONQSTRING;
  ------------------
  |  |  171|     64|#define JSON_ERR_NONQSTRING    20      // no quoted value when expecting string
  ------------------
  575|     64|            }
  576|  36.1k|            if (cursor->map != 0) {
  ------------------
  |  Branch (576:17): [True: 440, False: 35.6k]
  ------------------
  577|    887|                for (mp = cursor->map; mp->name != NULL; mp++)
  ------------------
  |  Branch (577:40): [True: 821, False: 66]
  ------------------
  578|    821|                    if (strcmp(mp->name, valbuf) == 0) {
  ------------------
  |  Branch (578:25): [True: 374, False: 447]
  ------------------
  579|    374|                        goto foundit;
  580|    374|                    }
  581|     66|                json_debug_trace((1, "Invalid enumerated value string %s.\n",
  ------------------
  |  |  110|     66|#define json_debug_trace(args) (void) json_trace args
  ------------------
  582|     66|                                  valbuf));
  583|     66|                return JSON_ERR_BADENUM;
  ------------------
  |  |  169|     66|#define JSON_ERR_BADENUM       18      // invalid enumerated value
  ------------------
  584|    374|              foundit:
  585|    374|                (void)snprintf(valbuf, sizeof(valbuf), "%d", mp->value);
  586|    374|            }
  587|  36.0k|            if (cursor->type == t_check) {
  ------------------
  |  Branch (587:17): [True: 772, False: 35.2k]
  ------------------
  588|    772|                lptr = cursor->dflt.check;
  589|  35.2k|            } else {
  590|  35.2k|                lptr = json_target_address(cursor, parent, offset);
  591|  35.2k|            }
  592|  36.0k|            if (NULL != lptr) {
  ------------------
  |  Branch (592:17): [True: 20.3k, False: 15.6k]
  ------------------
  593|  20.3k|                switch (cursor->type) {
  ------------------
  |  Branch (593:25): [True: 0, False: 20.3k]
  ------------------
  594|    260|                case t_byte:
  ------------------
  |  Branch (594:17): [True: 260, False: 20.1k]
  ------------------
  595|    260|                    {
  596|    260|                        int tmp = atoi(valbuf);
  597|    260|                        lptr[0] = (char)tmp;
  598|    260|                    }
  599|    260|                    break;
  600|    820|                case t_ubyte:
  ------------------
  |  Branch (600:17): [True: 820, False: 19.5k]
  ------------------
  601|    820|                    {
  602|    820|                        int tmp = atoi(valbuf);
  603|    820|                        lptr[0] = (unsigned char)tmp;
  604|    820|                    }
  605|    820|                    break;
  606|  1.70k|                case t_integer:
  ------------------
  |  Branch (606:17): [True: 1.70k, False: 18.6k]
  ------------------
  607|  1.70k|                    {
  608|  1.70k|                        int tmp = atoi(valbuf);
  609|  1.70k|                        memcpy(lptr, &tmp, sizeof(int));
  610|  1.70k|                    }
  611|  1.70k|                    break;
  612|  1.05k|                case t_uinteger:
  ------------------
  |  Branch (612:17): [True: 1.05k, False: 19.3k]
  ------------------
  613|  1.05k|                    {
  614|  1.05k|                        unsigned int tmp = (unsigned int)atol(valbuf);
  615|  1.05k|                        memcpy(lptr, &tmp, sizeof(unsigned int));
  616|  1.05k|                    }
  617|  1.05k|                    break;
  618|      0|                case t_longint:
  ------------------
  |  Branch (618:17): [True: 0, False: 20.3k]
  ------------------
  619|      0|                    {
  620|      0|                        long tmp = atol(valbuf);
  621|      0|                        memcpy(lptr, &tmp, sizeof(long));
  622|      0|                    }
  623|      0|                    break;
  624|    568|                case t_ulongint:
  ------------------
  |  Branch (624:17): [True: 568, False: 19.8k]
  ------------------
  625|    568|                    {
  626|    568|                        unsigned long tmp = (unsigned long)atoll(valbuf);
  627|    568|                        memcpy(lptr, &tmp, sizeof(unsigned long));
  628|    568|                    }
  629|    568|                    break;
  630|  1.57k|                case t_short:
  ------------------
  |  Branch (630:17): [True: 1.57k, False: 18.8k]
  ------------------
  631|  1.57k|                    {
  632|  1.57k|                        short tmp = atoi(valbuf);
  633|  1.57k|                        memcpy(lptr, &tmp, sizeof(short));
  634|  1.57k|                    }
  635|  1.57k|                    break;
  636|      0|                case t_ushort:
  ------------------
  |  Branch (636:17): [True: 0, False: 20.3k]
  ------------------
  637|      0|                    {
  638|      0|                        unsigned short tmp = (unsigned int)atoi(valbuf);
  639|      0|                        memcpy(lptr, &tmp, sizeof(unsigned short));
  640|      0|                    }
  641|      0|                    break;
  642|  2.10k|                case t_time:
  ------------------
  |  Branch (642:17): [True: 2.10k, False: 18.2k]
  ------------------
  643|  2.10k|                    {
  644|  2.10k|                        timespec_t ts_tmp = iso8601_to_timespec(valbuf);
  645|  2.10k|                        memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  646|  2.10k|                    }
  647|  2.10k|                    break;
  648|    388|                case t_timespec:
  ------------------
  |  Branch (648:17): [True: 388, False: 19.9k]
  ------------------
  649|    388|                    {
  650|    388|                        double sec_tmp = safe_atof(valbuf);
  651|    388|                        timespec_t ts_tmp;
  652|    388|                        if (0 != isfinite(sec_tmp)) {
  ------------------
  |  Branch (652:29): [True: 194, False: 194]
  ------------------
  653|    194|                            DTOTS(&ts_tmp, sec_tmp);
  ------------------
  |  |  144|    194|    do { \
  |  |  145|    194|        double int_part; \
  |  |  146|    194|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|    194|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|    194|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  654|    194|                            memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  655|    194|                        } // else leave at .dflt
  656|    388|                    }
  657|    388|                    break;
  658|  4.61k|                case t_real:
  ------------------
  |  Branch (658:17): [True: 4.61k, False: 15.7k]
  ------------------
  659|  4.61k|                    {
  660|  4.61k|                        double tmp = safe_atof(valbuf);
  661|  4.61k|                        if (0 != isfinite(tmp)) {
  ------------------
  |  Branch (661:29): [True: 3.73k, False: 875]
  ------------------
  662|  3.73k|                            memcpy(lptr, &tmp, sizeof(double));
  663|  3.73k|                        } // else leave at .dflt
  664|  4.61k|                    }
  665|  4.61k|                    break;
  666|  1.06k|                case t_string:
  ------------------
  |  Branch (666:17): [True: 1.06k, False: 19.3k]
  ------------------
  667|  1.06k|                    if (NULL != parent &&
  ------------------
  |  Branch (667:25): [True: 389, False: 680]
  ------------------
  668|  1.06k|                        parent->element_type != t_structobject &&
  ------------------
  |  Branch (668:25): [True: 0, False: 389]
  ------------------
  669|  1.06k|                        offset > 0) {
  ------------------
  |  Branch (669:25): [True: 0, False: 0]
  ------------------
  670|      0|                        return JSON_ERR_NOPARSTR;
  ------------------
  |  |  168|      0|#define JSON_ERR_NOPARSTR      17      // no strings in parallel arrays
  ------------------
  671|      0|                    }
  672|  1.06k|                    (void)strlcpy(lptr, valbuf, cursor->len);
  673|  1.06k|                    break;
  674|  1.90k|                case t_boolean:
  ------------------
  |  Branch (674:17): [True: 1.90k, False: 18.4k]
  ------------------
  675|  1.90k|                    {
  676|  1.90k|                        bool tmp = (strcmp(valbuf, "true") == 0);
  677|  1.90k|                        memcpy(lptr, &tmp, sizeof(bool));
  678|  1.90k|                    }
  679|  1.90k|                    break;
  680|    561|                case t_character:
  ------------------
  |  Branch (680:17): [True: 561, False: 19.8k]
  ------------------
  681|    561|                    if (strnlen(valbuf, 2) > 1) {
  ------------------
  |  Branch (681:25): [True: 7, False: 554]
  ------------------
  682|       |                        // don't update end here, leave at value start
  683|      7|                        return JSON_ERR_STRLONG;
  ------------------
  |  |  158|      7|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  684|    554|                    } else {
  685|    554|                        lptr[0] = valbuf[0];
  686|    554|                    }
  687|    554|                    break;
  688|  2.98k|                case t_ignore:  // silences a compiler warning
  ------------------
  |  Branch (688:17): [True: 2.98k, False: 17.3k]
  ------------------
  689|  2.98k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.98k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  690|  2.98k|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (690:17): [True: 0, False: 20.3k]
  ------------------
  691|  2.98k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.98k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  692|  2.98k|                case t_structobject:
  ------------------
  |  Branch (692:17): [True: 0, False: 20.3k]
  ------------------
  693|  2.98k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.98k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  694|  2.98k|                case t_array:
  ------------------
  |  Branch (694:17): [True: 0, False: 20.3k]
  ------------------
  695|  2.98k|                    break;
  696|    772|                case t_check:
  ------------------
  |  Branch (696:17): [True: 772, False: 19.6k]
  ------------------
  697|    772|                    if (strcmp(cursor->dflt.check, valbuf) != 0) {
  ------------------
  |  Branch (697:25): [True: 197, False: 575]
  ------------------
  698|    197|                        json_debug_trace((1, "Required attribute value %s"
  ------------------
  |  |  110|    197|#define json_debug_trace(args) (void) json_trace args
  ------------------
  699|    197|                                          " not present.\n",
  700|    197|                                          cursor->dflt.check));
  701|       |                        // don't update end here, leave at start of attribute
  702|    197|                        return JSON_ERR_CHECKFAIL;
  ------------------
  |  |  167|    197|#define JSON_ERR_CHECKFAIL     16      // check attribute not matched
  ------------------
  703|    197|                    }
  704|    575|                    break;
  705|  20.3k|                }
  706|  20.3k|            }
  707|  35.8k|            FALLTHROUGH
  ------------------
  |  |   55|  35.8k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  708|  37.0k|        case post_element:
  ------------------
  |  Branch (708:9): [True: 1.18k, False: 471k]
  ------------------
  709|  37.0k|            if (isspace((unsigned char) *cp)) {
  710|    374|                continue;
  711|    374|            }
  712|  36.6k|            if (*cp == ',') {
  ------------------
  |  Branch (712:17): [True: 30.1k, False: 6.49k]
  ------------------
  713|  30.1k|                state = await_attr;
  714|  30.1k|            } else if (*cp == '}') {
  ------------------
  |  Branch (714:24): [True: 5.59k, False: 899]
  ------------------
  715|  5.59k|                ++cp;
  716|  5.59k|                goto good_parse;
  717|  5.59k|            } else {
  718|    899|                json_debug_trace((1, "Garbage while expecting comma or }\n"));
  ------------------
  |  |  110|    899|#define json_debug_trace(args) (void) json_trace args
  ------------------
  719|    899|                if (NULL != end) {
  ------------------
  |  Branch (719:21): [True: 17, False: 882]
  ------------------
  720|     17|                    *end = cp;
  721|     17|                }
  722|    899|                return JSON_ERR_BADTRAIL;
  ------------------
  |  |  160|    899|#define JSON_ERR_BADTRAIL       9      // garbage expecting comma or } or ]
  ------------------
  723|    899|            }
  724|  30.1k|            break;
  725|   472k|        }
  726|   472k|    }
  727|  2.12k|    if (state == init) {
  ------------------
  |  Branch (727:9): [True: 54, False: 2.07k]
  ------------------
  728|     54|        json_debug_trace((1, "Input was empty or white-space only\n"));
  ------------------
  |  |  110|     54|#define json_debug_trace(args) (void) json_trace args
  ------------------
  729|     54|        return JSON_ERR_EMPTY;
  ------------------
  |  |  176|     54|#define JSON_ERR_EMPTY         25      // input was empty or white-space only
  ------------------
  730|     54|    }
  731|       |
  732|  7.66k|  good_parse:
  733|       |    // in case there's another object following, consume trailing WS
  734|  7.66k|    while (isspace((unsigned char)*cp)) {
  735|    401|        ++cp;
  736|    401|    }
  737|  7.66k|    if (NULL != end) {
  ------------------
  |  Branch (737:9): [True: 5.28k, False: 2.38k]
  ------------------
  738|  5.28k|        *end = cp;
  739|  5.28k|    }
  740|  7.66k|    json_debug_trace((1, "JSON parse ends.\n"));
  ------------------
  |  |  110|  7.66k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  741|  7.66k|    return 0;
  742|  2.12k|}
json.c:json_target_address:
  115|   172k|{
  116|   172k|    char *targetaddr = NULL;
  117|   172k|    if (NULL == parent ||
  ------------------
  |  Branch (117:9): [True: 88.3k, False: 84.1k]
  ------------------
  118|   172k|        parent->element_type != t_structobject) {
  ------------------
  |  Branch (118:9): [True: 0, False: 84.1k]
  ------------------
  119|       |        // ordinary case - use the address in the cursor structure
  120|  88.3k|        switch (cursor->type) {
  121|      0|        case t_byte:
  ------------------
  |  Branch (121:9): [True: 0, False: 88.3k]
  ------------------
  122|      0|            targetaddr = (char *)&cursor->addr.byte[offset];
  123|      0|            break;
  124|    863|        case t_ubyte:
  ------------------
  |  Branch (124:9): [True: 863, False: 87.4k]
  ------------------
  125|    863|            targetaddr = (char *)&cursor->addr.ubyte[offset];
  126|    863|            break;
  127|  19.7k|        case t_ignore:
  ------------------
  |  Branch (127:9): [True: 19.7k, False: 68.5k]
  ------------------
  128|  19.7k|            targetaddr = NULL;
  129|  19.7k|            break;
  130|  15.7k|        case t_integer:
  ------------------
  |  Branch (130:9): [True: 15.7k, False: 72.5k]
  ------------------
  131|  15.7k|            targetaddr = (char *)&cursor->addr.integer[offset];
  132|  15.7k|            break;
  133|  6.05k|        case t_uinteger:
  ------------------
  |  Branch (133:9): [True: 6.05k, False: 82.2k]
  ------------------
  134|  6.05k|            targetaddr = (char *)&cursor->addr.uinteger[offset];
  135|  6.05k|            break;
  136|      0|        case t_longint:
  ------------------
  |  Branch (136:9): [True: 0, False: 88.3k]
  ------------------
  137|      0|            targetaddr = (char *)&cursor->addr.longint[offset];
  138|      0|            break;
  139|    684|        case t_ulongint:
  ------------------
  |  Branch (139:9): [True: 684, False: 87.6k]
  ------------------
  140|    684|            targetaddr = (char *)&cursor->addr.ulongint[offset];
  141|    684|            break;
  142|      0|        case t_short:
  ------------------
  |  Branch (142:9): [True: 0, False: 88.3k]
  ------------------
  143|      0|            targetaddr = (char *)&cursor->addr.shortint[offset];
  144|      0|            break;
  145|      0|        case t_ushort:
  ------------------
  |  Branch (145:9): [True: 0, False: 88.3k]
  ------------------
  146|      0|            targetaddr = (char *)&cursor->addr.ushortint[offset];
  147|      0|            break;
  148|  3.03k|        case t_time:
  ------------------
  |  Branch (148:9): [True: 3.03k, False: 85.2k]
  ------------------
  149|  3.03k|            targetaddr = (char *)&cursor->addr.ts[offset];
  150|  3.03k|            break;
  151|      0|        case t_timespec:
  ------------------
  |  Branch (151:9): [True: 0, False: 88.3k]
  ------------------
  152|      0|            targetaddr = (char *)&cursor->addr.ts[offset];
  153|      0|            break;
  154|  27.3k|        case t_real:
  ------------------
  |  Branch (154:9): [True: 27.3k, False: 60.9k]
  ------------------
  155|  27.3k|            targetaddr = (char *)&cursor->addr.real[offset];
  156|  27.3k|            break;
  157|  6.51k|        case t_string:
  ------------------
  |  Branch (157:9): [True: 6.51k, False: 81.7k]
  ------------------
  158|  6.51k|            targetaddr = cursor->addr.string;
  159|  6.51k|            break;
  160|  1.69k|        case t_boolean:
  ------------------
  |  Branch (160:9): [True: 1.69k, False: 86.6k]
  ------------------
  161|  1.69k|            targetaddr = (char *)&cursor->addr.boolean[offset];
  162|  1.69k|            break;
  163|  1.04k|        case t_character:
  ------------------
  |  Branch (163:9): [True: 1.04k, False: 87.2k]
  ------------------
  164|  1.04k|            targetaddr = (char *)&cursor->addr.character[offset];
  165|  1.04k|            break;
  166|  5.46k|        default:
  ------------------
  |  Branch (166:9): [True: 5.46k, False: 82.8k]
  ------------------
  167|  5.46k|            targetaddr = NULL;
  168|  5.46k|            break;
  169|  88.3k|        }
  170|  88.3k|    } else {
  171|       |        // tricky case - hacking a member in an array of structures
  172|  84.1k|        targetaddr =
  173|  84.1k|            parent->arr.objects.base + (offset * parent->arr.objects.stride) +
  174|  84.1k|            cursor->addr.offset;
  175|  84.1k|    }
  176|   172k|    json_debug_trace((1, "Target address for %s (offset %d) is %p\n",
  ------------------
  |  |  110|   172k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  177|   172k|                      cursor->attribute, offset, targetaddr));
  178|   172k|    return targetaddr;
  179|   172k|}

json_toff_read:
  670|  2.69k|{
  671|  2.69k|    int real_sec = 0, real_nsec = 0, clock_sec = 0, clock_nsec = 0;
  672|  2.69k|    const struct json_attr_t json_attrs_toff[] = {
  673|       |        // *INDENT-OFF*
  674|  2.69k|        {"class",     t_check,   .dflt.check = "TOFF"},
  675|  2.69k|        {"device",    t_string,  .addr.string = gpsdata->dev.path,
  676|  2.69k|                                 .len = sizeof(gpsdata->dev.path)},
  677|  2.69k|        {"real_sec",  t_integer, .addr.integer = &real_sec,
  678|  2.69k|                                 .dflt.integer = 0},
  679|  2.69k|        {"real_nsec", t_integer, .addr.integer = &real_nsec,
  680|  2.69k|                                 .dflt.integer = 0},
  681|  2.69k|        {"clock_sec", t_integer, .addr.integer = &clock_sec,
  682|  2.69k|                                 .dflt.integer = 0},
  683|  2.69k|        {"clock_nsec",t_integer, .addr.integer = &clock_nsec,
  684|  2.69k|                                 .dflt.integer = 0},
  685|       |        // ignore unknown keys, for cross-version compatibility
  686|  2.69k|        {"", t_ignore},
  687|  2.69k|        {NULL},
  688|       |        // *INDENT-ON*
  689|  2.69k|    };
  690|  2.69k|    int status;
  691|       |
  692|  2.69k|    memset(&gpsdata->toff, 0, sizeof(gpsdata->toff));
  693|  2.69k|    status = json_read_object(buf, json_attrs_toff, endptr);
  694|  2.69k|    gpsdata->toff.real.tv_sec = (time_t)real_sec;
  695|  2.69k|    gpsdata->toff.real.tv_nsec = (long)real_nsec;
  696|  2.69k|    gpsdata->toff.clock.tv_sec = (time_t)clock_sec;
  697|  2.69k|    gpsdata->toff.clock.tv_nsec = (long)clock_nsec;
  698|  2.69k|    if (status != 0)
  ------------------
  |  Branch (698:9): [True: 1.24k, False: 1.45k]
  ------------------
  699|  1.24k|        return status;
  700|       |
  701|  1.45k|    return status;
  702|  2.69k|}
json_pps_read:
  706|     36|{
  707|     36|    int real_sec = 0, real_nsec = 0, clock_sec = 0, clock_nsec = 0, precision=0;
  708|     36|    int qErr = 0;
  709|       |
  710|     36|    const struct json_attr_t json_attrs_pps[] = {
  711|       |        // *INDENT-OFF*
  712|     36|        {"class",     t_check,   .dflt.check = "PPS"},
  713|     36|        {"device",    t_string,  .addr.string = gpsdata->dev.path,
  714|     36|                                 .len = sizeof(gpsdata->dev.path)},
  715|     36|        {"real_sec",  t_integer, .addr.integer = &real_sec,
  716|     36|                                 .dflt.integer = 0},
  717|     36|        {"real_nsec", t_integer, .addr.integer = &real_nsec,
  718|     36|                                 .dflt.integer = 0},
  719|     36|        {"clock_sec", t_integer, .addr.integer = &clock_sec,
  720|     36|                                 .dflt.integer = 0},
  721|     36|        {"clock_nsec",t_integer, .addr.integer = &clock_nsec,
  722|     36|                                 .dflt.integer = 0},
  723|     36|        {"precision", t_integer, .addr.integer = &precision,
  724|     36|                                 .dflt.integer = 0},
  725|     36|        {"qErr", t_integer, .addr.integer = &qErr,
  726|     36|                                 .dflt.integer = 0},
  727|       |        // ignore unknown keys, for cross-version compatibility
  728|     36|        {"", t_ignore},
  729|     36|        {NULL},
  730|       |        // *INDENT-ON*
  731|     36|    };
  732|     36|    int status;
  733|       |
  734|     36|    memset(&gpsdata->pps, 0, sizeof(gpsdata->pps));
  735|     36|    status = json_read_object(buf, json_attrs_pps, endptr);
  736|       |
  737|       |    // This is good until GPS are more than nanosec accurate
  738|     36|    gpsdata->pps.real.tv_sec = (time_t)real_sec;
  739|     36|    gpsdata->pps.real.tv_nsec = (long)real_nsec;
  740|     36|    gpsdata->pps.clock.tv_sec = (time_t)clock_sec;
  741|     36|    gpsdata->pps.clock.tv_nsec = (long)clock_nsec;
  742|       |    // hope qErr fits in int
  743|     36|    gpsdata->qErr = (long)qErr;
  744|       |
  745|       |    // FIXME: precision is currently parsed but discarded
  746|     36|    return status;
  747|     36|}
json_oscillator_read:
  751|     25|{
  752|     25|    bool running = false, reference = false, disciplined = false;
  753|     25|    int delta = 0;
  754|     25|    const struct json_attr_t json_attrs_osc[] = {
  755|       |        // *INDENT-OFF*
  756|     25|        {"class",       t_check,   .dflt.check = "OSC"},
  757|     25|        {"device",      t_string,  .addr.string = gpsdata->dev.path,
  758|     25|                                   .len = sizeof(gpsdata->dev.path)},
  759|     25|        {"running",     t_boolean, .addr.boolean = &running,
  760|     25|                                   .dflt.boolean = false},
  761|     25|        {"reference",   t_boolean, .addr.boolean = &reference,
  762|     25|                                   .dflt.boolean = false},
  763|     25|        {"disciplined", t_boolean, .addr.boolean = &disciplined,
  764|     25|                                   .dflt.boolean = false},
  765|     25|        {"delta",       t_integer, .addr.integer = &delta,
  766|     25|                                   .dflt.integer = 0},
  767|       |        // ignore unknown keys, for cross-version compatibility
  768|     25|        {"", t_ignore},
  769|     25|        {NULL},
  770|       |        // *INDENT-ON*
  771|     25|    };
  772|     25|    int status;
  773|       |
  774|     25|    memset(&gpsdata->osc, 0, sizeof(gpsdata->osc));
  775|     25|    status = json_read_object(buf, json_attrs_osc, endptr);
  776|       |
  777|     25|    gpsdata->osc.running = running;
  778|     25|    gpsdata->osc.reference = reference;
  779|     25|    gpsdata->osc.disciplined = disciplined;
  780|     25|    gpsdata->osc.delta = delta;
  781|       |
  782|     25|    return status;
  783|     25|}
libgps_json_unpack:
  795|  2.67k|{
  796|  2.67k|    int status;
  797|  2.67k|    char *classtag = strstr(buf, "\"class\":");
  798|       |
  799|  2.67k|    if (NULL == classtag) {
  ------------------
  |  Branch (799:9): [True: 383, False: 2.28k]
  ------------------
  800|    383|        return -1;
  801|    383|    }
  802|       |
  803|  2.28k|    if (str_starts_with(classtag, "\"class\":\"TPV\"")) {
  ------------------
  |  Branch (803:9): [True: 291, False: 1.99k]
  ------------------
  804|    291|        status = json_tpv_read(buf, gpsdata, end);
  805|    291|        gpsdata->set = STATUS_SET;
  ------------------
  |  | 2840|    291|#define STATUS_SET      (1llu<<9)
  ------------------
  806|    291|        if (0 != gpsdata->fix.time.tv_sec) {
  ------------------
  |  Branch (806:13): [True: 145, False: 146]
  ------------------
  807|    145|            gpsdata->set |= TIME_SET;
  ------------------
  |  | 2833|    145|#define TIME_SET        (1llu<<2)
  ------------------
  808|    145|        }
  809|    291|        if (0 != isfinite(gpsdata->fix.ept)) {
  ------------------
  |  Branch (809:13): [True: 1, False: 290]
  ------------------
  810|      1|            gpsdata->set |= TIMERR_SET;
  ------------------
  |  | 2834|      1|#define TIMERR_SET      (1llu<<3)
  ------------------
  811|      1|        }
  812|    291|        if (0 != isfinite(gpsdata->fix.longitude)) {
  ------------------
  |  Branch (812:13): [True: 1, False: 290]
  ------------------
  813|      1|            gpsdata->set |= LATLON_SET;
  ------------------
  |  | 2835|      1|#define LATLON_SET      (1llu<<4)
  ------------------
  814|      1|        }
  815|    291|        if (0 != isfinite(gpsdata->fix.altitude) ||
  ------------------
  |  Branch (815:13): [True: 1, False: 290]
  ------------------
  816|    291|            0 != isfinite(gpsdata->fix.altHAE) ||
  ------------------
  |  Branch (816:13): [True: 1, False: 289]
  ------------------
  817|    291|            0 != isfinite(gpsdata->fix.depth) ||
  ------------------
  |  Branch (817:13): [True: 1, False: 288]
  ------------------
  818|    291|            0 != isfinite(gpsdata->fix.altMSL)) {
  ------------------
  |  Branch (818:13): [True: 1, False: 287]
  ------------------
  819|      4|            gpsdata->set |= ALTITUDE_SET;
  ------------------
  |  | 2836|      4|#define ALTITUDE_SET    (1llu<<5)
  ------------------
  820|      4|        }
  821|    291|        if (0 != isfinite(gpsdata->fix.epx) &&
  ------------------
  |  Branch (821:13): [True: 3, False: 288]
  ------------------
  822|    291|            0 != isfinite(gpsdata->fix.epy)) {
  ------------------
  |  Branch (822:13): [True: 2, False: 1]
  ------------------
  823|      2|            gpsdata->set |= HERR_SET;
  ------------------
  |  | 2843|      2|#define HERR_SET        (1llu<<12)
  ------------------
  824|      2|        }
  825|    291|        if (0 != isfinite(gpsdata->fix.epv)) {
  ------------------
  |  Branch (825:13): [True: 2, False: 289]
  ------------------
  826|      2|            gpsdata->set |= VERR_SET;
  ------------------
  |  | 2844|      2|#define VERR_SET        (1llu<<13)
  ------------------
  827|      2|        }
  828|    291|        if (0 != isfinite(gpsdata->fix.track)) {
  ------------------
  |  Branch (828:13): [True: 1, False: 290]
  ------------------
  829|      1|            gpsdata->set |= TRACK_SET;
  ------------------
  |  | 2838|      1|#define TRACK_SET       (1llu<<7)
  ------------------
  830|      1|        }
  831|    291|        if (0 != isfinite(gpsdata->fix.magnetic_track) ||
  ------------------
  |  Branch (831:13): [True: 1, False: 290]
  ------------------
  832|    291|            0 != isfinite(gpsdata->fix.magnetic_var)) {
  ------------------
  |  Branch (832:13): [True: 1, False: 289]
  ------------------
  833|      2|            gpsdata->set |= MAGNETIC_TRACK_SET;
  ------------------
  |  | 2869|      2|#define MAGNETIC_TRACK_SET (1llu<<38)
  ------------------
  834|      2|        }
  835|    291|        if (0 != isfinite(gpsdata->fix.speed)) {
  ------------------
  |  Branch (835:13): [True: 1, False: 290]
  ------------------
  836|      1|            gpsdata->set |= SPEED_SET;
  ------------------
  |  | 2837|      1|#define SPEED_SET       (1llu<<6)
  ------------------
  837|      1|        }
  838|    291|        if (0 != isfinite(gpsdata->fix.climb)) {
  ------------------
  |  Branch (838:13): [True: 1, False: 290]
  ------------------
  839|      1|            gpsdata->set |= CLIMB_SET;
  ------------------
  |  | 2839|      1|#define CLIMB_SET       (1llu<<8)
  ------------------
  840|      1|        }
  841|    291|        if (0 != isfinite(gpsdata->fix.epd)) {
  ------------------
  |  Branch (841:13): [True: 1, False: 290]
  ------------------
  842|      1|            gpsdata->set |= TRACKERR_SET;
  ------------------
  |  | 2848|      1|#define TRACKERR_SET    (1llu<<17)
  ------------------
  843|      1|        }
  844|    291|        if (0 != isfinite(gpsdata->fix.eps)) {
  ------------------
  |  Branch (844:13): [True: 1, False: 290]
  ------------------
  845|      1|            gpsdata->set |= SPEEDERR_SET;
  ------------------
  |  | 2847|      1|#define SPEEDERR_SET    (1llu<<16)
  ------------------
  846|      1|        }
  847|    291|        if (0 != isfinite(gpsdata->fix.epc)) {
  ------------------
  |  Branch (847:13): [True: 1, False: 290]
  ------------------
  848|      1|            gpsdata->set |= CLIMBERR_SET;
  ------------------
  |  | 2849|      1|#define CLIMBERR_SET    (1llu<<18)
  ------------------
  849|      1|        }
  850|    291|        if (MODE_NOT_SEEN != gpsdata->fix.mode) {
  ------------------
  |  |  196|    291|#define MODE_NOT_SEEN   0       // mode update not seen yet
  ------------------
  |  Branch (850:13): [True: 52, False: 239]
  ------------------
  851|     52|            gpsdata->set |= MODE_SET;
  ------------------
  |  | 2841|     52|#define MODE_SET        (1llu<<10)
  ------------------
  852|     52|        }
  853|    291|        if (0 != isfinite(gpsdata->fix.wanglem) ||
  ------------------
  |  Branch (853:13): [True: 1, False: 290]
  ------------------
  854|    291|            0 != isfinite(gpsdata->fix.wangler) ||
  ------------------
  |  Branch (854:13): [True: 1, False: 289]
  ------------------
  855|    291|            0 != isfinite(gpsdata->fix.wanglet) ||
  ------------------
  |  Branch (855:13): [True: 1, False: 288]
  ------------------
  856|    291|            0 != isfinite(gpsdata->fix.wspeedr) ||
  ------------------
  |  Branch (856:13): [True: 1, False: 287]
  ------------------
  857|    291|            0 != isfinite(gpsdata->fix.wspeedt)) {
  ------------------
  |  Branch (857:13): [True: 1, False: 286]
  ------------------
  858|      5|            gpsdata->set |= NAVDATA_SET;
  ------------------
  |  | 2865|      5|#define NAVDATA_SET     (1llu<<34)
  ------------------
  859|      5|        }
  860|    291|        if (0 != isfinite(gpsdata->fix.NED.relPosN) ||
  ------------------
  |  Branch (860:13): [True: 1, False: 290]
  ------------------
  861|    291|            0 != isfinite(gpsdata->fix.NED.relPosE) ||
  ------------------
  |  Branch (861:13): [True: 1, False: 289]
  ------------------
  862|    291|            0 != isfinite(gpsdata->fix.NED.relPosD) ||
  ------------------
  |  Branch (862:13): [True: 1, False: 288]
  ------------------
  863|    291|            0 != isfinite(gpsdata->fix.NED.relPosH) ||
  ------------------
  |  Branch (863:13): [True: 1, False: 287]
  ------------------
  864|    291|            0 != isfinite(gpsdata->fix.NED.relPosL) ||
  ------------------
  |  Branch (864:13): [True: 1, False: 286]
  ------------------
  865|    291|            0 != isfinite(gpsdata->fix.NED.velN) ||
  ------------------
  |  Branch (865:13): [True: 1, False: 285]
  ------------------
  866|    291|            0 != isfinite(gpsdata->fix.NED.velE) ||
  ------------------
  |  Branch (866:13): [True: 1, False: 284]
  ------------------
  867|    291|            0 != isfinite(gpsdata->fix.NED.velD)) {
  ------------------
  |  Branch (867:13): [True: 1, False: 283]
  ------------------
  868|      8|            gpsdata->set |= NED_SET;
  ------------------
  |  | 2871|      8|#define NED_SET         (1llu<<40)
  ------------------
  869|      8|        }
  870|    291|        if ((0 != isfinite(gpsdata->fix.ecef.x)) &&
  ------------------
  |  Branch (870:13): [True: 3, False: 288]
  ------------------
  871|    291|            (0 != isfinite(gpsdata->fix.ecef.y)) &&
  ------------------
  |  Branch (871:13): [True: 2, False: 1]
  ------------------
  872|    291|            (0 != isfinite(gpsdata->fix.ecef.z))) {
  ------------------
  |  Branch (872:13): [True: 1, False: 1]
  ------------------
  873|       |            // All, or none.  Clients can just do their own isfinite()s
  874|      1|            gpsdata->set |= ECEF_SET;
  ------------------
  |  | 2867|      1|#define ECEF_SET        (1llu<<36)
  ------------------
  875|      1|        }
  876|    291|        if ((0 != isfinite(gpsdata->fix.ecef.vx)) &&
  ------------------
  |  Branch (876:13): [True: 3, False: 288]
  ------------------
  877|    291|            (0 != isfinite(gpsdata->fix.ecef.vy)) &&
  ------------------
  |  Branch (877:13): [True: 2, False: 1]
  ------------------
  878|    291|            (0 != isfinite(gpsdata->fix.ecef.vz))) {
  ------------------
  |  Branch (878:13): [True: 1, False: 1]
  ------------------
  879|       |            // All, or none.  Clients can just do their own isfinite()s
  880|      1|            gpsdata->set |= VECEF_SET;
  ------------------
  |  | 2868|      1|#define VECEF_SET       (1llu<<37)
  ------------------
  881|      1|        }
  882|    291|        return FILTER(status);
  ------------------
  |  |  790|    291|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    291|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 291]
  |  |  ------------------
  ------------------
  883|    291|    }
  884|  1.99k|    if (str_starts_with(classtag, "\"class\":\"GST\"")) {
  ------------------
  |  Branch (884:9): [True: 294, False: 1.70k]
  ------------------
  885|    294|        status = json_noise_read(buf, gpsdata, end);
  886|    294|        if (PASS(status)) {
  ------------------
  |  |  789|    294|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     26|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 268, False: 26]
  |  |  |  Branch (789:32): [True: 0, False: 26]
  |  |  ------------------
  ------------------
  887|    268|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|    268|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|    268|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|    268|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|    268|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|    268|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|    268|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|    268|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|    268|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|    268|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|    268|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|    268|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|    268|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|    268|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|    268|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|    268|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  888|    268|            gpsdata->set |= GST_SET;
  ------------------
  |  | 2858|    268|#define GST_SET         (1llu<<27)
  ------------------
  889|    268|        }
  890|    294|        return FILTER(status);
  ------------------
  |  |  790|    294|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    294|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 294]
  |  |  ------------------
  ------------------
  891|    294|    }
  892|  1.70k|    if (str_starts_with(classtag, "\"class\":\"SKY\"")) {
  ------------------
  |  Branch (892:9): [True: 209, False: 1.49k]
  ------------------
  893|    209|        status = json_sky_read(buf, gpsdata, end);
  894|    209|        return FILTER(status);
  ------------------
  |  |  790|    209|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    209|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 209]
  |  |  ------------------
  ------------------
  895|    209|    }
  896|  1.49k|    if (str_starts_with(classtag, "\"class\":\"ATT\"")) {
  ------------------
  |  Branch (896:9): [True: 57, False: 1.43k]
  ------------------
  897|     57|        status = json_att_read(buf, gpsdata, end);
  898|     57|        if (PASS(status)) {
  ------------------
  |  |  789|     57|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     37|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 20, False: 37]
  |  |  |  Branch (789:32): [True: 0, False: 37]
  |  |  ------------------
  ------------------
  899|     20|            gpsdata->set |= ATTITUDE_SET;
  ------------------
  |  | 2845|     20|#define ATTITUDE_SET    (1llu<<14)
  ------------------
  900|     20|        }
  901|     57|        return FILTER(status);
  ------------------
  |  |  790|     57|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     57|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 57]
  |  |  ------------------
  ------------------
  902|     57|    }
  903|  1.43k|    if (str_starts_with(classtag, "\"class\":\"IMU\"")) {
  ------------------
  |  Branch (903:9): [True: 59, False: 1.37k]
  ------------------
  904|     59|        status = json_imu_read(buf, gpsdata, end);
  905|     59|        if (PASS(status)) {
  ------------------
  |  |  789|     59|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     40|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 19, False: 40]
  |  |  |  Branch (789:32): [True: 0, False: 40]
  |  |  ------------------
  ------------------
  906|     19|            gpsdata->set |= IMU_SET;
  ------------------
  |  | 2874|     19|#define IMU_SET         (1llu<<43)
  ------------------
  907|     19|        }
  908|     59|        return FILTER(status);
  ------------------
  |  |  790|     59|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     59|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 59]
  |  |  ------------------
  ------------------
  909|     59|    }
  910|  1.37k|    if (str_starts_with(classtag, "\"class\":\"DEVICES\"")) {
  ------------------
  |  Branch (910:9): [True: 48, False: 1.33k]
  ------------------
  911|     48|        status = json_devicelist_read(buf, gpsdata, end);
  912|     48|        if (PASS(status)) {
  ------------------
  |  |  789|     48|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     46|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 2, False: 46]
  |  |  |  Branch (789:32): [True: 0, False: 46]
  |  |  ------------------
  ------------------
  913|      2|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|      2|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|      2|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|      2|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|      2|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|      2|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|      2|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|      2|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|      2|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|      2|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|      2|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|      2|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|      2|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|      2|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|      2|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|      2|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  914|      2|            gpsdata->set |= DEVICELIST_SET;
  ------------------
  |  | 2851|      2|#define DEVICELIST_SET  (1llu<<20)
  ------------------
  915|      2|        }
  916|     48|        return FILTER(status);
  ------------------
  |  |  790|     48|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     48|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 48]
  |  |  ------------------
  ------------------
  917|     48|    }
  918|  1.33k|    if (str_starts_with(classtag, "\"class\":\"DEVICE\"")) {
  ------------------
  |  Branch (918:9): [True: 20, False: 1.31k]
  ------------------
  919|     20|        status = json_device_read(buf, &gpsdata->dev, end);
  920|     20|        if (PASS(status))
  ------------------
  |  |  789|     20|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     16|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 4, False: 16]
  |  |  |  Branch (789:32): [True: 0, False: 16]
  |  |  ------------------
  ------------------
  921|      4|            gpsdata->set |= DEVICE_SET;
  ------------------
  |  | 2850|      4|#define DEVICE_SET      (1llu<<19)
  ------------------
  922|     20|        return FILTER(status);
  ------------------
  |  |  790|     20|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     20|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 20]
  |  |  ------------------
  ------------------
  923|     20|    }
  924|  1.31k|    if (str_starts_with(classtag, "\"class\":\"WATCH\"")) {
  ------------------
  |  Branch (924:9): [True: 53, False: 1.25k]
  ------------------
  925|     53|        status = json_watch_read(buf, &gpsdata->policy, end);
  926|     53|        if (PASS(status)) {
  ------------------
  |  |  789|     53|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|      8|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 45, False: 8]
  |  |  |  Branch (789:32): [True: 0, False: 8]
  |  |  ------------------
  ------------------
  927|     45|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     45|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     45|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     45|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     45|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     45|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     45|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     45|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     45|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     45|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     45|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     45|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     45|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     45|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     45|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     45|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  928|     45|            gpsdata->set |= POLICY_SET;
  ------------------
  |  | 2860|     45|#define POLICY_SET      (1llu<<29)
  ------------------
  929|     45|        }
  930|     53|        return FILTER(status);
  ------------------
  |  |  790|     53|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     53|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 53]
  |  |  ------------------
  ------------------
  931|     53|    }
  932|  1.25k|    if (str_starts_with(classtag, "\"class\":\"VERSION\"")) {
  ------------------
  |  Branch (932:9): [True: 17, False: 1.24k]
  ------------------
  933|     17|        status = json_version_read(buf, gpsdata, end);
  934|     17|        if (status ==  0) {
  ------------------
  |  Branch (934:13): [True: 2, False: 15]
  ------------------
  935|      2|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|      2|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|      2|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|      2|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|      2|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|      2|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|      2|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|      2|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|      2|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|      2|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|      2|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|      2|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|      2|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|      2|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|      2|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|      2|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  936|      2|            gpsdata->set |= VERSION_SET;
  ------------------
  |  | 2859|      2|#define VERSION_SET     (1llu<<28)
  ------------------
  937|      2|        }
  938|     17|        return FILTER(status);
  ------------------
  |  |  790|     17|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     17|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 17]
  |  |  ------------------
  ------------------
  939|     17|    }
  940|  1.24k|    if (str_starts_with(classtag, "\"class\":\"RTCM2\"")) {
  ------------------
  |  Branch (940:9): [True: 299, False: 941]
  ------------------
  941|    299|        status = json_rtcm2_read(buf,
  942|    299|                                 gpsdata->dev.path, sizeof(gpsdata->dev.path),
  943|    299|                                 &gpsdata->rtcm2, end);
  944|    299|        if (PASS(status)) {
  ------------------
  |  |  789|    299|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|    224|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 75, False: 224]
  |  |  |  Branch (789:32): [True: 17, False: 207]
  |  |  ------------------
  ------------------
  945|     92|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     92|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     92|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     92|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     92|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     92|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     92|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     92|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     92|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     92|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     92|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     92|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     92|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     92|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     92|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     92|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  946|     92|            gpsdata->set |= RTCM2_SET;
  ------------------
  |  | 2853|     92|#define RTCM2_SET       (1llu<<22)
  ------------------
  947|     92|        }
  948|    299|        return FILTER(status);
  ------------------
  |  |  790|    299|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    299|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 17, False: 282]
  |  |  ------------------
  ------------------
  949|    299|    }
  950|    941|    if (str_starts_with(classtag, "\"class\":\"RTCM3\"")) {
  ------------------
  |  Branch (950:9): [True: 145, False: 796]
  ------------------
  951|    145|        status = json_rtcm3_read(buf,
  952|    145|                                 gpsdata->dev.path, sizeof(gpsdata->dev.path),
  953|    145|                                 &gpsdata->rtcm3, end);
  954|    145|        if (PASS(status)) {
  ------------------
  |  |  789|    145|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|    119|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 26, False: 119]
  |  |  |  Branch (789:32): [True: 1, False: 118]
  |  |  ------------------
  ------------------
  955|     27|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     27|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     27|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     27|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     27|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     27|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     27|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     27|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     27|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     27|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     27|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     27|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     27|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     27|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     27|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     27|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  956|     27|            gpsdata->set |= RTCM3_SET;
  ------------------
  |  | 2854|     27|#define RTCM3_SET       (1llu<<23)
  ------------------
  957|     27|        }
  958|    145|        return FILTER(status);
  ------------------
  |  |  790|    145|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    145|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 1, False: 144]
  |  |  ------------------
  ------------------
  959|    145|    }
  960|    796|#ifdef AIVDM_ENABLE
  961|    796|    if (str_starts_with(classtag, "\"class\":\"AIS\"")) {
  ------------------
  |  Branch (961:9): [True: 331, False: 465]
  ------------------
  962|    331|        status = json_ais_read(buf,
  963|    331|                               gpsdata->dev.path, sizeof(gpsdata->dev.path),
  964|    331|                               &gpsdata->ais, end);
  965|    331|        if (PASS(status)) {
  ------------------
  |  |  789|    331|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|    185|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 146, False: 185]
  |  |  |  Branch (789:32): [True: 27, False: 158]
  |  |  ------------------
  ------------------
  966|    173|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|    173|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|    173|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|    173|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|    173|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|    173|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|    173|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|    173|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|    173|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|    173|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|    173|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|    173|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|    173|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|    173|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|    173|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|    173|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  967|    173|            gpsdata->set |= AIS_SET;
  ------------------
  |  | 2855|    173|#define AIS_SET         (1llu<<24)
  ------------------
  968|    173|        }
  969|    331|        return FILTER(status);
  ------------------
  |  |  790|    331|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    331|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 27, False: 304]
  |  |  ------------------
  ------------------
  970|    331|    }
  971|    465|#endif  // AIVDM_ENABLE
  972|    465|    if (str_starts_with(classtag, "\"class\":\"ERROR\"")) {
  ------------------
  |  Branch (972:9): [True: 8, False: 457]
  ------------------
  973|      8|        status = json_error_read(buf, gpsdata, end);
  974|      8|        if (PASS(status)) {
  ------------------
  |  |  789|      8|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|      6|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 2, False: 6]
  |  |  |  Branch (789:32): [True: 0, False: 6]
  |  |  ------------------
  ------------------
  975|      2|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|      2|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|      2|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|      2|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|      2|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|      2|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|      2|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|      2|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|      2|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|      2|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|      2|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|      2|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|      2|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|      2|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|      2|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|      2|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  976|      2|            gpsdata->set |= ERROR_SET;
  ------------------
  |  | 2862|      2|#define ERROR_SET       (1llu<<31)
  ------------------
  977|      2|        }
  978|      8|        return FILTER(status);
  ------------------
  |  |  790|      8|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|      8|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 8]
  |  |  ------------------
  ------------------
  979|      8|    }
  980|    457|    if (str_starts_with(classtag, "\"class\":\"TOFF\"")) {
  ------------------
  |  Branch (980:9): [True: 26, False: 431]
  ------------------
  981|     26|        status = json_toff_read(buf, gpsdata, end);
  982|     26|        if (PASS(status)) {
  ------------------
  |  |  789|     26|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     13|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 13, False: 13]
  |  |  |  Branch (789:32): [True: 0, False: 13]
  |  |  ------------------
  ------------------
  983|     13|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     13|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     13|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     13|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     13|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     13|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     13|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     13|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     13|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     13|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     13|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     13|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     13|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     13|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     13|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     13|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  984|     13|            gpsdata->set |= TOFF_SET;
  ------------------
  |  | 2863|     13|#define TOFF_SET        (1llu<<32)      // not yet used
  ------------------
  985|     13|        }
  986|     26|        return FILTER(status);
  ------------------
  |  |  790|     26|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     26|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 26]
  |  |  ------------------
  ------------------
  987|     26|    }
  988|    431|    if (str_starts_with(classtag, "\"class\":\"PPS\"")) {
  ------------------
  |  Branch (988:9): [True: 36, False: 395]
  ------------------
  989|     36|        status = json_pps_read(buf, gpsdata, end);
  990|     36|        if (PASS(status)) {
  ------------------
  |  |  789|     36|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     14|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 22, False: 14]
  |  |  |  Branch (789:32): [True: 0, False: 14]
  |  |  ------------------
  ------------------
  991|     22|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     22|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     22|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     22|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     22|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     22|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     22|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     22|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     22|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     22|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     22|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     22|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     22|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     22|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     22|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     22|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  992|     22|            gpsdata->set |= PPS_SET;
  ------------------
  |  | 2864|     22|#define PPS_SET         (1llu<<33)
  ------------------
  993|     22|        }
  994|     36|        return FILTER(status);
  ------------------
  |  |  790|     36|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     36|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 36]
  |  |  ------------------
  ------------------
  995|     36|    }
  996|    395|    if (str_starts_with(classtag, "\"class\":\"OSC\"")) {
  ------------------
  |  Branch (996:9): [True: 25, False: 370]
  ------------------
  997|     25|        status = json_oscillator_read(buf, gpsdata, end);
  998|     25|        if (PASS(status)) {
  ------------------
  |  |  789|     25|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|      6|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 19, False: 6]
  |  |  |  Branch (789:32): [True: 0, False: 6]
  |  |  ------------------
  ------------------
  999|     19|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     19|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     19|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     19|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     19|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     19|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     19|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     19|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     19|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     19|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     19|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     19|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     19|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     19|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     19|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     19|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
 1000|     19|            gpsdata->set |= OSCILLATOR_SET;
  ------------------
  |  | 2866|     19|#define OSCILLATOR_SET  (1llu<<35)
  ------------------
 1001|     19|        }
 1002|     25|        return FILTER(status);
  ------------------
  |  |  790|     25|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     25|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 25]
  |  |  ------------------
  ------------------
 1003|     25|    }
 1004|    370|    if (str_starts_with(classtag, "\"class\":\"RAW\"")) {
  ------------------
  |  Branch (1004:9): [True: 150, False: 220]
  ------------------
 1005|    150|        status = json_raw_read(buf, gpsdata, end);
 1006|    150|        if (PASS(status)) {
  ------------------
  |  |  789|    150|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|    126|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:18): [True: 24, False: 126]
  |  |  |  Branch (789:32): [True: 0, False: 126]
  |  |  ------------------
  ------------------
 1007|     24|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     24|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     24|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     24|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     24|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     24|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     24|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     24|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     24|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     24|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     24|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     24|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     24|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     24|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     24|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     24|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
 1008|     24|            gpsdata->set |= RAW_SET;
  ------------------
  |  | 2870|     24|#define RAW_SET         (1llu<<39)
  ------------------
 1009|     24|        }
 1010|    150|        return FILTER(status);
  ------------------
  |  |  790|    150|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    150|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (790:20): [True: 0, False: 150]
  |  |  ------------------
  ------------------
 1011|    150|    }
 1012|       |    // else, unkwown class type
 1013|    220|    return -1;
 1014|    370|}
libgps_json.c:json_tpv_read:
   37|    291|{
   38|    291|    int ret;
   39|       |
   40|    291|    const struct json_attr_t json_attrs_1[] = {
   41|       |        // *INDENT-OFF*
   42|    291|        {"class",  t_check,   .dflt.check = "TPV"},
   43|    291|        {"alt",    t_real,    .addr.real = &gpsdata->fix.altitude,
   44|    291|                                 .dflt.real = NAN}, // DEPRECATED, undefined
   45|    291|        {"altHAE", t_real,    .addr.real = &gpsdata->fix.altHAE,
   46|    291|                                 .dflt.real = NAN},
   47|    291|        {"altMSL", t_real,    .addr.real = &gpsdata->fix.altMSL,
   48|    291|                                 .dflt.real = NAN},
   49|    291|        {"ant",    t_integer, .addr.integer = &gpsdata->fix.ant_stat,
   50|    291|                                 .dflt.integer = 0},
   51|    291|        {"baseS",     t_integer,   .addr.integer = &gpsdata->fix.base.status,
   52|    291|         .dflt.integer = STATUS_UNK},     // aka zero
  ------------------
  |  |  207|    291|#define STATUS_UNK      0       // Unknown status
  ------------------
   53|    291|        {"baseE",     t_real,      .addr.real = &gpsdata->fix.base.east,
   54|    291|         .dflt.real = NAN},
   55|    291|        {"baseN",     t_real,      .addr.real = &gpsdata->fix.base.north,
   56|    291|         .dflt.real = NAN},
   57|    291|        {"baseU",     t_real,      .addr.real = &gpsdata->fix.base.up,
   58|    291|         .dflt.real = NAN},
   59|    291|        {"baseL",     t_real,      .addr.real = &gpsdata->fix.base.length,
   60|    291|         .dflt.real = NAN},
   61|    291|        {"baseC",     t_real,      .addr.real = &gpsdata->fix.base.course,
   62|    291|         .dflt.real = NAN},
   63|    291|        {"climb",  t_real,    .addr.real = &gpsdata->fix.climb,
   64|    291|                                 .dflt.real = NAN},
   65|    291|        {"datum",  t_string,  .addr.string = gpsdata->fix.datum,
   66|    291|                                 .len = sizeof(gpsdata->fix.datum)},
   67|    291|        {"device", t_string,  .addr.string = gpsdata->dev.path,
   68|    291|                                 .len = sizeof(gpsdata->dev.path)},
   69|    291|        {"depth", t_real,  .addr.real = &gpsdata->fix.depth,
   70|    291|                                 .dflt.real = NAN},
   71|    291|        {"dgpsAge", t_real, .addr.real = &gpsdata->fix.dgps_age,
   72|    291|                                 .dflt.real = NAN},
   73|    291|        {"dgpsRatio", t_real, .addr.real = &gpsdata->fix.base.ratio,
   74|    291|                                 .dflt.real = NAN},
   75|    291|        {"dgpsSta", t_integer, .addr.integer = &gpsdata->fix.dgps_station,
   76|    291|                                 .dflt.integer = -1},
   77|    291|        {"ecefx",  t_real,    .addr.real = &gpsdata->fix.ecef.x,
   78|    291|                                 .dflt.real = NAN},
   79|    291|        {"ecefy",  t_real,    .addr.real = &gpsdata->fix.ecef.y,
   80|    291|                                 .dflt.real = NAN},
   81|    291|        {"ecefz",  t_real,    .addr.real = &gpsdata->fix.ecef.z,
   82|    291|                                 .dflt.real = NAN},
   83|    291|        {"ecefvx", t_real,    .addr.real = &gpsdata->fix.ecef.vx,
   84|    291|                                 .dflt.real = NAN},
   85|    291|        {"ecefvy", t_real,    .addr.real = &gpsdata->fix.ecef.vy,
   86|    291|                                 .dflt.real = NAN},
   87|    291|        {"ecefvz", t_real,    .addr.real = &gpsdata->fix.ecef.vz,
   88|    291|                                 .dflt.real = NAN},
   89|    291|        {"ecefpAcc", t_real,  .addr.real = &gpsdata->fix.ecef.pAcc,
   90|    291|                                 .dflt.real = NAN},
   91|    291|        {"ecefvAcc", t_real,  .addr.real = &gpsdata->fix.ecef.vAcc,
   92|    291|                                 .dflt.real = NAN},
   93|    291|        {"epc",    t_real,    .addr.real = &gpsdata->fix.epc,
   94|    291|                                 .dflt.real = NAN},
   95|    291|        {"epd",    t_real,    .addr.real = &gpsdata->fix.epd,
   96|    291|                                 .dflt.real = NAN},
   97|    291|        {"eph",    t_real,    .addr.real = &gpsdata->fix.eph,
   98|    291|                                 .dflt.real = NAN},
   99|    291|        {"eps",    t_real,    .addr.real = &gpsdata->fix.eps,
  100|    291|                                 .dflt.real = NAN},
  101|    291|        {"ept",    t_real,    .addr.real = &gpsdata->fix.ept,
  102|    291|                                 .dflt.real = NAN},
  103|    291|        {"epx",    t_real,    .addr.real = &gpsdata->fix.epx,
  104|    291|                                 .dflt.real = NAN},
  105|    291|        {"epy",    t_real,    .addr.real = &gpsdata->fix.epy,
  106|    291|                                 .dflt.real = NAN},
  107|    291|        {"epv",    t_real,    .addr.real = &gpsdata->fix.epv,
  108|    291|                                 .dflt.real = NAN},
  109|    291|        {"geoidSep", t_real,  .addr.real = &gpsdata->fix.geoid_sep,
  110|    291|                                 .dflt.real = NAN},
  111|    291|        {"lat",    t_real,    .addr.real = &gpsdata->fix.latitude,
  112|    291|                                 .dflt.real = NAN},
  113|    291|        {"jam",    t_integer, .addr.integer = &gpsdata->fix.jam,
  114|    291|                                 .dflt.integer = -1},
  115|    291|        {"leapseconds",   t_integer, .addr.integer = &gpsdata->leap_seconds,
  116|    291|                                 .dflt.integer = 0},
  117|    291|        {"lon",    t_real,    .addr.real = &gpsdata->fix.longitude,
  118|    291|                                 .dflt.real = NAN},
  119|    291|        {"magtrack",  t_real,    .addr.real = &gpsdata->fix.magnetic_track,
  120|    291|                                 .dflt.real = NAN},
  121|    291|        {"magvar",  t_real,   .addr.real = &gpsdata->fix.magnetic_var,
  122|    291|                                 .dflt.real = NAN},
  123|    291|        {"mode",   t_integer, .addr.integer = &gpsdata->fix.mode,
  124|    291|                                 .dflt.integer = MODE_NOT_SEEN},
  ------------------
  |  |  196|    291|#define MODE_NOT_SEEN   0       // mode update not seen yet
  ------------------
  125|    291|        {"relD", t_real,  .addr.real = &gpsdata->fix.NED.relPosD,
  126|    291|                                 .dflt.real = NAN},
  127|    291|        {"relE", t_real,  .addr.real = &gpsdata->fix.NED.relPosE,
  128|    291|                                 .dflt.real = NAN},
  129|    291|        {"relN", t_real,  .addr.real = &gpsdata->fix.NED.relPosN,
  130|    291|                                 .dflt.real = NAN},
  131|    291|        {"relH", t_real,  .addr.real = &gpsdata->fix.NED.relPosH,
  132|    291|                                 .dflt.real = NAN},
  133|    291|        {"relL", t_real,  .addr.real = &gpsdata->fix.NED.relPosL,
  134|    291|                                 .dflt.real = NAN},
  135|    291|        {"temp",   t_real, .addr.real = &gpsdata->fix.temp,
  136|    291|                                 .dflt.real = NAN},
  137|    291|        {"time",   t_time,    .addr.ts = &gpsdata->fix.time,
  138|    291|                                 .dflt.ts = {0, 0}},
  139|    291|        {"track",  t_real,    .addr.real = &gpsdata->fix.track,
  140|    291|                                 .dflt.real = NAN},
  141|    291|        {"sep",    t_real,    .addr.real = &gpsdata->fix.sep,
  142|    291|                                 .dflt.real = NAN},
  143|    291|        {"speed",  t_real,    .addr.real = &gpsdata->fix.speed,
  144|    291|                                 .dflt.real = NAN},
  145|    291|        {"status", t_integer, .addr.integer = &gpsdata->fix.status,
  146|    291|                                 .dflt.integer = STATUS_UNK},
  ------------------
  |  |  207|    291|#define STATUS_UNK      0       // Unknown status
  ------------------
  147|    291|        {"velD", t_real,  .addr.real = &gpsdata->fix.NED.velD,
  148|    291|                                 .dflt.real = NAN},
  149|    291|        {"velE", t_real,  .addr.real = &gpsdata->fix.NED.velE,
  150|    291|                                 .dflt.real = NAN},
  151|    291|        {"velN", t_real,  .addr.real = &gpsdata->fix.NED.velN,
  152|    291|                                 .dflt.real = NAN},
  153|    291|        {"wanglem", t_real, .addr.real = &gpsdata->fix.wanglem,
  154|    291|                                 .dflt.real = NAN},
  155|    291|        {"wangler", t_real, .addr.real = &gpsdata->fix.wangler,
  156|    291|                                 .dflt.real = NAN},
  157|    291|        {"wanglet", t_real, .addr.real = &gpsdata->fix.wanglet,
  158|    291|                                 .dflt.real = NAN},
  159|    291|        {"wspeedr", t_real, .addr.real = &gpsdata->fix.wspeedr,
  160|    291|                                 .dflt.real = NAN},
  161|    291|        {"wspeedt", t_real, .addr.real = &gpsdata->fix.wspeedt,
  162|    291|                                 .dflt.real = NAN},
  163|    291|        {"wtemp", t_real, .addr.real = &gpsdata->fix.wtemp,
  164|    291|                                 .dflt.real = NAN},
  165|       |        // ignore unknown keys, for cross-version compatibility
  166|    291|        {"", t_ignore},
  167|       |
  168|    291|        {NULL},
  169|       |        // *INDENT-ON*
  170|    291|    };
  171|       |
  172|    291|    ret = json_read_object(buf, json_attrs_1, endptr);
  173|    291|    return ret;
  174|    291|}
libgps_json.c:json_noise_read:
  178|    294|{
  179|    294|    int ret;
  180|       |
  181|    294|    const struct json_attr_t json_attrs_1[] = {
  182|       |        // *INDENT-OFF*
  183|    294|        {"class",  t_check,   .dflt.check = "GST"},
  184|    294|        {"device", t_string,  .addr.string = gpsdata->dev.path,
  185|    294|                                 .len = sizeof(gpsdata->dev.path)},
  186|    294|        {"time",   t_time,    .addr.ts = &gpsdata->gst.utctime,
  187|    294|                                 .dflt.ts = {0, 0}},
  188|    294|        {"alt",    t_real,    .addr.real = &gpsdata->gst.alt_err_deviation,
  189|    294|                                 .dflt.real = NAN},
  190|    294|        {"lat",    t_real,    .addr.real = &gpsdata->gst.lat_err_deviation,
  191|    294|                                 .dflt.real = NAN},
  192|    294|        {"lon",    t_real,    .addr.real = &gpsdata->gst.lon_err_deviation,
  193|    294|                                 .dflt.real = NAN},
  194|    294|        {"major",  t_real,    .addr.real = &gpsdata->gst.smajor_deviation,
  195|    294|                                 .dflt.real = NAN},
  196|    294|        {"minor",  t_real,    .addr.real = &gpsdata->gst.sminor_deviation,
  197|    294|                                 .dflt.real = NAN},
  198|    294|        {"orient", t_real,    .addr.real = &gpsdata->gst.smajor_orientation,
  199|    294|                                 .dflt.real = NAN},
  200|    294|        {"rms",    t_real,    .addr.real = &gpsdata->gst.rms_deviation,
  201|    294|                                 .dflt.real = NAN},
  202|    294|        {"ve",     t_real,    .addr.real = &gpsdata->gst.ve_err_deviation,
  203|    294|                                 .dflt.real = NAN},
  204|    294|        {"vn",     t_real,    .addr.real = &gpsdata->gst.vn_err_deviation,
  205|    294|                                 .dflt.real = NAN},
  206|    294|        {"vu",     t_real,    .addr.real = &gpsdata->gst.vu_err_deviation,
  207|    294|                                 .dflt.real = NAN},
  208|       |        // ignore unknown keys, for cross-version compatibility
  209|    294|        {"", t_ignore},
  210|    294|        {NULL},
  211|       |        // *INDENT-ON*
  212|    294|    };
  213|       |
  214|    294|    ret = json_read_object(buf, json_attrs_1, endptr);
  215|       |
  216|    294|    return ret;
  217|    294|}
libgps_json.c:json_sky_read:
  294|    209|{
  295|       |
  296|    209|    const struct json_attr_t json_attrs_satellites[] = {
  297|       |        // *INDENT-OFF*
  298|    209|        {"PRN",    t_short,   STRUCTOBJECT(struct satellite_t, PRN)},
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  299|    209|        {"az",     t_real,    STRUCTOBJECT(struct satellite_t, azimuth),
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  300|    209|                              .dflt.real = NAN},
  301|    209|        {"el",     t_real,    STRUCTOBJECT(struct satellite_t, elevation),
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  302|    209|                              .dflt.real = NAN},
  303|    209|        {"freqid", t_byte,    STRUCTOBJECT(struct satellite_t, freqid),
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  304|    209|                              .dflt.byte = -1},
  305|    209|        {"gnssid", t_ubyte,   STRUCTOBJECT(struct satellite_t, gnssid)},
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  306|    209|        {"health", t_ubyte,   STRUCTOBJECT(struct satellite_t, health),
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  307|    209|                              .dflt.ubyte = SAT_HEALTH_UNK},
  ------------------
  |  | 2572|    209|#define SAT_HEALTH_UNK 0
  ------------------
  308|    209|        {"pr",     t_real,    STRUCTOBJECT(struct satellite_t, pr),
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  309|    209|                              .dflt.real = NAN},
  310|    209|        {"prRate", t_real,    STRUCTOBJECT(struct satellite_t, prRate),
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  311|    209|                              .dflt.real = NAN},
  312|    209|        {"prRes",  t_real,    STRUCTOBJECT(struct satellite_t, prRes),
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  313|    209|                              .dflt.real = NAN},
  314|    209|        {"ss",     t_real,    STRUCTOBJECT(struct satellite_t, ss),
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  315|    209|                              .dflt.real = NAN},
  316|    209|        {"sigid",  t_ubyte,   STRUCTOBJECT(struct satellite_t, sigid)},
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  317|    209|        {"svid",   t_ubyte,   STRUCTOBJECT(struct satellite_t, svid)},
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  318|    209|        {"used",   t_boolean, STRUCTOBJECT(struct satellite_t, used)},
  ------------------
  |  |  188|    209|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  319|       |        // ignore unknown keys, for cross-version compatibility
  320|    209|        {"", t_ignore},
  321|       |        // *INDENT-ON*
  322|    209|        {NULL},
  323|    209|    };
  324|       |
  325|    209|    int nSat = -1;  // Use nSat only to know if sats are in SKY
  326|       |
  327|    209|    const struct json_attr_t json_attrs_2[] = {
  328|       |        // *INDENT-OFF*
  329|    209|        {"class",      t_check,   .dflt.check = "SKY"},
  330|    209|        {"device",     t_string,  .addr.string  = gpsdata->dev.path,
  331|    209|                                     .len = sizeof(gpsdata->dev.path)},
  332|    209|        {"gdop",       t_real,    .addr.real    = &gpsdata->dop.gdop,
  333|    209|                                     .dflt.real = NAN},
  334|    209|        {"hdop",       t_real,    .addr.real    = &gpsdata->dop.hdop,
  335|    209|                                     .dflt.real = NAN},
  336|    209|        {"nSat",       t_integer, .addr.integer = &nSat,
  337|    209|                                     .dflt.integer = -1},
  338|    209|        {"pdop",       t_real,    .addr.real    = &gpsdata->dop.pdop,
  339|    209|                                     .dflt.real = NAN},
  340|    209|        {"tdop",       t_real,    .addr.real    = &gpsdata->dop.tdop,
  341|    209|                                     .dflt.real = NAN},
  342|    209|        {"vdop",       t_real,    .addr.real    = &gpsdata->dop.vdop,
  343|    209|                                     .dflt.real = NAN},
  344|    209|        {"xdop",       t_real,    .addr.real    = &gpsdata->dop.xdop,
  345|    209|                                     .dflt.real = NAN},
  346|    209|        {"ydop",       t_real,    .addr.real    = &gpsdata->dop.ydop,
  347|    209|                                     .dflt.real = NAN},
  348|    209|        {"satellites", t_array,
  349|    209|                                   STRUCTARRAY(gpsdata->skyview,
  ------------------
  |  |  190|    209|        .addr.array.element_type = t_structobject, \
  |  |  191|    209|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    209|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    209|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    209|        .addr.array.count = n, \
  |  |  195|    209|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1173|    209|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    209|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    209|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    209|            struct { \
  |  |  |  |  |  |   71|    209|                int unused_int; \
  |  |  |  |  |  |   72|    209|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    209|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    209|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    209|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    209|            }; \
  |  |  |  |  |  |   77|    209|            1; \
  |  |  |  |  |  |   78|    209|        })) \
  |  |  |  |  |  |   79|    209|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  350|    209|                                         json_attrs_satellites,
  351|    209|                                         &gpsdata->satellites_visible)},
  352|    209|        {"time",       t_time,    .addr.ts = &gpsdata->skyview_time,
  353|    209|                                     .dflt.ts = {0, 0}},
  354|    209|        {"uSat",       t_integer, .addr.integer = &gpsdata->satellites_used,
  355|    209|                                     .dflt.integer = 0},
  356|       |        // ignore unknown keys, for cross-version compatibility
  357|    209|        {"", t_ignore},
  358|    209|        {NULL},
  359|       |        // *INDENT-ON*
  360|    209|    };
  361|    209|    int status, i;
  362|       |
  363|    209|    memset(&gpsdata->skyview, 0, sizeof(gpsdata->skyview));
  364|       |
  365|    209|    status = json_read_object(buf, json_attrs_2, endptr);
  366|    209|    if (0 != status) {
  ------------------
  |  Branch (366:9): [True: 107, False: 102]
  ------------------
  367|    107|        return status;
  368|    107|    }
  369|       |
  370|    102|    if (1 == isfinite(gpsdata->dop.hdop) ||
  ------------------
  |  Branch (370:9): [True: 1, False: 101]
  ------------------
  371|    102|        1 == isfinite(gpsdata->dop.xdop) ||
  ------------------
  |  Branch (371:9): [True: 1, False: 100]
  ------------------
  372|    102|        1 == isfinite(gpsdata->dop.ydop) ||
  ------------------
  |  Branch (372:9): [True: 1, False: 99]
  ------------------
  373|    102|        1 == isfinite(gpsdata->dop.vdop) ||
  ------------------
  |  Branch (373:9): [True: 1, False: 98]
  ------------------
  374|    102|        1 == isfinite(gpsdata->dop.tdop) ||
  ------------------
  |  Branch (374:9): [True: 1, False: 97]
  ------------------
  375|    102|        1 == isfinite(gpsdata->dop.pdop) ||
  ------------------
  |  Branch (375:9): [True: 1, False: 96]
  ------------------
  376|    102|        1 == isfinite(gpsdata->dop.gdop)) {
  ------------------
  |  Branch (376:9): [True: 1, False: 95]
  ------------------
  377|       |        // got at least one DOP
  378|      7|        gpsdata->set |= DOP_SET;
  ------------------
  |  | 2842|      7|#define DOP_SET         (1llu<<11)
  ------------------
  379|      7|    }
  380|       |
  381|    102|    gpsdata->satellites_visible = 0;
  382|       |
  383|    102|    if (-1 == nSat) {
  ------------------
  |  Branch (383:9): [True: 16, False: 86]
  ------------------
  384|       |        // no sats in the SKY, likely just dops.  Maybe uSat
  385|     16|        gpsdata->set &= ~SATELLITE_SET;
  ------------------
  |  | 2846|     16|#define SATELLITE_SET   (1llu<<15)
  ------------------
  386|     16|        return 0;
  387|     16|    }
  388|     86|    gpsdata->satellites_used = 0;
  389|       |
  390|     86|    gpsdata->set |= SATELLITE_SET;
  ------------------
  |  | 2846|     86|#define SATELLITE_SET   (1llu<<15)
  ------------------
  391|       |    // recalculate used and visible, do not use nSat, uSat
  392|  15.9k|    for (i = 0; i < MAXCHANNELS; i++) {
  ------------------
  |  |  118|  15.9k|#define MAXCHANNELS     184     // u-blox 9 tracks 140 signals
  ------------------
  |  Branch (392:17): [True: 15.8k, False: 86]
  ------------------
  393|  15.8k|        if (0 < gpsdata->skyview[i].PRN) {
  ------------------
  |  Branch (393:13): [True: 1.30k, False: 14.5k]
  ------------------
  394|  1.30k|            gpsdata->satellites_visible++;
  395|  1.30k|        }
  396|  15.8k|        if (gpsdata->skyview[i].used) {
  ------------------
  |  Branch (396:13): [True: 1.29k, False: 14.5k]
  ------------------
  397|  1.29k|            gpsdata->satellites_used++;
  398|  1.29k|        }
  399|  15.8k|    }
  400|       |
  401|     86|    return 0;
  402|    102|}
libgps_json.c:json_att_read:
  407|     57|{
  408|     57|    struct attitude_t *datap = &gpsdata->attitude;
  409|       |
  410|     57|    const struct json_attr_t json_attrs_1[] = {
  411|       |        // *INDENT-OFF*
  412|     57|        {"class",     t_check,     .dflt.check = "ATT"},
  413|     57|        {"device",    t_string,    .addr.string = gpsdata->dev.path,
  414|     57|         .len = sizeof(gpsdata->dev.path)},
  415|     57|        {"acc_len",   t_real,      .addr.real = &datap->acc_len,
  416|     57|         .dflt.real = NAN},
  417|     57|        {"acc_x",     t_real,      .addr.real = &datap->acc_x,
  418|     57|         .dflt.real = NAN},
  419|     57|        {"acc_y",     t_real,      .addr.real = &datap->acc_y,
  420|     57|         .dflt.real = NAN},
  421|     57|        {"acc_z",     t_real,      .addr.real = &datap->acc_z,
  422|     57|         .dflt.real = NAN},
  423|     57|        {"baseS",     t_integer,   .addr.integer = &datap->base.status,
  424|     57|         .dflt.integer = STATUS_UNK},     // aka zero
  ------------------
  |  |  207|     57|#define STATUS_UNK      0       // Unknown status
  ------------------
  425|     57|        {"baseE",     t_real,      .addr.real = &datap->base.east,
  426|     57|         .dflt.real = NAN},
  427|     57|        {"baseN",     t_real,      .addr.real = &datap->base.north,
  428|     57|         .dflt.real = NAN},
  429|     57|        {"baseU",     t_real,      .addr.real = &datap->base.up,
  430|     57|         .dflt.real = NAN},
  431|     57|        {"baseL",     t_real,      .addr.real = &datap->base.length,
  432|     57|         .dflt.real = NAN},
  433|     57|        {"baseC",     t_real,      .addr.real = &datap->base.course,
  434|     57|         .dflt.real = NAN},
  435|     57|        {"dgpsRatio", t_real, .addr.real = &datap->base.ratio,
  436|     57|         .dflt.real = NAN},
  437|     57|        {"depth",     t_real,      .addr.real = &datap->depth,
  438|     57|         .dflt.real = NAN},
  439|     57|        {"dip",       t_real,      .addr.real = &datap->dip,
  440|     57|         .dflt.real = NAN},
  441|     57|        {"gyro_temp", t_real,      .addr.real = &datap->gyro_x,
  442|     57|         .dflt.real = NAN},
  443|     57|        {"gyro_x",    t_real,      .addr.real = &datap->gyro_x,
  444|     57|         .dflt.real = NAN},
  445|     57|        {"gyro_y",    t_real,      .addr.real = &datap->gyro_y,
  446|     57|         .dflt.real = NAN},
  447|     57|        {"gyro_z",    t_real,      .addr.real = &datap->gyro_z,
  448|     57|         .dflt.real = NAN},
  449|     57|        {"heading",   t_real,      .addr.real = &datap->heading,
  450|     57|         .dflt.real = NAN},
  451|     57|        {"mag_len",   t_real,      .addr.real = &datap->mag_len,
  452|     57|         .dflt.real = NAN},
  453|     57|        {"mag_st",    t_character, .addr.character = &datap->mag_st},
  454|     57|        {"mag_x",     t_real,      .addr.real = &datap->mag_x,
  455|     57|         .dflt.real = NAN},
  456|     57|        {"mag_y",     t_real,      .addr.real = &datap->mag_y,
  457|     57|         .dflt.real = NAN},
  458|     57|        {"mag_z",     t_real,      .addr.real = &datap->mag_z,
  459|     57|         .dflt.real = NAN},
  460|     57|        {"mheading",   t_real,     .addr.real = &datap->mheading,
  461|     57|         .dflt.real = NAN},
  462|     57|        {"msg",       t_string,    .addr.string = datap->msg,
  463|     57|         .len = sizeof(datap->msg)},
  464|     57|        {"pitch_st",  t_character, .addr.character = &datap->pitch_st},
  465|     57|        {"pitch",     t_real,      .addr.real = &datap->pitch,
  466|     57|         .dflt.real = NAN},
  467|     57|        {"roll_st",   t_character, .addr.character = &datap->roll_st},
  468|     57|        {"roll",      t_real,      .addr.real = &datap->roll,
  469|     57|         .dflt.real = NAN},
  470|     57|        {"temp",      t_real,      .addr.real = &datap->temp,
  471|     57|         .dflt.real = NAN},
  472|     57|        {"time",      t_time,      .addr.ts = &datap->mtime, .dflt.ts = {0, 0}},
  473|     57|        {"timeTag",   t_ulongint,  .addr.ulongint = &datap->timeTag,
  474|     57|         .dflt.ulongint = 0},
  475|     57|        {"yaw_st",    t_character, .addr.character = &datap->yaw_st},
  476|     57|        {"yaw",       t_real,      .addr.real = &datap->yaw, .dflt.real = NAN},
  477|       |
  478|       |        // ignore unknown keys, for cross-version compatibility
  479|     57|        {"", t_ignore},
  480|     57|        {NULL},
  481|       |        // *INDENT-ON*
  482|     57|    };
  483|       |
  484|     57|    return json_read_object(buf, json_attrs_1, endptr);
  485|     57|}
libgps_json.c:json_imu_read:
  490|     59|{
  491|       |    // the client only uses the first slot.
  492|     59|    struct attitude_t *datap = &gpsdata->imu[0];
  493|       |
  494|     59|    const struct json_attr_t json_attrs_1[] = {
  495|       |        // *INDENT-OFF*
  496|     59|        {"class",     t_check,     .dflt.check = "IMU"},
  497|     59|        {"device",    t_string,    .addr.string = gpsdata->dev.path,
  498|     59|         .len = sizeof(gpsdata->dev.path)},
  499|     59|        {"acc_len",   t_real,      .addr.real = &datap->acc_len,
  500|     59|         .dflt.real = NAN},
  501|     59|        {"acc_x",     t_real,      .addr.real = &datap->acc_x,
  502|     59|         .dflt.real = NAN},
  503|     59|        {"acc_y",     t_real,      .addr.real = &datap->acc_y,
  504|     59|         .dflt.real = NAN},
  505|     59|        {"acc_z",     t_real,      .addr.real = &datap->acc_z,
  506|     59|         .dflt.real = NAN},
  507|     59|        {"depth",     t_real,      .addr.real = &datap->depth,
  508|     59|         .dflt.real = NAN},
  509|     59|        {"dip",       t_real,      .addr.real = &datap->dip,
  510|     59|         .dflt.real = NAN},
  511|     59|        {"gyro_temp", t_real,      .addr.real = &datap->gyro_temp,
  512|     59|         .dflt.real = NAN},
  513|     59|        {"gyro_x",    t_real,      .addr.real = &datap->gyro_x,
  514|     59|         .dflt.real = NAN},
  515|     59|        {"gyro_y",    t_real,      .addr.real = &datap->gyro_y,
  516|     59|         .dflt.real = NAN},
  517|     59|        {"gyro_z",    t_real,      .addr.real = &datap->gyro_z,
  518|     59|         .dflt.real = NAN},
  519|     59|        {"heading",   t_real,      .addr.real = &datap->heading,
  520|     59|         .dflt.real = NAN},
  521|     59|        {"mag_len",   t_real,      .addr.real = &datap->mag_len,
  522|     59|         .dflt.real = NAN},
  523|     59|        {"mag_st",    t_character, .addr.character = &datap->mag_st},
  524|     59|        {"mag_x",     t_real,      .addr.real = &datap->mag_x,
  525|     59|         .dflt.real = NAN},
  526|     59|        {"mag_y",     t_real,      .addr.real = &datap->mag_y,
  527|     59|         .dflt.real = NAN},
  528|     59|        {"mag_z",     t_real,      .addr.real = &datap->mag_z,
  529|     59|         .dflt.real = NAN},
  530|     59|        {"msg",       t_string,    .addr.string = datap->msg,
  531|     59|         .len = sizeof(datap->msg)},
  532|     59|        {"pitch_st",  t_character, .addr.character = &datap->pitch_st},
  533|     59|        {"pitch",     t_real,      .addr.real = &datap->pitch,
  534|     59|         .dflt.real = NAN},
  535|     59|        {"roll_st",   t_character, .addr.character = &datap->roll_st},
  536|     59|        {"roll",      t_real,      .addr.real = &datap->roll,
  537|     59|         .dflt.real = NAN},
  538|     59|        {"temp",      t_real,      .addr.real = &datap->temp,
  539|     59|         .dflt.real = NAN},
  540|     59|        {"time",      t_time,      .addr.ts = &datap->mtime, .dflt.ts = {0, 0}},
  541|     59|        {"timeTag",   t_ulongint,  .addr.ulongint = &datap->timeTag,
  542|     59|         .dflt.ulongint = 0},
  543|     59|        {"yaw_st",    t_character, .addr.character = &datap->yaw_st},
  544|     59|        {"yaw",       t_real,      .addr.real = &datap->yaw, .dflt.real = NAN},
  545|       |
  546|       |        // ignore unknown keys, for cross-version compatibility
  547|     59|        {"", t_ignore},
  548|     59|        {NULL},
  549|       |        // *INDENT-ON*
  550|     59|    };
  551|       |
  552|     59|    return json_read_object(buf, json_attrs_1, endptr);
  553|     59|}
libgps_json.c:json_devicelist_read:
  557|     48|{
  558|     48|    const struct json_attr_t json_attrs_subdevices[] = {
  559|       |        // *INDENT-OFF*
  560|     48|        {"class",      t_check,      .dflt.check = "DEVICE"},
  561|     48|        {"path",       t_string,     STRUCTOBJECT(struct devconfig_t, path),
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  562|     48|         .len = sizeof(gpsdata->devices.list[0].path)},
  563|     48|        {"activated",  t_time,
  564|     48|         STRUCTOBJECT(struct devconfig_t, activated)},
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  565|     48|        {"activated",  t_real,
  566|     48|         STRUCTOBJECT(struct devconfig_t, activated)},
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  567|     48|        {"flags",      t_integer,    STRUCTOBJECT(struct devconfig_t, flags)},
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  568|     48|        {"driver",     t_string,     STRUCTOBJECT(struct devconfig_t, driver),
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  569|     48|         .len = sizeof(gpsdata->devices.list[0].driver)},
  570|     48|        {"hexdata",    t_string,     STRUCTOBJECT(struct devconfig_t, hexdata),
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  571|     48|         .len = sizeof(gpsdata->devices.list[0].hexdata)},
  572|     48|        {"sernum",     t_string,     STRUCTOBJECT(struct devconfig_t, sernum),
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  573|     48|                            .len = sizeof(gpsdata->devices.list[0].sernum)},
  574|     48|        {"subtype",    t_string,     STRUCTOBJECT(struct devconfig_t, subtype),
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  575|     48|                            .len = sizeof(gpsdata->devices.list[0].subtype)},
  576|     48|        {"subtype1",   t_string,     STRUCTOBJECT(struct devconfig_t, subtype1),
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  577|     48|                            .len = sizeof(gpsdata->devices.list[0].subtype1)},
  578|     48|        {"native",     t_integer, STRUCTOBJECT(struct devconfig_t, driver_mode),
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  579|     48|                                        .dflt.integer = -1},
  580|     48|        {"bps",        t_uinteger,   STRUCTOBJECT(struct devconfig_t, baudrate),
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  581|     48|                                        .dflt.uinteger = DEVDEFAULT_BPS},
  ------------------
  |  |   53|     48|#define DEVDEFAULT_BPS          0
  ------------------
  582|     48|        {"parity",     t_character,  STRUCTOBJECT(struct devconfig_t, parity),
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  583|     48|                                        .dflt.character = DEVDEFAULT_PARITY},
  ------------------
  |  |   54|     48|#define DEVDEFAULT_PARITY       'X'
  ------------------
  584|     48|        {"stopbits",   t_uinteger,   STRUCTOBJECT(struct devconfig_t, stopbits),
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  585|     48|                                        .dflt.integer = DEVDEFAULT_STOPBITS},
  ------------------
  |  |   55|     48|#define DEVDEFAULT_STOPBITS     3
  ------------------
  586|     48|        {"cycle",      t_timespec,   STRUCTOBJECT(struct devconfig_t, cycle),
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  587|     48|                                        .dflt.ts = {0,0}},
  588|     48|        {"mincycle",   t_timespec,   STRUCTOBJECT(struct devconfig_t, mincycle),
  ------------------
  |  |  188|     48|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  589|     48|                                        .dflt.ts = {0,0}},
  590|       |        // ignore unknown keys, for cross-version compatibility
  591|     48|        {"", t_ignore},
  592|     48|        {NULL},
  593|       |        // *INDENT-ON*
  594|     48|    };
  595|     48|    const struct json_attr_t json_attrs_devices[] = {
  596|     48|        {"class", t_check,.dflt.check = "DEVICES"},
  597|     48|        {"devices", t_array, STRUCTARRAY(gpsdata->devices.list,
  ------------------
  |  |  190|     48|        .addr.array.element_type = t_structobject, \
  |  |  191|     48|        .addr.array.arr.objects.subtype = e, \
  |  |  192|     48|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|     48|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|     48|        .addr.array.count = n, \
  |  |  195|     48|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1173|     48|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|     48|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|     48|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|     48|            struct { \
  |  |  |  |  |  |   71|     48|                int unused_int; \
  |  |  |  |  |  |   72|     48|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|     48|            } zero_init = {0}; \
  |  |  |  |  |  |   74|     48|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|     48|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|     48|            }; \
  |  |  |  |  |  |   77|     48|            1; \
  |  |  |  |  |  |   78|     48|        })) \
  |  |  |  |  |  |   79|     48|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  598|     48|                                         json_attrs_subdevices,
  599|     48|                                         &gpsdata->devices.ndevices)},
  600|       |        // ignore unknown keys, for cross-version compatibility
  601|     48|        {"", t_ignore},
  602|     48|        {NULL},
  603|     48|    };
  604|     48|    int status;
  605|       |
  606|     48|    memset(&gpsdata->devices, 0, sizeof(gpsdata->devices));
  607|     48|    status = json_read_object(buf, json_attrs_devices, endptr);
  608|     48|    if (status != 0) {
  ------------------
  |  Branch (608:9): [True: 46, False: 2]
  ------------------
  609|     46|        return status;
  610|     46|    }
  611|       |
  612|      2|    (void)clock_gettime(CLOCK_REALTIME, &gpsdata->devices.time);
  613|      2|    return 0;
  614|     48|}
libgps_json.c:json_version_read:
  618|     17|{
  619|     17|    const struct json_attr_t json_attrs_version[] = {
  620|       |        // *INDENT-OFF*
  621|     17|        {"class",     t_check,   .dflt.check = "VERSION"},
  622|     17|        {"release",   t_string,  .addr.string  = gpsdata->version.release,
  623|     17|                                    .len = sizeof(gpsdata->version.release)},
  624|     17|        {"rev",       t_string,  .addr.string  = gpsdata->version.rev,
  625|     17|                                    .len = sizeof(gpsdata->version.rev)},
  626|     17|        {"proto_major", t_integer,
  627|     17|         .addr.integer = &gpsdata->version.proto_major},
  628|     17|        {"proto_minor", t_integer,
  629|     17|         .addr.integer = &gpsdata->version.proto_minor},
  630|     17|        {"remote",    t_string,  .addr.string  = gpsdata->version.remote,
  631|     17|                                    .len = sizeof(gpsdata->version.remote)},
  632|       |        // ignore unknown keys, for cross-version compatibility
  633|     17|        {"", t_ignore},
  634|     17|        {NULL},
  635|       |        // *INDENT-ON*
  636|     17|    };
  637|     17|    int status;
  638|       |
  639|     17|    memset(&gpsdata->version, 0, sizeof(gpsdata->version));
  640|     17|    status = json_read_object(buf, json_attrs_version, endptr);
  641|       |
  642|     17|    return status;
  643|     17|}
libgps_json.c:json_error_read:
  647|      8|{
  648|      8|    const struct json_attr_t json_attrs_error[] = {
  649|       |        // *INDENT-OFF*
  650|      8|        {"class",     t_check,   .dflt.check = "ERROR"},
  651|      8|        {"message",   t_string,  .addr.string  = gpsdata->error,
  652|      8|                                    .len = sizeof(gpsdata->error)},
  653|       |        // ignore unknown keys, for cross-version compatibility
  654|      8|        {"", t_ignore},
  655|      8|        {NULL},
  656|       |        // *INDENT-ON*
  657|      8|    };
  658|      8|    int status;
  659|       |
  660|      8|    memset(&gpsdata->error, 0, sizeof(gpsdata->error));
  661|      8|    status = json_read_object(buf, json_attrs_error, endptr);
  662|      8|    if (status != 0)
  ------------------
  |  Branch (662:9): [True: 6, False: 2]
  ------------------
  663|      6|        return status;
  664|       |
  665|      2|    return status;
  666|      8|}
libgps_json.c:json_raw_read:
  222|    150|{
  223|    150|    int measurements;
  224|       |    // initialized to shut up clang
  225|    150|    double mtime_s = 0.0, mtime_ns = 0.0;
  226|       |
  227|    150|    const struct json_attr_t json_attrs_meas[] = {
  228|       |        // *INDENT-OFF*
  229|    150|        {"gnssid",       t_ubyte,    STRUCTOBJECT(struct meas_t, gnssid)},
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  230|    150|        {"svid",         t_ubyte,    STRUCTOBJECT(struct meas_t, svid)},
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  231|    150|        {"sigid",        t_ubyte,    STRUCTOBJECT(struct meas_t, sigid),
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  232|    150|                                     .dflt.ubyte = 0},
  233|    150|        {"snr",          t_ubyte,    STRUCTOBJECT(struct meas_t, snr)},
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  234|    150|        {"freqid",       t_ubyte,    STRUCTOBJECT(struct meas_t, freqid),
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  235|    150|                                     .dflt.ubyte = 0},
  236|    150|        {"obs",          t_string,   STRUCTOBJECT(struct meas_t, obs_code),
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  237|    150|                                .len = sizeof(gpsdata->raw.meas[0].obs_code)},
  238|    150|        {"lli",          t_ubyte,    STRUCTOBJECT(struct meas_t, lli),
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  239|    150|                                     .dflt.ubyte = 0},
  240|    150|        {"locktime",     t_uinteger, STRUCTOBJECT(struct meas_t, locktime),
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  241|    150|                                     .dflt.uinteger = 0},
  242|    150|        {"carrierphase", t_real,     STRUCTOBJECT(struct meas_t, carrierphase),
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  243|    150|                                     .dflt.real = NAN},
  244|    150|        {"pseudorange",  t_real,     STRUCTOBJECT(struct meas_t, pseudorange),
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  245|    150|                                     .dflt.real = NAN},
  246|    150|        {"doppler",      t_real,     STRUCTOBJECT(struct meas_t, doppler),
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  247|    150|                                     .dflt.real = NAN},
  248|    150|        {"c2c",          t_real,     STRUCTOBJECT(struct meas_t, c2c),
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  249|    150|                                    .dflt.real = NAN},
  250|    150|        {"l2c",          t_real,     STRUCTOBJECT(struct meas_t, l2c),
  ------------------
  |  |  188|    150|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  251|    150|                                    .dflt.real = NAN},
  252|       |        // ignore unknown keys, for cross-version compatibility
  253|    150|        {"", t_ignore},
  254|       |        // *INDENT-ON*
  255|    150|        {NULL},
  256|    150|    };
  257|    150|    const struct json_attr_t json_attrs_raw[] = {
  258|       |        // *INDENT-OFF*
  259|    150|        {"class",      t_check,   .dflt.check = "RAW"},
  260|    150|        {"device",     t_string,  .addr.string  = gpsdata->dev.path,
  261|    150|                                    .len = sizeof(gpsdata->dev.path)},
  262|    150|        {"time",       t_real,    .addr.real = &mtime_s,
  263|    150|                                 .dflt.real = NAN},
  264|    150|        {"nsec",       t_real,    .addr.real = &mtime_ns,
  265|    150|                                 .dflt.real = NAN},
  266|    150|        {"rawdata",    t_array,   STRUCTARRAY(gpsdata->raw.meas,
  ------------------
  |  |  190|    150|        .addr.array.element_type = t_structobject, \
  |  |  191|    150|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    150|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    150|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    150|        .addr.array.count = n, \
  |  |  195|    150|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1173|    150|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    150|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    150|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    150|            struct { \
  |  |  |  |  |  |   71|    150|                int unused_int; \
  |  |  |  |  |  |   72|    150|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    150|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    150|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    150|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    150|            }; \
  |  |  |  |  |  |   77|    150|            1; \
  |  |  |  |  |  |   78|    150|        })) \
  |  |  |  |  |  |   79|    150|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  267|    150|                                     json_attrs_meas, &measurements)},
  268|       |        // ignore unknown keys, for cross-version compatibility
  269|    150|        {"", t_ignore},
  270|    150|        {NULL},
  271|       |        // *INDENT-ON*
  272|    150|    };
  273|    150|    int status;
  274|       |
  275|    150|    memset(&gpsdata->raw, 0, sizeof(gpsdata->raw));
  276|       |
  277|    150|    status = json_read_object(buf, json_attrs_raw, endptr);
  278|    150|    if (0 != status) {
  ------------------
  |  Branch (278:9): [True: 126, False: 24]
  ------------------
  279|    126|        return status;
  280|    126|    }
  281|     24|    gpsdata->set |= RAW_SET;
  ------------------
  |  | 2870|     24|#define RAW_SET         (1llu<<39)
  ------------------
  282|     24|    if (0 == isfinite(mtime_s) ||
  ------------------
  |  Branch (282:9): [True: 22, False: 2]
  ------------------
  283|     24|        0 == isfinite(mtime_ns)) {
  ------------------
  |  Branch (283:9): [True: 1, False: 1]
  ------------------
  284|     23|        return status;
  285|     23|    }
  286|      1|    gpsdata->raw.mtime.tv_sec = (time_t)mtime_s;
  287|      1|    gpsdata->raw.mtime.tv_nsec = (long)mtime_ns;
  288|       |
  289|      1|    return 0;
  290|     24|}

strlcpy:
  275|  1.06k|{
  276|  1.06k|    size_t len = strlen(src);
  277|  1.06k|    if (0!= siz ) {
  ------------------
  |  Branch (277:9): [True: 1.06k, False: 0]
  ------------------
  278|  1.06k|        if (len >= siz) {
  ------------------
  |  Branch (278:13): [True: 194, False: 875]
  ------------------
  279|    194|            memcpy(dst, src, siz - 1);
  280|    194|            dst[siz - 1] = '\0';
  281|    875|        } else {
  282|    875|            memcpy(dst, src, len + 1);
  283|    875|        }
  284|  1.06k|    }
  285|  1.06k|    return len;
  286|  1.06k|}

json_rtcm2_read:
   33|    299|{
   34|       |
   35|    299|    static char *stringptrs[NITEMS(rtcm2->words)];
   36|    299|    static char stringstore[sizeof(rtcm2->words) * 2];
   37|    299|    static int stringcount;
   38|       |
   39|       |/* *INDENT-OFF* */
   40|    299|#define RTCM2_HEADER \
   41|    299|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
   42|    299|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
   43|    299|        {"device",         t_string,   .addr.string = path, \
   44|    299|                                          .len = pathlen}, \
   45|    299|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
   46|    299|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
   47|    299|                                          .dflt.real = NAN}, \
   48|    299|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
   49|    299|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
   50|    299|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
   51|       |
   52|    299|    int status = 0, satcount = 0;
   53|       |
   54|    299|    const struct json_attr_t rtcm1_satellite[] = {
   55|    299|        {"ident",     t_uinteger, STRUCTOBJECT(struct gps_rangesat_t, ident)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
   56|    299|        {"udre",      t_uinteger, STRUCTOBJECT(struct gps_rangesat_t, udre)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
   57|    299|        {"iod",       t_uinteger, STRUCTOBJECT(struct gps_rangesat_t, iod)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
   58|    299|        {"prc",       t_real,     STRUCTOBJECT(struct gps_rangesat_t, prc)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
   59|    299|        {"rrc",       t_real,     STRUCTOBJECT(struct gps_rangesat_t, rrc)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
   60|    299|        {NULL},
   61|    299|    };
   62|    299|    const struct json_attr_t json_rtcm1[] = {
   63|    299|        RTCM2_HEADER
  ------------------
  |  |   41|    299|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   42|    299|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   43|    299|        {"device",         t_string,   .addr.string = path, \
  |  |   44|    299|                                          .len = pathlen}, \
  |  |   45|    299|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   46|    299|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   47|    299|                                          .dflt.real = NAN}, \
  |  |   48|    299|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   49|    299|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   50|    299|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
   64|    299|        {"satellites", t_array, STRUCTARRAY(rtcm2->gps_ranges.sat,
  ------------------
  |  |  190|    299|        .addr.array.element_type = t_structobject, \
  |  |  191|    299|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    299|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    299|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    299|        .addr.array.count = n, \
  |  |  195|    299|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1173|    299|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    299|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    299|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    299|            struct { \
  |  |  |  |  |  |   71|    299|                int unused_int; \
  |  |  |  |  |  |   72|    299|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    299|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    299|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    299|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    299|            }; \
  |  |  |  |  |  |   77|    299|            1; \
  |  |  |  |  |  |   78|    299|        })) \
  |  |  |  |  |  |   79|    299|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   65|    299|                                            rtcm1_satellite, &satcount)},
   66|    299|        {NULL},
   67|    299|    };
   68|       |
   69|    299|    const struct json_attr_t json_rtcm3[] = {
   70|    299|        RTCM2_HEADER
  ------------------
  |  |   41|    299|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   42|    299|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   43|    299|        {"device",         t_string,   .addr.string = path, \
  |  |   44|    299|                                          .len = pathlen}, \
  |  |   45|    299|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   46|    299|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   47|    299|                                          .dflt.real = NAN}, \
  |  |   48|    299|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   49|    299|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   50|    299|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
   71|    299|        {"x",              t_real,    .addr.real = &rtcm2->ref_sta.x,
   72|    299|                                         .dflt.real = NAN},
   73|    299|        {"y",              t_real,    .addr.real = &rtcm2->ref_sta.y,
   74|    299|                                         .dflt.real = NAN},
   75|    299|        {"z",              t_real,    .addr.real = &rtcm2->ref_sta.z,
   76|    299|                                         .dflt.real = NAN},
   77|    299|        {NULL},
   78|    299|    };
   79|       |
   80|       |    /*
   81|       |     * Beware! Needs to stay synchronized with a corresponding
   82|       |     * name array in the RTCM2 JSON dump code. This interpretation of
   83|       |     * NAVSYSTEM_GALILEO is assumed from RTCM3, it's not actually
   84|       |     * documented in RTCM 2.1.
   85|       |     */
   86|    299|    const struct json_enum_t system_table[] = {
   87|    299|        {"GPS", 0}, {"GLONASS", 1}, {"GALILEO", 2}, {"UNKNOWN", 3}, {NULL}
   88|    299|    };
   89|    299|    const struct json_attr_t json_rtcm4[] = {
   90|    299|        RTCM2_HEADER
  ------------------
  |  |   41|    299|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   42|    299|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   43|    299|        {"device",         t_string,   .addr.string = path, \
  |  |   44|    299|                                          .len = pathlen}, \
  |  |   45|    299|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   46|    299|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   47|    299|                                          .dflt.real = NAN}, \
  |  |   48|    299|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   49|    299|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   50|    299|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
   91|    299|        {"valid",          t_boolean, .addr.boolean = &rtcm2->reference.valid},
   92|    299|        {"system",         t_integer, .addr.integer = &rtcm2->reference.system,
   93|    299|                                         .map=system_table},
   94|    299|        {"sense",          t_integer, .addr.integer = &rtcm2->reference.sense},
   95|    299|        {"datum",          t_string,  .addr.string = rtcm2->reference.datum,
   96|    299|                                         .len = sizeof(rtcm2->reference.datum)},
   97|    299|        {"dx",             t_real,    .addr.real = &rtcm2->reference.dx,
   98|    299|                                         .dflt.real = NAN},
   99|    299|        {"dy",             t_real,    .addr.real = &rtcm2->reference.dy,
  100|    299|                                         .dflt.real = NAN},
  101|    299|        {"dz",             t_real,    .addr.real = &rtcm2->reference.dz,
  102|    299|                                         .dflt.real = NAN},
  103|    299|        {NULL},
  104|    299|    };
  105|       |
  106|    299|    const struct json_attr_t rtcm5_satellite[] = {
  107|    299|        {"ident",       t_uinteger, STRUCTOBJECT(struct consat_t, ident)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  108|    299|        {"iodl",        t_boolean,  STRUCTOBJECT(struct consat_t, iodl)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  109|    299|        {"health",      t_uinteger, STRUCTOBJECT(struct consat_t, health)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  110|    299|        {"snr",         t_integer,  STRUCTOBJECT(struct consat_t, snr)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  111|    299|        {"health_en",   t_boolean,  STRUCTOBJECT(struct consat_t, health_en)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  112|    299|        {"new_data",    t_boolean,  STRUCTOBJECT(struct consat_t, new_data)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  113|    299|        {"los_warning", t_boolean,  STRUCTOBJECT(struct consat_t, los_warning)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  114|    299|        {"tou",         t_uinteger, STRUCTOBJECT(struct consat_t, tou)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  115|    299|        {NULL},
  116|    299|    };
  117|    299|    const struct json_attr_t json_rtcm5[] = {
  118|    299|        RTCM2_HEADER
  ------------------
  |  |   41|    299|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   42|    299|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   43|    299|        {"device",         t_string,   .addr.string = path, \
  |  |   44|    299|                                          .len = pathlen}, \
  |  |   45|    299|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   46|    299|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   47|    299|                                          .dflt.real = NAN}, \
  |  |   48|    299|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   49|    299|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   50|    299|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  119|    299|        {"satellites", t_array, STRUCTARRAY(rtcm2->conhealth.sat,
  ------------------
  |  |  190|    299|        .addr.array.element_type = t_structobject, \
  |  |  191|    299|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    299|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    299|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    299|        .addr.array.count = n, \
  |  |  195|    299|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1173|    299|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    299|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    299|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    299|            struct { \
  |  |  |  |  |  |   71|    299|                int unused_int; \
  |  |  |  |  |  |   72|    299|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    299|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    299|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    299|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    299|            }; \
  |  |  |  |  |  |   77|    299|            1; \
  |  |  |  |  |  |   78|    299|        })) \
  |  |  |  |  |  |   79|    299|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  120|    299|                                            rtcm5_satellite, &satcount)},
  121|    299|        {NULL},
  122|    299|    };
  123|       |
  124|    299|    const struct json_attr_t json_rtcm6[] = {
  125|    299|        RTCM2_HEADER
  ------------------
  |  |   41|    299|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   42|    299|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   43|    299|        {"device",         t_string,   .addr.string = path, \
  |  |   44|    299|                                          .len = pathlen}, \
  |  |   45|    299|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   46|    299|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   47|    299|                                          .dflt.real = NAN}, \
  |  |   48|    299|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   49|    299|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   50|    299|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  126|       |        // No-op or keepalive message
  127|    299|        {NULL},
  128|    299|    };
  129|       |
  130|    299|    const struct json_attr_t rtcm7_satellite[] = {
  131|    299|        {"lat",         t_real,     STRUCTOBJECT(struct station_t, latitude)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  132|    299|        {"lon",         t_real,     STRUCTOBJECT(struct station_t, longitude)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  133|    299|        {"range",       t_uinteger, STRUCTOBJECT(struct station_t, range)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  134|    299|        {"frequency",   t_real,     STRUCTOBJECT(struct station_t, frequency)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  135|    299|        {"health",      t_uinteger, STRUCTOBJECT(struct station_t, health)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  136|    299|        {"station_id",  t_uinteger, STRUCTOBJECT(struct station_t, station_id)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  137|    299|        {"bitrate",     t_uinteger, STRUCTOBJECT(struct station_t, bitrate)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  138|    299|        {NULL},
  139|    299|    };
  140|    299|    const struct json_attr_t json_rtcm7[] = {
  141|    299|        RTCM2_HEADER
  ------------------
  |  |   41|    299|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   42|    299|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   43|    299|        {"device",         t_string,   .addr.string = path, \
  |  |   44|    299|                                          .len = pathlen}, \
  |  |   45|    299|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   46|    299|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   47|    299|                                          .dflt.real = NAN}, \
  |  |   48|    299|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   49|    299|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   50|    299|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  142|    299|        {"satellites", t_array, STRUCTARRAY(rtcm2->almanac.station,
  ------------------
  |  |  190|    299|        .addr.array.element_type = t_structobject, \
  |  |  191|    299|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    299|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    299|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    299|        .addr.array.count = n, \
  |  |  195|    299|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1173|    299|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    299|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    299|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    299|            struct { \
  |  |  |  |  |  |   71|    299|                int unused_int; \
  |  |  |  |  |  |   72|    299|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    299|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    299|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    299|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    299|            }; \
  |  |  |  |  |  |   77|    299|            1; \
  |  |  |  |  |  |   78|    299|        })) \
  |  |  |  |  |  |   79|    299|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  143|    299|                                            rtcm7_satellite, &satcount)},
  144|    299|        {NULL},
  145|    299|    };
  146|       |
  147|    299|    const struct json_attr_t json_rtcm13[] = {
  148|    299|        RTCM2_HEADER
  ------------------
  |  |   41|    299|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   42|    299|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   43|    299|        {"device",         t_string,   .addr.string = path, \
  |  |   44|    299|                                          .len = pathlen}, \
  |  |   45|    299|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   46|    299|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   47|    299|                                          .dflt.real = NAN}, \
  |  |   48|    299|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   49|    299|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   50|    299|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  149|    299|        {"status",       t_boolean,  .addr.boolean = &rtcm2->xmitter.status},
  150|    299|        {"rangeflag",    t_boolean,  .addr.boolean = &rtcm2->xmitter.rangeflag},
  151|    299|        {"lat",          t_real,     .addr.real = &rtcm2->xmitter.lat,
  152|    299|                                        .dflt.real = NAN},
  153|    299|        {"lon",          t_real,     .addr.real = &rtcm2->xmitter.lon,
  154|    299|                                        .dflt.real = NAN},
  155|    299|        {"range",        t_uinteger, .addr.uinteger = &rtcm2->xmitter.range},
  156|    299|        {NULL},
  157|    299|    };
  158|       |
  159|    299|    const struct json_attr_t json_rtcm14[] = {
  160|    299|        RTCM2_HEADER
  ------------------
  |  |   41|    299|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   42|    299|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   43|    299|        {"device",         t_string,   .addr.string = path, \
  |  |   44|    299|                                          .len = pathlen}, \
  |  |   45|    299|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   46|    299|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   47|    299|                                          .dflt.real = NAN}, \
  |  |   48|    299|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   49|    299|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   50|    299|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  161|    299|        {"week",              t_uinteger,
  162|    299|                              .addr.uinteger = &rtcm2->gpstime.week},
  163|    299|        {"hour",              t_uinteger,
  164|    299|                              .addr.uinteger = &rtcm2->gpstime.hour},
  165|    299|        {"leapsecs",          t_uinteger,
  166|    299|                              .addr.uinteger = &rtcm2->gpstime.leapsecs},
  167|    299|        {NULL},
  168|    299|    };
  169|       |
  170|    299|    const struct json_attr_t json_rtcm16[] = {
  171|    299|        RTCM2_HEADER
  ------------------
  |  |   41|    299|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   42|    299|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   43|    299|        {"device",         t_string,   .addr.string = path, \
  |  |   44|    299|                                          .len = pathlen}, \
  |  |   45|    299|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   46|    299|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   47|    299|                                          .dflt.real = NAN}, \
  |  |   48|    299|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   49|    299|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   50|    299|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  172|    299|        {"message",        t_string,  .addr.string = rtcm2->message,
  173|    299|                                         .len = sizeof(rtcm2->message)},
  174|    299|        {NULL},
  175|    299|    };
  176|       |
  177|    299|    const struct json_attr_t rtcm31_satellite[] = {
  178|    299|        {"ident",     t_uinteger,
  179|    299|                              STRUCTOBJECT(struct glonass_rangesat_t, ident)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  180|    299|        {"udre",      t_uinteger,
  181|    299|                              STRUCTOBJECT(struct glonass_rangesat_t, udre)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  182|    299|        {"change",    t_boolean,
  183|    299|                              STRUCTOBJECT(struct glonass_rangesat_t, change)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  184|    299|        {"tod",       t_uinteger, STRUCTOBJECT(struct glonass_rangesat_t, tod)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  185|    299|        {"prc",       t_real,     STRUCTOBJECT(struct glonass_rangesat_t, prc)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  186|    299|        {"rrc",       t_real,     STRUCTOBJECT(struct glonass_rangesat_t, rrc)},
  ------------------
  |  |  188|    299|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  187|    299|        {NULL},
  188|    299|    };
  189|    299|    const struct json_attr_t json_rtcm31[] = {
  190|    299|        RTCM2_HEADER
  ------------------
  |  |   41|    299|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   42|    299|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   43|    299|        {"device",         t_string,   .addr.string = path, \
  |  |   44|    299|                                          .len = pathlen}, \
  |  |   45|    299|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   46|    299|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   47|    299|                                          .dflt.real = NAN}, \
  |  |   48|    299|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   49|    299|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   50|    299|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  191|    299|        {"satellites", t_array, STRUCTARRAY(rtcm2->glonass_ranges.sat,
  ------------------
  |  |  190|    299|        .addr.array.element_type = t_structobject, \
  |  |  191|    299|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    299|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    299|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    299|        .addr.array.count = n, \
  |  |  195|    299|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1173|    299|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    299|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    299|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    299|            struct { \
  |  |  |  |  |  |   71|    299|                int unused_int; \
  |  |  |  |  |  |   72|    299|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    299|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    299|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    299|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    299|            }; \
  |  |  |  |  |  |   77|    299|            1; \
  |  |  |  |  |  |   78|    299|        })) \
  |  |  |  |  |  |   79|    299|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|    299|                                            rtcm31_satellite, &satcount)},
  193|    299|        {NULL},
  194|    299|    };
  195|       |
  196|    299|    const struct json_attr_t json_rtcm2_fallback[] = {
  197|    299|        RTCM2_HEADER
  ------------------
  |  |   41|    299|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   42|    299|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   43|    299|        {"device",         t_string,   .addr.string = path, \
  |  |   44|    299|                                          .len = pathlen}, \
  |  |   45|    299|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   46|    299|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   47|    299|                                          .dflt.real = NAN}, \
  |  |   48|    299|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   49|    299|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   50|    299|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  198|    299|        {"data",         t_array, .addr.array.element_type = t_string,
  199|    299|                         .addr.array.arr.strings.ptrs = stringptrs,
  200|    299|                         .addr.array.arr.strings.store = stringstore,
  201|    299|                         .addr.array.arr.strings.storelen = sizeof(stringstore),
  202|    299|                         .addr.array.count = &stringcount,
  203|    299|                         .addr.array.maxlen = NITEMS(stringptrs)},
  ------------------
  |  | 1173|    299|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  ------------------
  |  |  |  |   68|    299|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |   69|    299|        0 * (int) sizeof(({ \
  |  |  |  |   70|    299|            struct { \
  |  |  |  |   71|    299|                int unused_int; \
  |  |  |  |   72|    299|                __typeof__(arr) unused_arr; \
  |  |  |  |   73|    299|            } zero_init = {0}; \
  |  |  |  |   74|    299|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |   75|    299|                zero_init.unused_arr[0], \
  |  |  |  |   76|    299|            }; \
  |  |  |  |   77|    299|            1; \
  |  |  |  |   78|    299|        })) \
  |  |  |  |   79|    299|    )
  |  |  ------------------
  ------------------
  204|    299|        {NULL},
  205|    299|    };
  206|       |
  207|    299|#undef RTCM2_HEADER
  208|       |/* *INDENT-ON* */
  209|       |
  210|    299|    memset(rtcm2, '\0', sizeof(struct rtcm2_t));
  211|       |
  212|    299|    if (strstr(buf, "\"type\":1,") != NULL
  ------------------
  |  Branch (212:9): [True: 6, False: 293]
  ------------------
  213|    299|        || strstr(buf, "\"type\":9,") != NULL) {
  ------------------
  |  Branch (213:12): [True: 1, False: 292]
  ------------------
  214|      7|        status = json_read_object(buf, json_rtcm1, endptr);
  215|      7|        if (status == 0)
  ------------------
  |  Branch (215:13): [True: 1, False: 6]
  ------------------
  216|      1|            rtcm2->gps_ranges.nentries = (unsigned)satcount;
  217|    292|    } else if (strstr(buf, "\"type\":3,") != NULL) {
  ------------------
  |  Branch (217:16): [True: 70, False: 222]
  ------------------
  218|     70|        status = json_read_object(buf, json_rtcm3, endptr);
  219|     70|        if (status == 0) {
  ------------------
  |  Branch (219:13): [True: 67, False: 3]
  ------------------
  220|     67|            rtcm2->ref_sta.valid = (isfinite(rtcm2->ref_sta.x) != 0)
  ------------------
  |  Branch (220:36): [True: 35, False: 32]
  ------------------
  221|     67|                && (isfinite(rtcm2->ref_sta.y) != 0)
  ------------------
  |  Branch (221:20): [True: 26, False: 9]
  ------------------
  222|     67|                && (isfinite(rtcm2->ref_sta.z) != 0);
  ------------------
  |  Branch (222:20): [True: 8, False: 18]
  ------------------
  223|     67|        }
  224|    222|    } else if (strstr(buf, "\"type\":4,") != NULL) {
  ------------------
  |  Branch (224:16): [True: 87, False: 135]
  ------------------
  225|     87|        status = json_read_object(buf, json_rtcm4, endptr);
  226|     87|        if (status == 0)
  ------------------
  |  Branch (226:13): [True: 3, False: 84]
  ------------------
  227|      3|            rtcm2->reference.valid = (isfinite(rtcm2->reference.dx) != 0)
  ------------------
  |  Branch (227:38): [True: 2, False: 1]
  ------------------
  228|      3|                && (isfinite(rtcm2->reference.dy) != 0)
  ------------------
  |  Branch (228:20): [True: 1, False: 1]
  ------------------
  229|      3|                && (isfinite(rtcm2->reference.dz) != 0);
  ------------------
  |  Branch (229:20): [True: 0, False: 1]
  ------------------
  230|    135|    } else if (strstr(buf, "\"type\":5,") != NULL) {
  ------------------
  |  Branch (230:16): [True: 6, False: 129]
  ------------------
  231|      6|        status = json_read_object(buf, json_rtcm5, endptr);
  232|      6|        if (status == 0)
  ------------------
  |  Branch (232:13): [True: 1, False: 5]
  ------------------
  233|      1|            rtcm2->conhealth.nentries = (unsigned)satcount;
  234|    129|    } else if (strstr(buf, "\"type\":6,") != NULL) {
  ------------------
  |  Branch (234:16): [True: 1, False: 128]
  ------------------
  235|      1|        status = json_read_object(buf, json_rtcm6, endptr);
  236|    128|    } else if (strstr(buf, "\"type\":7,") != NULL) {
  ------------------
  |  Branch (236:16): [True: 5, False: 123]
  ------------------
  237|      5|        status = json_read_object(buf, json_rtcm7, endptr);
  238|      5|        if (status == 0)
  ------------------
  |  Branch (238:13): [True: 1, False: 4]
  ------------------
  239|      1|            rtcm2->almanac.nentries = (unsigned)satcount;
  240|    123|    } else if (strstr(buf, "\"type\":13,") != NULL) {
  ------------------
  |  Branch (240:16): [True: 1, False: 122]
  ------------------
  241|      1|        status = json_read_object(buf, json_rtcm13, endptr);
  242|    122|    } else if (strstr(buf, "\"type\":14,") != NULL) {
  ------------------
  |  Branch (242:16): [True: 1, False: 121]
  ------------------
  243|      1|        status = json_read_object(buf, json_rtcm14, endptr);
  244|    121|    } else if (strstr(buf, "\"type\":16,") != NULL) {
  ------------------
  |  Branch (244:16): [True: 1, False: 120]
  ------------------
  245|      1|        status = json_read_object(buf, json_rtcm16, endptr);
  246|    120|    } else if (strstr(buf, "\"type\":31,") != NULL) {
  ------------------
  |  Branch (246:16): [True: 4, False: 116]
  ------------------
  247|      4|        status = json_read_object(buf, json_rtcm31, endptr);
  248|      4|        if (status == 0)
  ------------------
  |  Branch (248:13): [True: 1, False: 3]
  ------------------
  249|      1|            rtcm2->glonass_ranges.nentries = (unsigned)satcount;
  250|    116|    } else {
  251|    116|        int n;
  252|    116|        status = json_read_object(buf, json_rtcm2_fallback, endptr);
  253|  2.70k|        for (n = 0; n < NITEMS(rtcm2->words); n++) {
  ------------------
  |  | 1173|  2.70k|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  ------------------
  |  |  |  |   68|  2.70k|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |   69|  2.70k|        0 * (int) sizeof(({ \
  |  |  |  |   70|  2.70k|            struct { \
  |  |  |  |   71|  2.70k|                int unused_int; \
  |  |  |  |   72|  2.70k|                __typeof__(arr) unused_arr; \
  |  |  |  |   73|  2.70k|            } zero_init = {0}; \
  |  |  |  |   74|  2.70k|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |   75|  2.70k|                zero_init.unused_arr[0], \
  |  |  |  |   76|  2.70k|            }; \
  |  |  |  |   77|  2.70k|            1; \
  |  |  |  |   78|  2.70k|        })) \
  |  |  |  |   79|  2.70k|    )
  |  |  ------------------
  ------------------
  |  Branch (253:21): [True: 2.62k, False: 83]
  ------------------
  254|  2.62k|            if (n >= stringcount) {
  ------------------
  |  Branch (254:17): [True: 2.41k, False: 207]
  ------------------
  255|  2.41k|                rtcm2->words[n] = 0;
  256|  2.41k|            } else {
  257|    207|                unsigned int u;
  258|    207|                int fldcount = sscanf(stringptrs[n], "0x%08x\n", &u);
  259|    207|                if (fldcount != 1)
  ------------------
  |  Branch (259:21): [True: 33, False: 174]
  ------------------
  260|     33|                    return JSON_ERR_MISC;
  ------------------
  |  |  172|     33|#define JSON_ERR_MISC          21      // other data conversion error
  ------------------
  261|    174|                else
  262|    174|                    rtcm2->words[n] = (isgps30bits_t) u;
  263|    207|            }
  264|  2.62k|        }
  265|    116|    }
  266|    266|    return status;
  267|    299|}

json_rtcm3_read:
   31|    145|{
   32|    145|    static char *stringptrs[NITEMS(rtcm3->rtcmtypes.data)];
   33|    145|    static char stringstore[sizeof(rtcm3->rtcmtypes.data) * 2];
   34|    145|    static int stringcount;
   35|       |
   36|       |/* *INDENT-OFF* */
   37|    145|#define RTCM3_HEADER \
   38|    145|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
   39|    145|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
   40|    145|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
   41|    145|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
   42|       |
   43|    145|    int status = 0, satcount = 0;
   44|       |
   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
   46|    145|    const struct json_attr_t rtcm1001_satellite[] = {
   47|    145|        {"ident",     t_uinteger, RTCM3FIELD(1001, ident)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   48|    145|        {"ind",       t_uinteger, RTCM3FIELD(1001, L1.indicator)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   49|    145|        {"prange",    t_real,     RTCM3FIELD(1001, L1.pseudorange)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   50|    145|        {"delta",     t_real,     RTCM3FIELD(1001, L1.rangediff)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   51|    145|        {"lockt",     t_uinteger, RTCM3FIELD(1001, L1.locktime)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   52|    145|        {NULL},
   53|    145|    };
   54|       |
   55|    145|    const struct json_attr_t rtcm1002_satellite[] = {
   56|    145|        {"ident",     t_uinteger, RTCM3FIELD(1002, ident)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   57|    145|        {"ind",       t_uinteger, RTCM3FIELD(1002, L1.indicator)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   58|    145|        {"prange",    t_real,     RTCM3FIELD(1002, L1.pseudorange)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   59|    145|        {"delta",     t_real,     RTCM3FIELD(1002, L1.rangediff)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   60|    145|        {"lockt",     t_uinteger, RTCM3FIELD(1002, L1.locktime)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   61|    145|        {"amb",       t_uinteger, RTCM3FIELD(1002, L1.ambiguity)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   62|    145|        {"CNR",       t_real,     RTCM3FIELD(1002, L1.CNR)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   63|    145|        {NULL},
   64|    145|    };
   65|       |
   66|    145|    const struct json_attr_t rtcm1009_satellite[] = {
   67|    145|        {"ident",     t_uinteger, RTCM3FIELD(1009, ident)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   68|    145|        {"ind",       t_uinteger, RTCM3FIELD(1009, L1.indicator)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   69|    145|        {"channel",   t_uinteger, RTCM3FIELD(1009, L1.channel)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   70|    145|        {"prange",    t_real,     RTCM3FIELD(1009, L1.pseudorange)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   71|    145|        {"delta",     t_real,     RTCM3FIELD(1009, L1.rangediff)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   72|    145|        {"lockt",     t_uinteger, RTCM3FIELD(1009, L1.locktime)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   73|    145|        {NULL},
   74|    145|    };
   75|       |
   76|    145|    const struct json_attr_t rtcm1010_satellite[] = {
   77|    145|        {"ident",     t_uinteger, RTCM3FIELD(1010, ident)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   78|    145|        {"ind",       t_uinteger, RTCM3FIELD(1010, L1.indicator)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   79|    145|        {"channel",   t_uinteger, RTCM3FIELD(1010, L1.channel)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   80|    145|        {"prange",    t_real,     RTCM3FIELD(1010, L1.pseudorange)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   81|    145|        {"delta",     t_real,     RTCM3FIELD(1010, L1.rangediff)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   82|    145|        {"lockt",     t_uinteger, RTCM3FIELD(1010, L1.locktime)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   83|    145|        {"amb",       t_uinteger, RTCM3FIELD(1010, L1.ambiguity)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   84|    145|        {"CNR",       t_real,     RTCM3FIELD(1010, L1.CNR)},
  ------------------
  |  |   45|    145|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    145|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   85|    145|        {NULL},
   86|    145|    };
   87|    145|#undef RTCM3FIELD
   88|       |
   89|    145|#define R1001   &rtcm3->rtcmtypes.rtcm3_1001.header
   90|    145|    const struct json_attr_t json_rtcm1001[] = {
   91|    145|        RTCM3_HEADER
  ------------------
  |  |   38|    145|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   39|    145|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   40|    145|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   41|    145|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
   92|    145|        {"station_id", t_uinteger, .addr.uinteger = R1001.station_id},
  ------------------
  |  |   89|    145|#define R1001   &rtcm3->rtcmtypes.rtcm3_1001.header
  ------------------
   93|    145|        {"tow",        t_uinteger, .addr.uinteger = (unsigned int *)R1001.tow},
  ------------------
  |  |   89|    145|#define R1001   &rtcm3->rtcmtypes.rtcm3_1001.header
  ------------------
   94|    145|        {"sync",       t_boolean,  .addr.boolean = R1001.sync},
  ------------------
  |  |   89|    145|#define R1001   &rtcm3->rtcmtypes.rtcm3_1001.header
  ------------------
   95|    145|        {"smoothing",  t_boolean,  .addr.boolean = R1001.smoothing},
  ------------------
  |  |   89|    145|#define R1001   &rtcm3->rtcmtypes.rtcm3_1001.header
  ------------------
   96|    145|        {"interval",   t_uinteger, .addr.uinteger = R1001.interval},
  ------------------
  |  |   89|    145|#define R1001   &rtcm3->rtcmtypes.rtcm3_1001.header
  ------------------
   97|    145|        {"satellites", t_array,
   98|    145|         STRUCTARRAY(rtcm3->rtcmtypes.rtcm3_1001.rtk_data,
  ------------------
  |  |  190|    145|        .addr.array.element_type = t_structobject, \
  |  |  191|    145|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    145|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    145|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    145|        .addr.array.count = n, \
  |  |  195|    145|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1173|    145|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    145|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    145|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    145|            struct { \
  |  |  |  |  |  |   71|    145|                int unused_int; \
  |  |  |  |  |  |   72|    145|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    145|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    145|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    145|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    145|            }; \
  |  |  |  |  |  |   77|    145|            1; \
  |  |  |  |  |  |   78|    145|        })) \
  |  |  |  |  |  |   79|    145|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   99|    145|         rtcm1001_satellite, &satcount)},
  100|    145|        {NULL},
  101|    145|    };
  102|    145|#undef R1001
  103|       |
  104|    145|#define R1002   &rtcm3->rtcmtypes.rtcm3_1002.header
  105|    145|    const struct json_attr_t json_rtcm1002[] = {
  106|    145|        RTCM3_HEADER
  ------------------
  |  |   38|    145|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   39|    145|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   40|    145|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   41|    145|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  107|    145|        {"station_id", t_uinteger, .addr.uinteger = R1002.station_id},
  ------------------
  |  |  104|    145|#define R1002   &rtcm3->rtcmtypes.rtcm3_1002.header
  ------------------
  108|    145|        {"tow",        t_uinteger, .addr.uinteger = (unsigned int *)R1002.tow},
  ------------------
  |  |  104|    145|#define R1002   &rtcm3->rtcmtypes.rtcm3_1002.header
  ------------------
  109|    145|        {"sync",       t_boolean,  .addr.boolean = R1002.sync},
  ------------------
  |  |  104|    145|#define R1002   &rtcm3->rtcmtypes.rtcm3_1002.header
  ------------------
  110|    145|        {"smoothing",  t_boolean,  .addr.boolean = R1002.smoothing},
  ------------------
  |  |  104|    145|#define R1002   &rtcm3->rtcmtypes.rtcm3_1002.header
  ------------------
  111|    145|        {"interval",   t_uinteger, .addr.uinteger = R1002.interval},
  ------------------
  |  |  104|    145|#define R1002   &rtcm3->rtcmtypes.rtcm3_1002.header
  ------------------
  112|    145|        {"satellites", t_array,
  113|    145|         STRUCTARRAY(rtcm3->rtcmtypes.rtcm3_1002.rtk_data,
  ------------------
  |  |  190|    145|        .addr.array.element_type = t_structobject, \
  |  |  191|    145|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    145|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    145|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    145|        .addr.array.count = n, \
  |  |  195|    145|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1173|    145|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    145|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    145|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    145|            struct { \
  |  |  |  |  |  |   71|    145|                int unused_int; \
  |  |  |  |  |  |   72|    145|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    145|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    145|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    145|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    145|            }; \
  |  |  |  |  |  |   77|    145|            1; \
  |  |  |  |  |  |   78|    145|        })) \
  |  |  |  |  |  |   79|    145|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|    145|         rtcm1002_satellite, &satcount)},
  115|    145|        {NULL},
  116|    145|    };
  117|    145|#undef R1002
  118|       |
  119|    145|#define R1007   rtcm3->rtcmtypes.rtcm3_1007
  120|    145|    const struct json_attr_t json_rtcm1007[] = {
  121|    145|        RTCM3_HEADER
  ------------------
  |  |   38|    145|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   39|    145|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   40|    145|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   41|    145|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  122|    145|        {"station_id", t_uinteger, .addr.uinteger = &R1007.station_id},
  ------------------
  |  |  119|    145|#define R1007   rtcm3->rtcmtypes.rtcm3_1007
  ------------------
  123|    145|        {"desc",       t_string,   .addr.string = R1007.descriptor,
  ------------------
  |  |  119|    145|#define R1007   rtcm3->rtcmtypes.rtcm3_1007
  ------------------
  124|    145|                                         .len = sizeof(R1007.descriptor)},
  ------------------
  |  |  119|    145|#define R1007   rtcm3->rtcmtypes.rtcm3_1007
  ------------------
  125|    145|        {"setup_id",   t_uinteger, .addr.uinteger = &R1007.setup_id},
  ------------------
  |  |  119|    145|#define R1007   rtcm3->rtcmtypes.rtcm3_1007
  ------------------
  126|    145|        {NULL},
  127|    145|    };
  128|    145|#undef R1002
  129|       |
  130|    145|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  131|    145|    const struct json_attr_t json_rtcm1008[] = {
  132|    145|        RTCM3_HEADER
  ------------------
  |  |   38|    145|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   39|    145|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   40|    145|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   41|    145|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  133|    145|        {"station_id", t_uinteger, .addr.uinteger = &R1008.station_id},
  ------------------
  |  |  130|    145|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  ------------------
  134|    145|        {"desc",       t_string,   .addr.string = R1008.descriptor,
  ------------------
  |  |  130|    145|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  ------------------
  135|    145|                                         .len = sizeof(R1008.descriptor)},
  ------------------
  |  |  130|    145|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  ------------------
  136|    145|        {"setup_id",   t_uinteger, .addr.uinteger = &R1008.setup_id},
  ------------------
  |  |  130|    145|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  ------------------
  137|    145|        {"serial",     t_string,   .addr.string = R1008.serial,
  ------------------
  |  |  130|    145|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  ------------------
  138|    145|                                         .len = sizeof(R1008.serial)},
  ------------------
  |  |  130|    145|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  ------------------
  139|    145|        {NULL},
  140|    145|    };
  141|    145|#undef R1008
  142|       |
  143|    145|#define R1009   &rtcm3->rtcmtypes.rtcm3_1009.header
  144|    145|    const struct json_attr_t json_rtcm1009[] = {
  145|    145|        RTCM3_HEADER
  ------------------
  |  |   38|    145|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   39|    145|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   40|    145|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   41|    145|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  146|    145|        {"station_id", t_uinteger, .addr.uinteger = R1009.station_id},
  ------------------
  |  |  143|    145|#define R1009   &rtcm3->rtcmtypes.rtcm3_1009.header
  ------------------
  147|    145|        {"tow",        t_uinteger, .addr.uinteger = (unsigned int *)R1009.tow},
  ------------------
  |  |  143|    145|#define R1009   &rtcm3->rtcmtypes.rtcm3_1009.header
  ------------------
  148|    145|        {"sync",       t_boolean,  .addr.boolean = R1009.sync},
  ------------------
  |  |  143|    145|#define R1009   &rtcm3->rtcmtypes.rtcm3_1009.header
  ------------------
  149|    145|        {"smoothing",  t_boolean,  .addr.boolean = R1009.smoothing},
  ------------------
  |  |  143|    145|#define R1009   &rtcm3->rtcmtypes.rtcm3_1009.header
  ------------------
  150|    145|        {"interval",   t_uinteger, .addr.uinteger = R1009.interval},
  ------------------
  |  |  143|    145|#define R1009   &rtcm3->rtcmtypes.rtcm3_1009.header
  ------------------
  151|    145|        {"satellites", t_array,
  152|    145|         STRUCTARRAY(rtcm3->rtcmtypes.rtcm3_1009.rtk_data,
  ------------------
  |  |  190|    145|        .addr.array.element_type = t_structobject, \
  |  |  191|    145|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    145|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    145|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    145|        .addr.array.count = n, \
  |  |  195|    145|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1173|    145|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    145|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    145|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    145|            struct { \
  |  |  |  |  |  |   71|    145|                int unused_int; \
  |  |  |  |  |  |   72|    145|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    145|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    145|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    145|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    145|            }; \
  |  |  |  |  |  |   77|    145|            1; \
  |  |  |  |  |  |   78|    145|        })) \
  |  |  |  |  |  |   79|    145|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|    145|         rtcm1009_satellite, &satcount)},
  154|    145|        {NULL},
  155|    145|    };
  156|    145|#undef R1010
  157|       |
  158|    145|#define R1010   &rtcm3->rtcmtypes.rtcm3_1010.header
  159|    145|    const struct json_attr_t json_rtcm1010[] = {
  160|    145|        RTCM3_HEADER
  ------------------
  |  |   38|    145|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   39|    145|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   40|    145|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   41|    145|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  161|    145|        {"station_id", t_uinteger, .addr.uinteger = R1010.station_id},
  ------------------
  |  |  158|    145|#define R1010   &rtcm3->rtcmtypes.rtcm3_1010.header
  ------------------
  162|    145|        {"tow",        t_uinteger, .addr.uinteger = (unsigned int *)R1010.tow},
  ------------------
  |  |  158|    145|#define R1010   &rtcm3->rtcmtypes.rtcm3_1010.header
  ------------------
  163|    145|        {"sync",       t_boolean,  .addr.boolean = R1010.sync},
  ------------------
  |  |  158|    145|#define R1010   &rtcm3->rtcmtypes.rtcm3_1010.header
  ------------------
  164|    145|        {"smoothing",  t_boolean,  .addr.boolean = R1010.smoothing},
  ------------------
  |  |  158|    145|#define R1010   &rtcm3->rtcmtypes.rtcm3_1010.header
  ------------------
  165|    145|        {"interval",   t_uinteger, .addr.uinteger = R1010.interval},
  ------------------
  |  |  158|    145|#define R1010   &rtcm3->rtcmtypes.rtcm3_1010.header
  ------------------
  166|    145|        {"satellites", t_array,
  167|    145|         STRUCTARRAY(rtcm3->rtcmtypes.rtcm3_1010.rtk_data,
  ------------------
  |  |  190|    145|        .addr.array.element_type = t_structobject, \
  |  |  191|    145|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    145|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    145|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    145|        .addr.array.count = n, \
  |  |  195|    145|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1173|    145|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    145|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    145|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    145|            struct { \
  |  |  |  |  |  |   71|    145|                int unused_int; \
  |  |  |  |  |  |   72|    145|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    145|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    145|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    145|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    145|            }; \
  |  |  |  |  |  |   77|    145|            1; \
  |  |  |  |  |  |   78|    145|        })) \
  |  |  |  |  |  |   79|    145|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|    145|         rtcm1010_satellite, &satcount)},
  169|    145|        {NULL},
  170|    145|    };
  171|    145|#undef R1010
  172|       |
  173|    145|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  174|    145|    const struct json_attr_t json_rtcm1014[] = {
  175|    145|        RTCM3_HEADER
  ------------------
  |  |   38|    145|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   39|    145|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   40|    145|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   41|    145|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  176|    145|        {"netid",      t_uinteger, .addr.uinteger = R1014.network_id},
  ------------------
  |  |  173|    145|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  177|    145|        {"subnetid",   t_uinteger, .addr.uinteger = R1014.subnetwork_id},
  ------------------
  |  |  173|    145|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  178|    145|        {"statcount",  t_uinteger, .addr.uinteger = R1014.stationcount},
  ------------------
  |  |  173|    145|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  179|    145|        {"master",     t_uinteger, .addr.uinteger = R1014.master_id},
  ------------------
  |  |  173|    145|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  180|    145|        {"aux",        t_uinteger, .addr.uinteger = R1014.aux_id},
  ------------------
  |  |  173|    145|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  181|    145|        {"lat",        t_real,     .addr.real = R1014.d_lat},
  ------------------
  |  |  173|    145|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  182|    145|        {"lon",        t_real,     .addr.real = R1014.d_lon},
  ------------------
  |  |  173|    145|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  183|    145|        {"alt",        t_real,     .addr.real = R1014.d_alt},
  ------------------
  |  |  173|    145|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  184|    145|        {NULL},
  185|    145|    };
  186|    145|#undef R1014
  187|       |
  188|    145|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  189|    145|    const struct json_attr_t json_rtcm1033[] = {
  190|    145|        RTCM3_HEADER
  ------------------
  |  |   38|    145|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   39|    145|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   40|    145|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   41|    145|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  191|    145|        {"station_id", t_uinteger, .addr.uinteger = &R1033.station_id},
  ------------------
  |  |  188|    145|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  192|    145|        {"desc",       t_string,   .addr.string = R1033.descriptor,
  ------------------
  |  |  188|    145|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  193|    145|                                         .len = sizeof(R1033.descriptor)},
  ------------------
  |  |  188|    145|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  194|    145|        {"setup_id",   t_uinteger, .addr.uinteger = &R1033.setup_id},
  ------------------
  |  |  188|    145|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  195|    145|        {"serial",     t_string,   .addr.string = R1033.serial,
  ------------------
  |  |  188|    145|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  196|    145|                                         .len = sizeof(R1033.serial)},
  ------------------
  |  |  188|    145|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  197|    145|        {"receiver",   t_string,   .addr.string = R1033.receiver,
  ------------------
  |  |  188|    145|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  198|    145|                                         .len = sizeof(R1033.receiver)},
  ------------------
  |  |  188|    145|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  199|    145|        {"firmware",   t_string,   .addr.string = R1033.firmware,
  ------------------
  |  |  188|    145|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  200|    145|                                         .len = sizeof(R1033.firmware)},
  ------------------
  |  |  188|    145|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  201|    145|        {NULL},
  202|    145|    };
  203|    145|#undef R1033
  204|       |
  205|    145|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  206|    145|    const struct json_attr_t json_rtcm1230[] = {
  207|    145|        RTCM3_HEADER
  ------------------
  |  |   38|    145|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   39|    145|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   40|    145|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   41|    145|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  208|    145|        {"station_id", t_uinteger, .addr.uinteger = &R1230.station_id},
  ------------------
  |  |  205|    145|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  209|    145|        {"bi",         t_ubyte,    .addr.ubyte = &R1230.bias_indicator},
  ------------------
  |  |  205|    145|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  210|    145|        {"sm",         t_ubyte,    .addr.ubyte = &R1230.signals_mask},
  ------------------
  |  |  205|    145|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  211|    145|        {"l1ca",       t_integer,  .addr.integer = &R1230.l1_ca_bias,
  ------------------
  |  |  205|    145|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  212|    145|                                   .dflt.integer = 0},
  213|    145|        {"l1p",        t_integer,  .addr.integer = &R1230.l1_p_bias,
  ------------------
  |  |  205|    145|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  214|    145|                                   .dflt.integer = 0},
  215|    145|        {"l2ca",       t_integer,  .addr.integer = &R1230.l2_ca_bias,
  ------------------
  |  |  205|    145|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  216|    145|                                   .dflt.integer = 0},
  217|    145|        {"l2p",        t_integer,  .addr.integer = &R1230.l2_p_bias,
  ------------------
  |  |  205|    145|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  218|    145|                                   .dflt.integer = 0},
  219|    145|        {NULL},
  220|    145|    };
  221|    145|#undef R1033
  222|       |
  223|    145|    const struct json_attr_t json_rtcm3_fallback[] = {
  224|    145|        RTCM3_HEADER
  ------------------
  |  |   38|    145|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   39|    145|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   40|    145|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   41|    145|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  225|    145|        {"data", t_array, .addr.array.element_type = t_string,
  226|    145|                          .addr.array.arr.strings.ptrs = stringptrs,
  227|    145|                          .addr.array.arr.strings.store = stringstore,
  228|    145|                         .addr.array.arr.strings.storelen = sizeof(stringstore),
  229|    145|                          .addr.array.count = &stringcount,
  230|    145|                          .addr.array.maxlen = NITEMS(stringptrs)},
  ------------------
  |  | 1173|    145|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  ------------------
  |  |  |  |   68|    145|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |   69|    145|        0 * (int) sizeof(({ \
  |  |  |  |   70|    145|            struct { \
  |  |  |  |   71|    145|                int unused_int; \
  |  |  |  |   72|    145|                __typeof__(arr) unused_arr; \
  |  |  |  |   73|    145|            } zero_init = {0}; \
  |  |  |  |   74|    145|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |   75|    145|                zero_init.unused_arr[0], \
  |  |  |  |   76|    145|            }; \
  |  |  |  |   77|    145|            1; \
  |  |  |  |   78|    145|        })) \
  |  |  |  |   79|    145|    )
  |  |  ------------------
  ------------------
  231|    145|        {NULL},
  232|    145|    };
  233|       |
  234|    145|#undef RTCM3_HEADER
  235|       |/* *INDENT-ON* */
  236|       |
  237|    145|    memset(rtcm3, '\0', sizeof(struct rtcm3_t));
  238|       |
  239|    145|    if (strstr(buf, "\"type\":1001,") != NULL) {
  ------------------
  |  Branch (239:9): [True: 5, False: 140]
  ------------------
  240|      5|        status = json_read_object(buf, json_rtcm1001, endptr);
  241|      5|        if (status == 0)
  ------------------
  |  Branch (241:13): [True: 1, False: 4]
  ------------------
  242|      1|            rtcm3->rtcmtypes.rtcm3_1001.header.satcount =
  243|      1|                (unsigned short)satcount;
  244|    140|    } else if (strstr(buf, "\"type\":1002,") != NULL) {
  ------------------
  |  Branch (244:16): [True: 6, False: 134]
  ------------------
  245|      6|        status = json_read_object(buf, json_rtcm1002, endptr);
  246|      6|        if (status == 0)
  ------------------
  |  Branch (246:13): [True: 1, False: 5]
  ------------------
  247|      1|            rtcm3->rtcmtypes.rtcm3_1002.header.satcount =
  248|      1|               (unsigned short)satcount;
  249|    134|    } else if (strstr(buf, "\"type\":1007,") != NULL) {
  ------------------
  |  Branch (249:16): [True: 1, False: 133]
  ------------------
  250|      1|        status = json_read_object(buf, json_rtcm1007, endptr);
  251|    133|    } else if (strstr(buf, "\"type\":1008,") != NULL) {
  ------------------
  |  Branch (251:16): [True: 1, False: 132]
  ------------------
  252|      1|        status = json_read_object(buf, json_rtcm1008, endptr);
  253|    132|    } else if (strstr(buf, "\"type\":1009,") != NULL) {
  ------------------
  |  Branch (253:16): [True: 1, False: 131]
  ------------------
  254|      1|        status = json_read_object(buf, json_rtcm1009, endptr);
  255|    131|    } else if (strstr(buf, "\"type\":1010,") != NULL) {
  ------------------
  |  Branch (255:16): [True: 1, False: 130]
  ------------------
  256|      1|        status = json_read_object(buf, json_rtcm1010, endptr);
  257|    130|    } else if (strstr(buf, "\"type\":1014,") != NULL) {
  ------------------
  |  Branch (257:16): [True: 1, False: 129]
  ------------------
  258|      1|        status = json_read_object(buf, json_rtcm1014, endptr);
  259|    129|    } else if (strstr(buf, "\"type\":1033,") != NULL) {
  ------------------
  |  Branch (259:16): [True: 1, False: 128]
  ------------------
  260|      1|        status = json_read_object(buf, json_rtcm1033, endptr);
  261|    128|    } else if (strstr(buf, "\"type\":1230,") != NULL) {
  ------------------
  |  Branch (261:16): [True: 22, False: 106]
  ------------------
  262|     22|        status = json_read_object(buf, json_rtcm1230, endptr);
  263|    106|    } else {
  264|    106|        int n;
  265|    106|        status = json_read_object(buf, json_rtcm3_fallback, endptr);
  266|  67.7k|        for (n = 0; n < NITEMS(rtcm3->rtcmtypes.data); n++) {
  ------------------
  |  | 1173|  67.7k|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  ------------------
  |  |  |  |   68|  67.7k|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |   69|  67.7k|        0 * (int) sizeof(({ \
  |  |  |  |   70|  67.7k|            struct { \
  |  |  |  |   71|  67.7k|                int unused_int; \
  |  |  |  |   72|  67.7k|                __typeof__(arr) unused_arr; \
  |  |  |  |   73|  67.7k|            } zero_init = {0}; \
  |  |  |  |   74|  67.7k|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |   75|  67.7k|                zero_init.unused_arr[0], \
  |  |  |  |   76|  67.7k|            }; \
  |  |  |  |   77|  67.7k|            1; \
  |  |  |  |   78|  67.7k|        })) \
  |  |  |  |   79|  67.7k|    )
  |  |  ------------------
  ------------------
  |  Branch (266:21): [True: 67.6k, False: 66]
  ------------------
  267|  67.6k|            if (n >= stringcount) {
  ------------------
  |  Branch (267:17): [True: 65.7k, False: 1.90k]
  ------------------
  268|  65.7k|                rtcm3->rtcmtypes.data[n] = '\0';
  269|  65.7k|            } else {
  270|  1.90k|                unsigned int u;
  271|  1.90k|                int fldcount = sscanf(stringptrs[n], "0x%02x\n", &u);
  272|  1.90k|                if (fldcount != 1)
  ------------------
  |  Branch (272:21): [True: 40, False: 1.86k]
  ------------------
  273|     40|                    return JSON_ERR_MISC;
  ------------------
  |  |  172|     40|#define JSON_ERR_MISC          21      // other data conversion error
  ------------------
  274|  1.86k|                else
  275|  1.86k|                    rtcm3->rtcmtypes.data[n] = (char)u;
  276|  1.90k|            }
  277|  67.6k|        }
  278|    106|    }
  279|    105|    return status;
  280|    145|}

json_device_read:
   32|     20|{
   33|       |    // initialized to shut up clang
   34|     20|    double d_cycle = 0.0, d_mincycle = 0.0;
   35|       |
   36|       |    // *INDENT-OFF*
   37|     20|    const struct json_attr_t json_attrs_device[] = {
   38|     20|        {"class",      t_check,      .dflt.check = "DEVICE"},
   39|       |
   40|     20|        {"path",       t_string,     .addr.string  = dev->path,
   41|     20|                                        .len = sizeof(dev->path)},
   42|       |        // odd, device->gpsdata.online is sent, but put in dev->activated?
   43|     20|        {"activated",  t_time,       .addr.ts = &dev->activated,
   44|     20|                                        .dflt.ts = {0, 0}},
   45|     20|        {"flags",      t_integer,    .addr.integer = &dev->flags},
   46|     20|        {"driver",     t_string,     .addr.string  = dev->driver,
   47|     20|                                        .len = sizeof(dev->driver)},
   48|     20|        {"sernum",     t_string,     .addr.string  = dev->sernum,
   49|     20|                                        .len = sizeof(dev->sernum)},
   50|     20|        {"subtype",    t_string,     .addr.string  = dev->subtype,
   51|     20|                                        .len = sizeof(dev->subtype)},
   52|     20|        {"subtype1",   t_string,     .addr.string  = dev->subtype1,
   53|     20|                                        .len = sizeof(dev->subtype1)},
   54|     20|        {"hexdata",    t_string,     .addr.string  = dev->hexdata,
   55|     20|                                        .len = sizeof(dev->hexdata)},
   56|     20|        {"native",     t_integer,    .addr.integer = &dev->driver_mode,
   57|     20|                                        .dflt.integer = DEVDEFAULT_NATIVE},
  ------------------
  |  |   56|     20|#define DEVDEFAULT_NATIVE       -1
  ------------------
   58|     20|        {"bps",        t_uinteger,   .addr.uinteger = &dev->baudrate,
   59|     20|                                        .dflt.uinteger = DEVDEFAULT_BPS},
  ------------------
  |  |   53|     20|#define DEVDEFAULT_BPS          0
  ------------------
   60|     20|        {"parity",     t_character,  .addr.character = &dev->parity,
   61|     20|                                        .dflt.character = DEVDEFAULT_PARITY},
  ------------------
  |  |   54|     20|#define DEVDEFAULT_PARITY       'X'
  ------------------
   62|     20|        {"stopbits",   t_uinteger,   .addr.uinteger = &dev->stopbits,
   63|     20|                                        .dflt.uinteger = DEVDEFAULT_STOPBITS},
  ------------------
  |  |   55|     20|#define DEVDEFAULT_STOPBITS     3
  ------------------
   64|     20|        {"cycle",      t_real,       .addr.real = &d_cycle,
   65|     20|                                        .dflt.real = NAN},
   66|     20|        {"mincycle",   t_real,       .addr.real = &d_mincycle,
   67|     20|                                        .dflt.real = NAN},
   68|       |        // ignore unknown keys, for cross-version compatibility
   69|     20|        {"", t_ignore},
   70|     20|        {NULL},
   71|     20|    };
   72|       |    // *INDENT-ON*
   73|     20|    int status;
   74|       |
   75|     20|    status = json_read_object(buf, json_attrs_device, endptr);
   76|     20|    if (0 != status) {
  ------------------
  |  Branch (76:9): [True: 16, False: 4]
  ------------------
   77|     16|        return status;
   78|     16|    }
   79|       |
   80|      4|    if (0 == isfinite(d_cycle)) {
  ------------------
  |  Branch (80:9): [True: 3, False: 1]
  ------------------
   81|      3|        dev->cycle.tv_sec = 0;
   82|      3|        dev->cycle.tv_nsec = 0;
   83|      3|    } else {
   84|      1|        DTOTS(&dev->cycle, d_cycle);
  ------------------
  |  |  144|      1|    do { \
  |  |  145|      1|        double int_part; \
  |  |  146|      1|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|      1|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
   85|      1|    }
   86|      4|    if (0 == isfinite(d_mincycle)) {
  ------------------
  |  Branch (86:9): [True: 3, False: 1]
  ------------------
   87|      3|        dev->mincycle.tv_sec = 0;
   88|      3|        dev->mincycle.tv_nsec = 0;
   89|      3|    } else {
   90|      1|        DTOTS(&dev->mincycle, d_mincycle);
  ------------------
  |  |  144|      1|    do { \
  |  |  145|      1|        double int_part; \
  |  |  146|      1|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|      1|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
   91|      1|    }
   92|       |
   93|      4|    return 0;
   94|     20|}
json_watch_read:
   99|     53|{
  100|       |    // *INDENT-OFF*
  101|     53|    struct json_attr_t chanconfig_attrs[] = {
  102|     53|        {"class",          t_check,    .dflt.check = "WATCH"},
  103|       |
  104|     53|        {"device",         t_string,   .addr.string = ccp->devpath,
  105|     53|                                          .len = sizeof(ccp->devpath)},
  106|     53|        {"enable",         t_boolean,  .addr.boolean = &ccp->watcher,
  107|     53|                                          .dflt.boolean = true},
  108|     53|        {"json",           t_boolean,  .addr.boolean = &ccp->json,
  109|     53|                                          .nodefault = true},
  110|     53|        {"nmea",           t_boolean,  .addr.boolean = &ccp->nmea,
  111|     53|                                          .nodefault = true},
  112|     53|        {"pps",            t_boolean,  .addr.boolean = &ccp->pps},
  113|     53|        {"raw",            t_integer,  .addr.integer = &ccp->raw,
  114|     53|                                          .nodefault = true},
  115|     53|        {"remote",         t_string,   .addr.string = ccp->remote,
  116|     53|                                          .len = sizeof(ccp->remote)},
  117|     53|        {"scaled",         t_boolean,  .addr.boolean = &ccp->scaled},
  118|     53|        {"split24",        t_boolean,  .addr.boolean = &ccp->split24},
  119|     53|        {"timing",         t_boolean,  .addr.boolean = &ccp->timing},
  120|       |        // ignore unknown keys, for cross-version compatibility
  121|     53|        {"", t_ignore},
  122|     53|        {NULL},
  123|     53|    };
  124|       |    // *INDENT-ON*
  125|     53|    int status;
  126|       |
  127|     53|    status = json_read_object(buf, chanconfig_attrs, endptr);
  128|     53|    return status;
  129|     53|}

