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

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

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

safe_atof:
  150|  5.58k|{
  151|  5.58k|    static int maxExponent = 511;   /* Largest possible base 10 exponent.  Any
  152|       |                                     * exponent larger than this will already
  153|       |                                     * produce underflow or overflow, so there's
  154|       |                                     * no need to worry about additional digits.
  155|       |                                     */
  156|       |    /* Table giving binary powers of 10.  Entry is 10^2^i.
  157|       |     * Used to convert decimal exponents into floating-point numbers. */
  158|  5.58k|    static double powersOf10[] = {
  159|  5.58k|        10.,
  160|  5.58k|        100.,
  161|  5.58k|        1.0e4,
  162|  5.58k|        1.0e8,
  163|  5.58k|        1.0e16,
  164|  5.58k|        1.0e32,
  165|  5.58k|        1.0e64,
  166|  5.58k|        1.0e128,
  167|  5.58k|        1.0e256
  168|  5.58k|    };
  169|       |
  170|  5.58k|    bool sign = false, expSign = false;
  171|  5.58k|    double fraction, dblExp, *d;
  172|  5.58k|    const char *p;
  173|  5.58k|    int c;
  174|  5.58k|    int exp = 0;                // Exponent read from "EX" field.
  175|  5.58k|    int fracExp = 0;            /* Exponent that derives from the fractional
  176|       |                                 * part.  Under normal circumstatnces, it is
  177|       |                                 * the negative of the number of digits in F.
  178|       |                                 * However, if I is very long, the last digits
  179|       |                                 * of I get dropped (otherwise a long I with a
  180|       |                                 * large negative exponent could cause an
  181|       |                                 * unnecessary overflow on I alone).  In this
  182|       |                                 * case, fracExp is incremented one for each
  183|       |                                 * dropped digit. */
  184|  5.58k|    int mantSize;               // Number of digits in mantissa.
  185|  5.58k|    int decPt;                  /* Number of mantissa digits BEFORE decimal
  186|       |                                 * point. */
  187|  5.58k|    const char *pExp;           /* Temporarily holds location of exponent
  188|       |                                 * in string. */
  189|       |
  190|       |    /*
  191|       |     * Strip off leading blanks and check for a sign.
  192|       |     */
  193|       |
  194|  5.58k|    p = string;
  195|  5.58k|    while (isspace((int)*p)) {
  196|      0|        p += 1;
  197|      0|    }
  198|  5.58k|    if (isdigit((int)*p)) {
  199|       |        // ignore
  200|  3.21k|    } else if ('-' == *p) {
  ------------------
  |  Branch (200:16): [True: 525, False: 1.84k]
  ------------------
  201|    525|        sign = true;
  202|    525|        p += 1;
  203|  1.84k|    } else if ('+' == *p) {
  ------------------
  |  Branch (203:16): [True: 205, False: 1.63k]
  ------------------
  204|    205|        p += 1;
  205|  1.63k|    } else if ('.' == *p) {
  ------------------
  |  Branch (205:16): [True: 919, False: 720]
  ------------------
  206|       |        // ignore
  207|    919|    } else {
  208|    720|        return NAN;
  209|    720|    }
  210|       |
  211|       |    /*
  212|       |     * Count the number of digits in the mantissa (including the decimal
  213|       |     * point), and also locate the decimal point.
  214|       |     */
  215|       |
  216|  4.86k|    decPt = -1;
  217|  29.1k|    for (mantSize = 0; ; mantSize += 1) {
  218|  29.1k|        c = *p;
  219|  29.1k|        if (!isdigit((int)c)) {
  ------------------
  |  Branch (219:13): [True: 6.11k, False: 23.0k]
  ------------------
  220|  6.11k|            if ((c != '.') || (decPt >= 0)) {
  ------------------
  |  Branch (220:17): [True: 4.61k, False: 1.50k]
  |  Branch (220:31): [True: 255, False: 1.24k]
  ------------------
  221|  4.86k|                break;
  222|  4.86k|            }
  223|  1.24k|            decPt = mantSize;
  224|  1.24k|        }
  225|  24.2k|        p += 1;
  226|  24.2k|    }
  227|       |
  228|       |    /*
  229|       |     * Now suck up the digits in the mantissa.  Use two integers to
  230|       |     * collect 9 digits each (this is faster than using floating-point).
  231|       |     * If the mantissa has more than 18 digits, ignore the extras, since
  232|       |     * they can't affect the value anyway.
  233|       |     */
  234|       |
  235|  4.86k|    pExp  = p;
  236|  4.86k|    p -= mantSize;
  237|  4.86k|    if (decPt < 0) {
  ------------------
  |  Branch (237:9): [True: 3.62k, False: 1.24k]
  ------------------
  238|  3.62k|        decPt = mantSize;
  239|  3.62k|    } else {
  240|  1.24k|        mantSize -= 1;                  // One of the digits was the point.
  241|  1.24k|    }
  242|  4.86k|    if (mantSize > 18) {
  ------------------
  |  Branch (242:9): [True: 519, False: 4.34k]
  ------------------
  243|    519|        fracExp = decPt - 18;
  244|    519|        mantSize = 18;
  245|  4.34k|    } else {
  246|  4.34k|        fracExp = decPt - mantSize;
  247|  4.34k|    }
  248|  4.86k|    if (mantSize == 0) {
  ------------------
  |  Branch (248:9): [True: 1.12k, False: 3.73k]
  ------------------
  249|  1.12k|        fraction = 0.0;
  250|       |        // p = string;
  251|  1.12k|        goto done;
  252|  3.73k|    } else {
  253|  3.73k|        int frac1, frac2;
  254|       |
  255|  3.73k|        frac1 = 0;
  256|  10.1k|        for ( ; mantSize > 9; mantSize -= 1) {
  ------------------
  |  Branch (256:17): [True: 6.37k, False: 3.73k]
  ------------------
  257|  6.37k|            c = *p;
  258|  6.37k|            p += 1;
  259|  6.37k|            if ('.' == c) {
  ------------------
  |  Branch (259:17): [True: 294, False: 6.07k]
  ------------------
  260|    294|                c = *p;
  261|    294|                p += 1;
  262|    294|            }
  263|  6.37k|            frac1 = 10*frac1 + (c - '0');
  264|  6.37k|        }
  265|  3.73k|        frac2 = 0;
  266|  17.1k|        for (; mantSize > 0; mantSize -= 1) {
  ------------------
  |  Branch (266:16): [True: 13.3k, False: 3.73k]
  ------------------
  267|  13.3k|            c = *p;
  268|  13.3k|            p += 1;
  269|  13.3k|            if ('.' == c) {
  ------------------
  |  Branch (269:17): [True: 293, False: 13.1k]
  ------------------
  270|    293|                c = *p;
  271|    293|                p += 1;
  272|    293|            }
  273|  13.3k|            frac2 = 10*frac2 + (c - '0');
  274|  13.3k|        }
  275|  3.73k|        fraction = (1.0e9 * frac1) + frac2;
  276|  3.73k|    }
  277|       |
  278|       |    /*
  279|       |     * Skim off the exponent.
  280|       |     */
  281|       |
  282|  3.73k|    p = pExp;
  283|  3.73k|    if (('E' == *p) ||
  ------------------
  |  Branch (283:9): [True: 520, False: 3.21k]
  ------------------
  284|  3.73k|        ('e' == *p)) {
  ------------------
  |  Branch (284:9): [True: 1.24k, False: 1.97k]
  ------------------
  285|  1.76k|        p += 1;
  286|  1.76k|        if ('-' == *p) {
  ------------------
  |  Branch (286:13): [True: 518, False: 1.24k]
  ------------------
  287|    518|            expSign = true;
  288|    518|            p += 1;
  289|  1.24k|        } else {
  290|  1.24k|            if ('+' == *p) {
  ------------------
  |  Branch (290:17): [True: 194, False: 1.04k]
  ------------------
  291|    194|                p += 1;
  292|    194|            }
  293|  1.24k|            expSign = false;
  294|  1.24k|        }
  295|  3.15k|        while (isdigit((int) *p)) {
  296|  3.15k|            exp = exp * 10 + (*p - '0');
  297|  3.15k|            if (1024 < exp) {
  ------------------
  |  Branch (297:17): [True: 410, False: 2.74k]
  ------------------
  298|    410|                if (true == expSign) {
  ------------------
  |  Branch (298:21): [True: 199, False: 211]
  ------------------
  299|       |                    // exponent underflow!
  300|    199|                    return 0.0;
  301|    199|                } // else  exponent overflow!
  302|    211|                return INFINITY;
  303|    410|            }
  304|  2.74k|            p += 1;
  305|  2.74k|        }
  306|  1.76k|    }
  307|  3.32k|    if (expSign) {
  ------------------
  |  Branch (307:9): [True: 319, False: 3.00k]
  ------------------
  308|    319|        exp = fracExp - exp;
  309|  3.00k|    } else {
  310|  3.00k|        exp = fracExp + exp;
  311|  3.00k|    }
  312|       |
  313|       |    /*
  314|       |     * Generate a floating-point number that represents the exponent.
  315|       |     * Do this by processing the exponent one bit at a time to combine
  316|       |     * many powers of 2 of 10. Then combine the exponent with the
  317|       |     * fraction.
  318|       |     */
  319|       |
  320|  3.32k|    if (0 > exp) {
  ------------------
  |  Branch (320:9): [True: 686, False: 2.64k]
  ------------------
  321|    686|        expSign = true;
  322|    686|        exp = -exp;
  323|  2.64k|    } else {
  324|  2.64k|        expSign = false;
  325|  2.64k|    }
  326|  3.32k|    if (exp > maxExponent) {
  ------------------
  |  Branch (326:9): [True: 269, False: 3.05k]
  ------------------
  327|    269|        exp = maxExponent;
  328|    269|        errno = ERANGE;
  329|    269|    }
  330|  3.32k|    dblExp = 1.0;
  331|  9.48k|    for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
  ------------------
  |  Branch (331:26): [True: 6.15k, False: 3.32k]
  ------------------
  332|  6.15k|        if (exp & 01) {
  ------------------
  |  Branch (332:13): [True: 4.63k, False: 1.52k]
  ------------------
  333|  4.63k|            dblExp *= *d;
  334|  4.63k|        }
  335|  6.15k|    }
  336|  3.32k|    if (expSign) {
  ------------------
  |  Branch (336:9): [True: 686, False: 2.64k]
  ------------------
  337|    686|        fraction /= dblExp;
  338|  2.64k|    } else {
  339|  2.64k|        fraction *= dblExp;
  340|  2.64k|    }
  341|       |
  342|  4.45k|done:
  343|  4.45k|    if (sign) {
  ------------------
  |  Branch (343:9): [True: 525, False: 3.93k]
  ------------------
  344|    525|        return -fraction;
  345|    525|    }
  346|  3.93k|    return fraction;
  347|  4.45k|}
mkgmtime:
  658|  2.48k|{
  659|  2.48k|    int year;
  660|  2.48k|    time_t result;
  661|  2.48k|    static const int cumdays[MONTHSPERYEAR] =
  662|  2.48k|        { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
  663|       |
  664|       |    // check ranges, ignore tm_isdst and max tm_year
  665|  2.48k|    if (0 > t->tm_sec ||
  ------------------
  |  Branch (665:9): [True: 0, False: 2.48k]
  ------------------
  666|  2.48k|        0 > t->tm_min ||
  ------------------
  |  Branch (666:9): [True: 0, False: 2.48k]
  ------------------
  667|  2.48k|        0 > t->tm_hour ||
  ------------------
  |  Branch (667:9): [True: 0, False: 2.48k]
  ------------------
  668|  2.48k|        1 > t->tm_mday ||
  ------------------
  |  Branch (668:9): [True: 453, False: 2.02k]
  ------------------
  669|  2.48k|        0 > t->tm_mon ||
  ------------------
  |  Branch (669:9): [True: 0, False: 2.02k]
  ------------------
  670|  2.48k|        0 > t->tm_year ||
  ------------------
  |  Branch (670:9): [True: 623, False: 1.40k]
  ------------------
  671|  2.48k|        0 > t->tm_wday ||
  ------------------
  |  Branch (671:9): [True: 0, False: 1.40k]
  ------------------
  672|  2.48k|        0 > t->tm_yday ||
  ------------------
  |  Branch (672:9): [True: 0, False: 1.40k]
  ------------------
  673|  2.48k|        61 < t->tm_sec ||
  ------------------
  |  Branch (673:9): [True: 0, False: 1.40k]
  ------------------
  674|  2.48k|        59 < t->tm_min ||
  ------------------
  |  Branch (674:9): [True: 0, False: 1.40k]
  ------------------
  675|  2.48k|        23 < t->tm_hour ||
  ------------------
  |  Branch (675:9): [True: 0, False: 1.40k]
  ------------------
  676|  2.48k|        31 < t->tm_mday ||
  ------------------
  |  Branch (676:9): [True: 0, False: 1.40k]
  ------------------
  677|  2.48k|        11 < t->tm_mon ||
  ------------------
  |  Branch (677:9): [True: 0, False: 1.40k]
  ------------------
  678|  2.48k|        6 < t->tm_wday ||
  ------------------
  |  Branch (678:9): [True: 0, False: 1.40k]
  ------------------
  679|  2.48k|        365 < t->tm_yday) {
  ------------------
  |  Branch (679:9): [True: 0, False: 1.40k]
  ------------------
  680|  1.07k|        errno = EOVERFLOW;
  681|  1.07k|        return -1;
  682|  1.07k|    }
  683|  1.40k|    errno = 0;
  684|  1.40k|    year = 1900 + t->tm_year + t->tm_mon / MONTHSPERYEAR;
  ------------------
  |  |  349|  1.40k|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  685|  1.40k|    result = (year - 1970) * 365 + cumdays[t->tm_mon % MONTHSPERYEAR];
  ------------------
  |  |  349|  1.40k|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  686|  1.40k|    result += (year - 1968) / 4;
  687|  1.40k|    result -= (year - 1900) / 100;
  688|  1.40k|    result += (year - 1600) / 400;
  689|  1.40k|    if (0 == (year % 4) &&
  ------------------
  |  Branch (689:9): [True: 866, False: 539]
  ------------------
  690|  1.40k|        (0 != (year % 100) ||
  ------------------
  |  Branch (690:10): [True: 446, False: 420]
  ------------------
  691|    866|         0 == (year % 400)) &&
  ------------------
  |  Branch (691:10): [True: 217, False: 203]
  ------------------
  692|  1.40k|        (2 > (t->tm_mon % MONTHSPERYEAR))) {
  ------------------
  |  |  349|    663|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  |  Branch (692:9): [True: 353, False: 310]
  ------------------
  693|    353|        result--;
  694|    353|    }
  695|  1.40k|    result += t->tm_mday - 1;
  696|  1.40k|    result *= 24;
  697|  1.40k|    result += t->tm_hour;
  698|  1.40k|    result *= 60;
  699|  1.40k|    result += t->tm_min;
  700|  1.40k|    result *= 60;
  701|  1.40k|    result += t->tm_sec;
  702|       |    /* this is UTC, no DST
  703|       |     * if (t->tm_isdst == 1)
  704|       |     * result -= 3600;
  705|       |     */
  706|  1.40k|    return result;
  707|  2.48k|}
iso8601_to_timespec:
  711|  2.48k|{
  712|  2.48k|    timespec_t ret;
  713|       |
  714|  2.48k|#ifndef __clang_analyzer__
  715|       |#ifdef USE_QT
  716|       |    double usec = 0;
  717|       |
  718|       |    QString t(isotime);
  719|       |    QDateTime d = QDateTime::fromString(isotime, Qt::ISODate);
  720|       |    QStringList sl = t.split(".");
  721|       |    if (1 < sl.size()) {
  722|       |        usec = sl[1].toInt() / pow(10., (double)sl[1].size());
  723|       |    }
  724|       |    ret.tv_sec = d.toTime_t();
  725|       |    ret.tv_nsec = usec * 1e9;
  726|       |#else  // USE_QT
  727|  2.48k|    double usec = 0;
  728|  2.48k|    struct tm tm = {0};
  729|       |
  730|  2.48k|    {
  731|  2.48k|        char *dp = NULL;
  732|  2.48k|        dp = strptime(isotime, "%Y-%m-%dT%H:%M:%S", &tm);
  733|  2.48k|        if (NULL != dp &&
  ------------------
  |  Branch (733:13): [True: 633, False: 1.84k]
  ------------------
  734|  2.48k|            '.' == *dp) {
  ------------------
  |  Branch (734:13): [True: 194, False: 439]
  ------------------
  735|    194|            usec = strtod(dp, NULL);
  736|    194|        }
  737|  2.48k|    }
  738|       |
  739|       |    /*
  740|       |     * It would be nice if we could say mktime(&tm) - timezone + usec instead,
  741|       |     * but timezone is not available at all on some BSDs. Besides, when working
  742|       |     * with historical dates the value of timezone after an ordinary tzset(3)
  743|       |     * can be wrong; you have to do a redirect through the IANA historical
  744|       |     * timezone database to get it right.
  745|       |     */
  746|  2.48k|    ret.tv_sec = mkgmtime(&tm);
  747|  2.48k|    ret.tv_nsec = usec * 1e9;
  748|  2.48k|#endif  // USE_QT
  749|  2.48k|#endif  // __clang_analyzer__
  750|       |
  751|  2.48k|#if 4 < SIZEOF_TIME_T
  752|  2.48k|    if (253402300799LL < ret.tv_sec) {
  ------------------
  |  Branch (752:9): [True: 194, False: 2.28k]
  ------------------
  753|       |        // enforce max "9999-12-31T23:59:59.999Z"
  754|    194|        ret.tv_sec = 253402300799LL;
  755|    194|    }
  756|  2.48k|#endif
  757|  2.48k|    return ret;
  758|  2.48k|}

gps_hexpack:
  119|    117|{
  120|    117|    ssize_t i, j;
  121|       |
  122|    117|    j = strnlen(src, BUFSIZ) / 2;
  123|    117|    if ((1 > j) ||
  ------------------
  |  Branch (123:9): [True: 2, False: 115]
  ------------------
  124|    117|        ((size_t)j > len)) {
  ------------------
  |  Branch (124:9): [True: 11, False: 104]
  ------------------
  125|     13|        return -2;
  126|     13|    }
  127|       |
  128|    457|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (128:17): [True: 416, False: 41]
  ------------------
  129|    416|        int k;
  130|    416|        if (-1 == (k = hex2bin(src + i * 2))) {
  ------------------
  |  Branch (130:13): [True: 63, False: 353]
  ------------------
  131|     63|            return -1;
  132|     63|        }
  133|    353|        dst[i] = (char)(k & 0xff);
  134|    353|    }
  135|     41|    (void)memset(dst + i, '\0', (size_t)(len - i));
  136|     41|    return j;
  137|    104|}
hex.c:hex2bin:
   82|    416|{
   83|    416|    int a, b;
   84|       |
   85|    416|    a = s[0] & 0xff;
   86|    416|    b = s[1] & 0xff;
   87|       |
   88|    416|    if ((a >= 'a') &&
  ------------------
  |  Branch (88:9): [True: 107, False: 309]
  ------------------
   89|    416|        (a <= 'f')) {
  ------------------
  |  Branch (89:9): [True: 97, False: 10]
  ------------------
   90|     97|        a = a + 10 - 'a';
   91|    319|    } else if ((a >= 'A') &&
  ------------------
  |  Branch (91:16): [True: 140, False: 179]
  ------------------
   92|    319|               (a <= 'F')) {
  ------------------
  |  Branch (92:16): [True: 125, False: 15]
  ------------------
   93|    125|        a = a + 10 - 'A';
   94|    194|    } else if ((a >= '0') &&
  ------------------
  |  Branch (94:16): [True: 186, False: 8]
  ------------------
   95|    194|               (a <= '9')) {
  ------------------
  |  Branch (95:16): [True: 167, False: 19]
  ------------------
   96|    167|        a -= '0';
   97|    167|    } else {
   98|     27|        return -1;
   99|     27|    }
  100|       |
  101|    389|    if ((b >= 'a') &&
  ------------------
  |  Branch (101:9): [True: 102, False: 287]
  ------------------
  102|    389|        (b <= 'f')) {
  ------------------
  |  Branch (102:9): [True: 90, False: 12]
  ------------------
  103|     90|        b = b + 10 - 'a';
  104|    299|    } else if ((b >= 'A') &&
  ------------------
  |  Branch (104:16): [True: 142, False: 157]
  ------------------
  105|    299|               (b <= 'F')) {
  ------------------
  |  Branch (105:16): [True: 121, False: 21]
  ------------------
  106|    121|        b = b + 10 - 'A';
  107|    178|    } else if ((b >= '0') &&
  ------------------
  |  Branch (107:16): [True: 169, False: 9]
  ------------------
  108|    178|               (b <= '9')) {
  ------------------
  |  Branch (108:16): [True: 142, False: 27]
  ------------------
  109|    142|        b -= '0';
  110|    142|    } else {
  111|     36|        return -1;
  112|     36|    }
  113|       |
  114|    353|    return ((a << 4) + b);
  115|    389|}

json_read_array:
  746|  1.12k|{
  747|  1.12k|    int substatus, offset, arrcount;
  748|  1.12k|    char *tp;
  749|       |
  750|  1.12k|    if (NULL != end)
  ------------------
  |  Branch (750:9): [True: 1.12k, False: 0]
  ------------------
  751|  1.12k|        *end = NULL;    // give it a well-defined value on parse failure
  752|       |
  753|  1.12k|    json_debug_trace((1, "Entered json_read_array()\n"));
  ------------------
  |  |  110|  1.12k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  754|       |
  755|  1.12k|    while (isspace((unsigned char)*cp)) {
  756|      0|        cp++;
  757|      0|    }
  758|  1.12k|    if (*cp != '[') {
  ------------------
  |  Branch (758:9): [True: 0, False: 1.12k]
  ------------------
  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.12k|    cp++;
  763|       |
  764|  1.12k|    tp = arr->arr.strings.store;
  765|  1.12k|    arrcount = 0;
  766|       |
  767|       |    // Check for empty array
  768|  1.12k|    while (isspace((unsigned char)*cp)) {
  769|    399|        cp++;
  770|    399|    }
  771|  1.12k|    if (*cp == ']') {
  ------------------
  |  Branch (771:9): [True: 391, False: 736]
  ------------------
  772|    391|        goto breakout;
  773|    391|    }
  774|       |
  775|  8.56k|    for (offset = 0; offset < arr->maxlen; offset++) {
  ------------------
  |  Branch (775:22): [True: 8.56k, False: 1]
  ------------------
  776|  8.56k|        char *ep = NULL;
  777|       |
  778|  8.56k|        json_debug_trace((1, "Looking at %s\n", cp));
  ------------------
  |  |  110|  8.56k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  779|  8.56k|        switch (arr->element_type) {
  ------------------
  |  Branch (779:17): [True: 0, False: 8.56k]
  ------------------
  780|  3.64k|        case t_string:
  ------------------
  |  Branch (780:9): [True: 3.64k, False: 4.91k]
  ------------------
  781|  3.64k|            if (isspace((unsigned char) *cp)) {
  782|    195|                cp++;
  783|    195|            }
  784|  3.64k|            if (*cp != '"') {
  ------------------
  |  Branch (784:17): [True: 11, False: 3.63k]
  ------------------
  785|     11|                return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     11|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  786|  3.63k|            } else {
  787|  3.63k|                ++cp;
  788|  3.63k|            }
  789|  3.63k|            arr->arr.strings.ptrs[offset] = tp;
  790|  12.5k|            for (; tp - arr->arr.strings.store < arr->arr.strings.storelen;
  ------------------
  |  Branch (790:20): [True: 12.5k, False: 3]
  ------------------
  791|  8.92k|                 tp++)
  792|  12.5k|                if (*cp == '"') {
  ------------------
  |  Branch (792:21): [True: 3.63k, False: 8.92k]
  ------------------
  793|  3.63k|                    ++cp;
  794|  3.63k|                    *tp++ = '\0';
  795|  3.63k|                    goto stringend;
  796|  8.92k|                } else if (*cp == '\0') {
  ------------------
  |  Branch (796:28): [True: 2, False: 8.92k]
  ------------------
  797|      2|                    json_debug_trace((1,
  ------------------
  |  |  110|      2|#define json_debug_trace(args) (void) json_trace args
  ------------------
  798|      2|                                      "Bad string syntax in string list.\n"));
  799|      2|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      2|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  800|  8.92k|                } else {
  801|  8.92k|                    *tp = *cp++;
  802|  8.92k|                }
  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.63k|          stringend:
  806|  3.63k|            break;
  807|      0|        case t_object:
  ------------------
  |  Branch (807:9): [True: 0, False: 8.56k]
  ------------------
  808|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  809|  4.91k|        case t_structobject:
  ------------------
  |  Branch (809:9): [True: 4.91k, False: 3.64k]
  ------------------
  810|  4.91k|            substatus =
  811|  4.91k|                json_internal_read_object(cp, arr->arr.objects.subtype, arr,
  812|  4.91k|                                          offset, &cp);
  813|  4.91k|            if (substatus != 0) {
  ------------------
  |  Branch (813:17): [True: 106, False: 4.81k]
  ------------------
  814|    106|                if (NULL != end) {
  ------------------
  |  Branch (814:21): [True: 106, False: 0]
  ------------------
  815|    106|                    *end = cp;
  816|    106|                }
  817|    106|                return substatus;
  818|    106|            }
  819|  4.81k|            break;
  820|  4.81k|        case t_integer:
  ------------------
  |  Branch (820:9): [True: 0, False: 8.56k]
  ------------------
  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.56k]
  ------------------
  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.56k]
  ------------------
  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.56k]
  ------------------
  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.56k]
  ------------------
  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.56k]
  ------------------
  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.56k]
  ------------------
  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.56k]
  ------------------
  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.56k]
  ------------------
  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.56k]
  ------------------
  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.56k]
  ------------------
  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.56k]
  ------------------
  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.56k]
  ------------------
  920|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  921|      0|        case t_array:
  ------------------
  |  Branch (921:9): [True: 0, False: 8.56k]
  ------------------
  922|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  923|      0|        case t_check:
  ------------------
  |  Branch (923:9): [True: 0, False: 8.56k]
  ------------------
  924|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  925|      0|        case t_ignore:
  ------------------
  |  Branch (925:9): [True: 0, False: 8.56k]
  ------------------
  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.56k|        }
  929|  8.44k|        arrcount++;
  930|  8.44k|        if (isspace((unsigned char)*cp)) {
  931|    194|            cp++;
  932|    194|        }
  933|  8.44k|        if (*cp == ']') {
  ------------------
  |  Branch (933:13): [True: 466, False: 7.97k]
  ------------------
  934|    466|            json_debug_trace((1, "End of array found.\n"));
  ------------------
  |  |  110|    466|#define json_debug_trace(args) (void) json_trace args
  ------------------
  935|    466|            goto breakout;
  936|    466|        }
  937|  7.97k|        if (*cp == ',') {
  ------------------
  |  Branch (937:13): [True: 7.82k, False: 147]
  ------------------
  938|  7.82k|            cp++;
  939|  7.82k|        } else {
  940|    147|            json_debug_trace((1, "Bad trailing syntax on array.\n"));
  ------------------
  |  |  110|    147|#define json_debug_trace(args) (void) json_trace args
  ------------------
  941|    147|            return JSON_ERR_BADSUBTRAIL;
  ------------------
  |  |  164|    147|#define JSON_ERR_BADSUBTRAIL   13      // garbage while expecting array comma
  ------------------
  942|    147|        }
  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|    857|  breakout:
  950|    857|    if (NULL != arr->count) {
  ------------------
  |  Branch (950:9): [True: 857, False: 0]
  ------------------
  951|    857|        *(arr->count) = arrcount;
  952|    857|    }
  953|    857|    if (NULL != end) {
  ------------------
  |  Branch (953:9): [True: 857, False: 0]
  ------------------
  954|    857|        *end = cp;
  955|    857|    }
  956|    857|    json_debug_trace((1, "leaving json_read_array() with %d elements\n",
  ------------------
  |  |  110|    857|#define json_debug_trace(args) (void) json_trace args
  ------------------
  957|    857|                      arrcount));
  958|    857|    return 0;
  959|    736|}
json_read_object:
  963|  4.88k|{
  964|  4.88k|    int st;
  965|       |
  966|  4.88k|    json_debug_trace((1, "json_read_object() sees '%s'\n", cp));
  ------------------
  |  |  110|  4.88k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  967|  4.88k|    st = json_internal_read_object(cp, attrs, NULL, 0, end);
  968|  4.88k|    return st;
  969|  4.88k|}
json.c:json_trace:
   95|  1.21M|{
   96|  1.21M|    if (errlevel <= debuglevel &&
  ------------------
  |  Branch (96:9): [True: 0, False: 1.21M]
  ------------------
   97|  1.21M|        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.21M|}
json.c:json_internal_read_object:
  187|  9.80k|{
  188|  9.80k|    enum
  189|  9.80k|    { init, await_attr, in_attr, await_value, in_val_string,
  190|  9.80k|        in_escape, in_val_token, post_val, post_element
  191|  9.80k|    } state = 0;
  192|  9.80k|    char *statenames[] = {
  193|  9.80k|        "init", "await_attr", "in_attr", "await_value", "in_val_string",
  194|  9.80k|        "in_escape", "in_val_token", "post_val", "post_element",
  195|  9.80k|    };
  196|  9.80k|    char attrbuf[JSON_ATTR_MAX + 1], *pattr = NULL;
  197|  9.80k|    char valbuf[JSON_VAL_MAX + 1], *pval = NULL;
  198|  9.80k|    bool value_quoted = false;
  199|  9.80k|    char uescape[5];            // enough space for 4 hex digits and a NUL
  200|  9.80k|    const struct json_attr_t *cursor;
  201|  9.80k|    int substatus, maxlen = 0;
  202|  9.80k|    unsigned int u;
  203|  9.80k|    const struct json_enum_t *mp;
  204|  9.80k|    char *lptr;
  205|       |
  206|  9.80k|    if (NULL != end) {
  ------------------
  |  Branch (206:9): [True: 4.91k, False: 4.88k]
  ------------------
  207|  4.91k|        *end = NULL;    // give it a well-defined value on parse failure
  208|  4.91k|    }
  209|       |
  210|       |    // stuff fields with defaults in case they're omitted in the JSON input
  211|   146k|    for (cursor = attrs; cursor->attribute != NULL; cursor++)
  ------------------
  |  Branch (211:26): [True: 137k, False: 9.80k]
  ------------------
  212|   137k|        if (!cursor->nodefault) {
  ------------------
  |  Branch (212:13): [True: 137k, False: 156]
  ------------------
  213|   137k|            lptr = json_target_address(cursor, parent, offset);
  214|   137k|            if (NULL != lptr)
  ------------------
  |  Branch (214:17): [True: 127k, False: 9.73k]
  ------------------
  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|  19.0k|                case t_ubyte:
  ------------------
  |  Branch (219:17): [True: 19.0k, False: 108k]
  ------------------
  220|  19.0k|                    lptr[0] = cursor->dflt.ubyte;
  221|  19.0k|                    break;
  222|  16.3k|                case t_integer:
  ------------------
  |  Branch (222:17): [True: 16.3k, False: 110k]
  ------------------
  223|  16.3k|                    memcpy(lptr, &cursor->dflt.integer, sizeof(int));
  224|  16.3k|                    break;
  225|  7.60k|                case t_uinteger:
  ------------------
  |  Branch (225:17): [True: 7.60k, False: 119k]
  ------------------
  226|  7.60k|                    memcpy(lptr, &cursor->dflt.uinteger, sizeof(unsigned int));
  227|  7.60k|                    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|    108|                case t_ulongint:
  ------------------
  |  Branch (231:17): [True: 108, False: 127k]
  ------------------
  232|    108|                    memcpy(lptr, &cursor->dflt.ulongint,
  233|    108|                           sizeof(unsigned long));
  234|    108|                    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.73k|                case t_time:
  ------------------
  |  Branch (242:17): [True: 1.73k, False: 125k]
  ------------------
  243|  1.73k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  244|  1.73k|                    break;
  245|  1.43k|                case t_timespec:
  ------------------
  |  Branch (245:17): [True: 1.43k, False: 125k]
  ------------------
  246|  1.43k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  247|  1.43k|                    break;
  248|  52.4k|                case t_real:
  ------------------
  |  Branch (248:17): [True: 52.4k, False: 74.8k]
  ------------------
  249|  52.4k|                    memcpy(lptr, &cursor->dflt.real, sizeof(double));
  250|  52.4k|                    break;
  251|  11.4k|                case t_string:
  ------------------
  |  Branch (251:17): [True: 11.4k, False: 115k]
  ------------------
  252|  11.4k|                    if (parent != NULL
  ------------------
  |  Branch (252:25): [True: 5.43k, False: 6.02k]
  ------------------
  253|  11.4k|                        && parent->element_type != t_structobject
  ------------------
  |  Branch (253:28): [True: 0, False: 5.43k]
  ------------------
  254|  11.4k|                        && 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|  11.4k|                    lptr[0] = '\0';
  257|  11.4k|                    break;
  258|  4.17k|                case t_boolean:
  ------------------
  |  Branch (258:17): [True: 4.17k, False: 123k]
  ------------------
  259|  4.17k|                    memcpy(lptr, &cursor->dflt.boolean, sizeof(bool));
  260|  4.17k|                    break;
  261|  1.17k|                case t_character:
  ------------------
  |  Branch (261:17): [True: 1.17k, False: 126k]
  ------------------
  262|  1.17k|                    lptr[0] = cursor->dflt.character;
  263|  1.17k|                    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|    719|                case t_check:
  ------------------
  |  Branch (270:17): [True: 719, False: 126k]
  ------------------
  271|    719|                    FALLTHROUGH
  ------------------
  |  |   55|    719|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  272|  5.62k|                case t_ignore:
  ------------------
  |  Branch (272:17): [True: 4.90k, False: 122k]
  ------------------
  273|  5.62k|                    break;
  274|   127k|                }
  275|   137k|        }
  276|       |
  277|  9.80k|    json_debug_trace((1, "JSON parse of '%s' begins.\n", cp));
  ------------------
  |  |  110|  9.80k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  278|       |
  279|       |    // parse input JSON
  280|   506k|    for (; *cp != '\0'; cp++) {
  ------------------
  |  Branch (280:12): [True: 504k, False: 2.55k]
  ------------------
  281|   504k|        json_debug_trace((2, "State %-14s, looking at '%c' (%p)\n",
  ------------------
  |  |  110|   504k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  282|   504k|                          statenames[state], *cp, cp));
  283|   504k|        switch (state) {
  ------------------
  |  Branch (283:17): [True: 0, False: 504k]
  ------------------
  284|  10.2k|        case init:
  ------------------
  |  Branch (284:9): [True: 10.2k, False: 493k]
  ------------------
  285|  10.2k|            if (isspace((unsigned char) *cp)) {
  286|    439|                continue;
  287|    439|            }
  288|  9.76k|            if (*cp == '{') {
  ------------------
  |  Branch (288:17): [True: 9.73k, False: 26]
  ------------------
  289|  9.73k|                state = await_attr;
  290|  9.73k|            } else {
  291|     26|                json_debug_trace((1,
  ------------------
  |  |  110|     26|#define json_debug_trace(args) (void) json_trace args
  ------------------
  292|     26|                                  "Non-WS when expecting object start.\n"));
  293|     26|                if (NULL != end) {
  ------------------
  |  Branch (293:21): [True: 26, False: 0]
  ------------------
  294|     26|                    *end = cp;
  295|     26|                }
  296|     26|                return JSON_ERR_OBSTART;
  ------------------
  |  |  152|     26|#define JSON_ERR_OBSTART        1      // non-WS when expecting object start
  ------------------
  297|     26|            }
  298|  9.73k|            break;
  299|  40.8k|        case await_attr:
  ------------------
  |  Branch (299:9): [True: 40.8k, False: 463k]
  ------------------
  300|  40.8k|            if (isspace((unsigned char) *cp)) {
  301|    209|                continue;
  302|    209|            }
  303|  40.6k|            if (*cp == '"') {
  ------------------
  |  Branch (303:17): [True: 40.3k, False: 305]
  ------------------
  304|  40.3k|                state = in_attr;
  305|  40.3k|                pattr = attrbuf;
  306|  40.3k|                if (NULL != end) {
  ------------------
  |  Branch (306:21): [True: 6.52k, False: 33.8k]
  ------------------
  307|  6.52k|                    *end = cp;
  308|  6.52k|                }
  309|  40.3k|            } else if (*cp == '}') {
  ------------------
  |  Branch (309:24): [True: 200, False: 105]
  ------------------
  310|    200|                break;
  311|    200|            } else {
  312|    105|                json_debug_trace((1, "Non-WS when expecting attribute.\n"));
  ------------------
  |  |  110|    105|#define json_debug_trace(args) (void) json_trace args
  ------------------
  313|    105|                if (NULL != end) {
  ------------------
  |  Branch (313:21): [True: 3, False: 102]
  ------------------
  314|      3|                    *end = cp;
  315|      3|                }
  316|    105|                return JSON_ERR_ATTRSTART;
  ------------------
  |  |  153|    105|#define JSON_ERR_ATTRSTART      2      // non-WS when expecting attrib start
  ------------------
  317|    105|            }
  318|  40.3k|            break;
  319|   165k|        case in_attr:
  ------------------
  |  Branch (319:9): [True: 165k, False: 338k]
  ------------------
  320|   165k|            if (NULL == pattr) {
  ------------------
  |  Branch (320:17): [True: 0, False: 165k]
  ------------------
  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|   165k|            if (*cp == '"') {
  ------------------
  |  Branch (324:17): [True: 40.3k, False: 124k]
  ------------------
  325|  40.3k|                *pattr++ = '\0';
  326|  40.3k|                json_debug_trace((1, "Collected attribute name %s\n",
  ------------------
  |  |  110|  40.3k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  327|  40.3k|                                  attrbuf));
  328|   419k|                for (cursor = attrs; cursor->attribute != NULL; cursor++) {
  ------------------
  |  Branch (328:38): [True: 419k, False: 68]
  ------------------
  329|   419k|                    json_debug_trace((2, "Checking against %s\n",
  ------------------
  |  |  110|   419k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  330|   419k|                                      cursor->attribute));
  331|   419k|                    if (strcmp(cursor->attribute, attrbuf) == 0) {
  ------------------
  |  Branch (331:25): [True: 26.9k, False: 392k]
  ------------------
  332|  26.9k|                        break;
  333|  26.9k|                    }
  334|   392k|                    if (cursor->type == t_ignore &&
  ------------------
  |  Branch (334:25): [True: 13.4k, False: 378k]
  ------------------
  335|   392k|                        strncmp(cursor->attribute, "", 1) == 0) {
  ------------------
  |  Branch (335:25): [True: 13.2k, False: 241]
  ------------------
  336|  13.2k|                        break;
  337|  13.2k|                    }
  338|   392k|                }
  339|  40.3k|                if (NULL == cursor->attribute) {
  ------------------
  |  Branch (339:21): [True: 68, False: 40.2k]
  ------------------
  340|     68|                    json_debug_trace((1,
  ------------------
  |  |  110|     68|#define json_debug_trace(args) (void) json_trace args
  ------------------
  341|     68|                                      "Unknown attribute name '%s'"
  342|     68|                                      " (attributes begin with '%s').\n",
  343|     68|                                      attrbuf, attrs->attribute));
  344|       |                    // don't update end here, leave at attribute start
  345|     68|                    return JSON_ERR_BADATTR;
  ------------------
  |  |  154|     68|#define JSON_ERR_BADATTR        3      // unknown attribute name
  ------------------
  346|     68|                }
  347|  40.2k|                state = await_value;
  348|  40.2k|                if (cursor->type == t_string) {
  ------------------
  |  Branch (348:21): [True: 1.09k, False: 39.1k]
  ------------------
  349|  1.09k|                    maxlen = (int)cursor->len - 1;
  350|  39.1k|                } else if (cursor->type == t_check) {
  ------------------
  |  Branch (350:28): [True: 2.24k, False: 36.8k]
  ------------------
  351|  2.24k|                    maxlen = (int)strnlen(cursor->dflt.check, JSON_VAL_MAX);
  ------------------
  |  |  135|  2.24k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  352|  36.8k|                } else if (cursor->type == t_time ||
  ------------------
  |  Branch (352:28): [True: 2.69k, False: 34.1k]
  ------------------
  353|  36.8k|                           cursor->type == t_ignore) {
  ------------------
  |  Branch (353:28): [True: 18.9k, False: 15.2k]
  ------------------
  354|  21.6k|                    maxlen = JSON_VAL_MAX;
  ------------------
  |  |  135|  21.6k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  355|  21.6k|                } else if (NULL != cursor->map) {
  ------------------
  |  Branch (355:28): [True: 448, False: 14.8k]
  ------------------
  356|    448|                    maxlen = (int)sizeof(valbuf) - 1;
  357|    448|                }
  358|  40.2k|                pval = valbuf;
  359|   124k|            } else if (pattr >= attrbuf + JSON_ATTR_MAX - 1) {
  ------------------
  |  |  134|   124k|#define JSON_ATTR_MAX   31      // max chars in JSON attribute name
  ------------------
  |  Branch (359:24): [True: 9, False: 124k]
  ------------------
  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|   124k|            } else {
  364|   124k|                *pattr++ = *cp;
  365|   124k|            }
  366|   165k|            break;
  367|   165k|        case await_value:
  ------------------
  |  Branch (367:9): [True: 42.7k, False: 461k]
  ------------------
  368|  42.7k|            if (isspace((unsigned char) *cp) ||
  369|  42.7k|                *cp == ':') {
  ------------------
  |  Branch (369:17): [True: 2.41k, False: 40.1k]
  ------------------
  370|  2.63k|                continue;
  371|  2.63k|            }
  372|  40.1k|            if (*cp == '[') {
  ------------------
  |  Branch (372:17): [True: 1.52k, False: 38.5k]
  ------------------
  373|  1.52k|                if (cursor->type != t_array) {
  ------------------
  |  Branch (373:21): [True: 399, False: 1.12k]
  ------------------
  374|    399|                    json_debug_trace((1,
  ------------------
  |  |  110|    399|#define json_debug_trace(args) (void) json_trace args
  ------------------
  375|    399|                                      "Saw [ when not expecting array.\n"));
  376|    399|                    if (NULL != end) {
  ------------------
  |  Branch (376:25): [True: 2, False: 397]
  ------------------
  377|      2|                        *end = cp;
  378|      2|                    }
  379|    399|                    return JSON_ERR_NOARRAY;
  ------------------
  |  |  156|    399|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  ------------------
  380|    399|                }
  381|  1.12k|                substatus = json_read_array(cp, &cursor->addr.array, &cp);
  382|  1.12k|                if (substatus != 0) {
  ------------------
  |  Branch (382:21): [True: 270, False: 857]
  ------------------
  383|    270|                    return substatus;
  384|    270|                }
  385|    857|                state = post_element;
  386|  38.5k|            } else if (cursor->type == t_array) {
  ------------------
  |  Branch (386:24): [True: 1, False: 38.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|  38.5k|            } else if (*cp == '"') {
  ------------------
  |  Branch (393:24): [True: 10.3k, False: 28.2k]
  ------------------
  394|  10.3k|                value_quoted = true;
  395|  10.3k|                state = in_val_string;
  396|  10.3k|                pval = valbuf;
  397|  28.2k|            } else {
  398|  28.2k|                value_quoted = false;
  399|  28.2k|                state = in_val_token;
  400|  28.2k|                pval = valbuf;
  401|  28.2k|                *pval++ = *cp;
  402|  28.2k|            }
  403|  39.4k|            break;
  404|  76.5k|        case in_val_string:
  ------------------
  |  Branch (404:9): [True: 76.5k, False: 427k]
  ------------------
  405|  76.5k|            if (NULL == pval) {
  ------------------
  |  Branch (405:17): [True: 0, False: 76.5k]
  ------------------
  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|  76.5k|            if (*cp == '\\') {
  ------------------
  |  Branch (409:17): [True: 2.60k, False: 73.9k]
  ------------------
  410|  2.60k|                state = in_escape;
  411|  73.9k|            } else if (*cp == '"') {
  ------------------
  |  Branch (411:24): [True: 9.89k, False: 64.0k]
  ------------------
  412|  9.89k|                *pval++ = '\0';
  413|  9.89k|                json_debug_trace((1, "Collected string value %s\n", valbuf));
  ------------------
  |  |  110|  9.89k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  414|  9.89k|                state = post_val;
  415|  64.0k|            } else if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  64.0k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (415:24): [True: 3, False: 64.0k]
  ------------------
  416|  64.0k|                       pval > valbuf + maxlen - 1) {
  ------------------
  |  Branch (416:24): [True: 148, False: 63.9k]
  ------------------
  417|    151|                json_debug_trace((1, "String value too long.\n"));
  ------------------
  |  |  110|    151|#define json_debug_trace(args) (void) json_trace args
  ------------------
  418|       |                // don't update end here, leave at value start
  419|    151|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|    151|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  420|  63.9k|            } else {
  421|  63.9k|                *pval++ = *cp;
  422|  63.9k|            }
  423|  76.4k|            break;
  424|  76.4k|        case in_escape:
  ------------------
  |  Branch (424:9): [True: 2.60k, False: 501k]
  ------------------
  425|  2.60k|            if (NULL == pval) {
  ------------------
  |  Branch (425:17): [True: 0, False: 2.60k]
  ------------------
  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|  2.60k|            if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  2.60k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (429:17): [True: 4, False: 2.59k]
  ------------------
  430|  2.60k|                pval > valbuf + maxlen) {
  ------------------
  |  Branch (430:17): [True: 6, False: 2.59k]
  ------------------
  431|     10|                json_debug_trace((1, "String value too long.\n"));
  ------------------
  |  |  110|     10|#define json_debug_trace(args) (void) json_trace args
  ------------------
  432|       |                // don't update end here, leave at value start
  433|     10|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|     10|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  434|     10|            }
  435|  2.59k|            switch (*cp) {
  436|    686|            case 'b':
  ------------------
  |  Branch (436:13): [True: 686, False: 1.90k]
  ------------------
  437|    686|                *pval++ = '\b';
  438|    686|                break;
  439|    225|            case 'f':
  ------------------
  |  Branch (439:13): [True: 225, False: 2.36k]
  ------------------
  440|    225|                *pval++ = '\f';
  441|    225|                break;
  442|    228|            case 'n':
  ------------------
  |  Branch (442:13): [True: 228, False: 2.36k]
  ------------------
  443|    228|                *pval++ = '\n';
  444|    228|                break;
  445|    379|            case 'r':
  ------------------
  |  Branch (445:13): [True: 379, False: 2.21k]
  ------------------
  446|    379|                *pval++ = '\r';
  447|    379|                break;
  448|    434|            case 't':
  ------------------
  |  Branch (448:13): [True: 434, False: 2.15k]
  ------------------
  449|    434|                *pval++ = '\t';
  450|    434|                break;
  451|    317|            case 'u':
  ------------------
  |  Branch (451:13): [True: 317, False: 2.27k]
  ------------------
  452|    317|                {
  453|    317|                    unsigned n;
  454|       |
  455|    317|                    cp++;                   // skip the 'u'
  456|       |                    // NetBSD 6 wants the cast
  457|  1.32k|                    for (n = 0; n < 4 && isxdigit((int)*cp); n++) {
  ------------------
  |  Branch (457:33): [True: 1.08k, False: 242]
  ------------------
  458|  1.01k|                        uescape[n] = *cp++;
  459|  1.01k|                    }
  460|    317|                    uescape[n] = '\0';      // terminate
  461|    317|                    --cp;
  462|       |                    // ECMA-404 says JSON \u must have 4 hex digits
  463|    317|                    if ((4 != n) ||
  ------------------
  |  Branch (463:25): [True: 75, False: 242]
  ------------------
  464|    317|                        (1 != sscanf(uescape, "%4x", &u))) {
  ------------------
  |  Branch (464:25): [True: 0, False: 242]
  ------------------
  465|     75|                        return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     75|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  466|     75|                    }
  467|       |                    // truncate values above 0xff
  468|    242|                    *pval++ = (unsigned char)u;
  469|    242|                }
  470|      0|                break;
  471|    322|            default:            // handles double quote and solidus
  ------------------
  |  Branch (471:13): [True: 322, False: 2.26k]
  ------------------
  472|    322|                *pval++ = *cp;
  473|    322|                break;
  474|  2.59k|            }
  475|  2.51k|            state = in_val_string;
  476|  2.51k|            break;
  477|   128k|        case in_val_token:
  ------------------
  |  Branch (477:9): [True: 128k, False: 376k]
  ------------------
  478|   128k|            if (NULL == pval) {
  ------------------
  |  Branch (478:17): [True: 0, False: 128k]
  ------------------
  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|   128k|            if (isspace((unsigned char) *cp) ||
  483|   128k|                *cp == ',' ||
  ------------------
  |  Branch (483:17): [True: 22.8k, False: 104k]
  ------------------
  484|   128k|                *cp == '}') {
  ------------------
  |  Branch (484:17): [True: 4.85k, False: 100k]
  ------------------
  485|  28.0k|                *pval = '\0';
  486|  28.0k|                json_debug_trace((1, "Collected token value %s.\n", valbuf));
  ------------------
  |  |  110|  28.0k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  487|  28.0k|                state = post_val;
  488|  28.0k|                if (*cp == '}' ||
  ------------------
  |  Branch (488:21): [True: 4.85k, False: 23.2k]
  ------------------
  489|  28.0k|                    *cp == ',') {
  ------------------
  |  Branch (489:21): [True: 22.8k, False: 316]
  ------------------
  490|  27.7k|                    --cp;
  491|  27.7k|                }
  492|   100k|            } else if (pval > valbuf + JSON_VAL_MAX - 1) {
  ------------------
  |  |  135|   100k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (492:24): [True: 6, False: 99.9k]
  ------------------
  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|  99.9k|            } else {
  497|  99.9k|                *pval++ = *cp;
  498|  99.9k|            }
  499|   128k|            break;
  500|       |            // coverity[unterminated_case]
  501|   128k|        case post_val:
  ------------------
  |  Branch (501:9): [True: 36.7k, False: 467k]
  ------------------
  502|       |            // Ignore whitespace after either string or token values.
  503|  36.7k|            if (isspace(*cp)) {
  504|    667|                while (*cp != '\0' && isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (504:24): [True: 647, False: 20]
  ------------------
  505|    434|                    ++cp;
  506|    434|                }
  507|    233|                json_debug_trace((1,
  ------------------
  |  |  110|    233|#define json_debug_trace(args) (void) json_trace args
  ------------------
  508|    233|                    "Skipped trailing whitespace: value \"%s\"\n", valbuf));
  509|    233|            }
  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.9k|            for (;;) {
  519|  36.9k|                int seeking = cursor->type;
  520|       |
  521|  36.9k|                if (value_quoted &&
  ------------------
  |  Branch (521:21): [True: 8.74k, False: 28.2k]
  ------------------
  522|  36.9k|                    (cursor->type == t_string ||
  ------------------
  |  Branch (522:22): [True: 1.06k, False: 7.67k]
  ------------------
  523|  8.74k|                     cursor->type == t_time)) {
  ------------------
  |  Branch (523:22): [True: 2.48k, False: 5.19k]
  ------------------
  524|  3.54k|                    break;
  525|  3.54k|                }
  526|  33.4k|                if ((strcmp(valbuf, "true") == 0 ||
  ------------------
  |  Branch (526:22): [True: 1.81k, False: 31.6k]
  ------------------
  527|  33.4k|                     strcmp(valbuf, "false") == 0) &&
  ------------------
  |  Branch (527:22): [True: 199, False: 31.4k]
  ------------------
  528|  33.4k|                    seeking == t_boolean) {
  ------------------
  |  Branch (528:21): [True: 1.51k, False: 502]
  ------------------
  529|  1.51k|                    break;
  530|  1.51k|                }
  531|  31.9k|                if (isdigit((unsigned char) valbuf[0])) {
  532|  16.7k|                    bool decimal = strchr(valbuf, '.') != NULL;
  533|       |
  534|  16.7k|                    if (decimal &&
  ------------------
  |  Branch (534:25): [True: 1.15k, False: 15.6k]
  ------------------
  535|  16.7k|                        seeking == t_real) {
  ------------------
  |  Branch (535:25): [True: 331, False: 823]
  ------------------
  536|    331|                        break;
  537|    331|                    }
  538|  16.4k|                    if (!decimal && (seeking == t_byte ||
  ------------------
  |  Branch (538:25): [True: 15.6k, False: 823]
  |  Branch (538:38): [True: 312, False: 15.2k]
  ------------------
  539|  15.6k|                                     seeking == t_ubyte ||
  ------------------
  |  Branch (539:38): [True: 425, False: 14.8k]
  ------------------
  540|  15.6k|                                     seeking == t_integer ||
  ------------------
  |  Branch (540:38): [True: 1.10k, False: 13.7k]
  ------------------
  541|  15.6k|                                     seeking == t_uinteger ||
  ------------------
  |  Branch (541:38): [True: 548, False: 13.2k]
  ------------------
  542|  15.6k|                                     seeking == t_longint ||
  ------------------
  |  Branch (542:38): [True: 0, False: 13.2k]
  ------------------
  543|  15.6k|                                     seeking == t_ulongint ||
  ------------------
  |  Branch (543:38): [True: 464, False: 12.7k]
  ------------------
  544|  15.6k|                                     seeking == t_short ||
  ------------------
  |  Branch (544:38): [True: 1.65k, False: 11.0k]
  ------------------
  545|  15.6k|                                     seeking == t_ushort))
  ------------------
  |  Branch (545:38): [True: 0, False: 11.0k]
  ------------------
  546|  4.51k|                        break;
  547|  16.4k|                }
  548|  27.0k|                if (NULL == cursor[1].attribute) {  // out of possibilities
  ------------------
  |  Branch (548:21): [True: 18.2k, False: 8.79k]
  ------------------
  549|  18.2k|                    break;
  550|  18.2k|                }
  551|  8.79k|                if (0 != strcmp(cursor[1].attribute, attrbuf)) {
  ------------------
  |  Branch (551:21): [True: 8.60k, False: 194]
  ------------------
  552|  8.60k|                    break;
  553|  8.60k|                }
  554|    194|                ++cursor;
  555|    194|            }
  556|  36.7k|            if (value_quoted &&
  ------------------
  |  Branch (556:17): [True: 8.74k, False: 28.0k]
  ------------------
  557|  36.7k|                (cursor->type != t_string &&
  ------------------
  |  Branch (557:18): [True: 7.67k, False: 1.06k]
  ------------------
  558|  8.74k|                 cursor->type != t_character &&
  ------------------
  |  Branch (558:18): [True: 7.47k, False: 199]
  ------------------
  559|  8.74k|                 cursor->type != t_check &&
  ------------------
  |  Branch (559:18): [True: 6.72k, False: 756]
  ------------------
  560|  8.74k|                 cursor->type != t_time &&
  ------------------
  |  Branch (560:18): [True: 4.24k, False: 2.48k]
  ------------------
  561|  8.74k|                 cursor->type != t_ignore &&
  ------------------
  |  Branch (561:18): [True: 455, False: 3.78k]
  ------------------
  562|  8.74k|                 cursor->map == 0)) {
  ------------------
  |  Branch (562:18): [True: 14, False: 441]
  ------------------
  563|     14|                json_debug_trace((1, "Saw quoted value when expecting"
  ------------------
  |  |  110|     14|#define json_debug_trace(args) (void) json_trace args
  ------------------
  564|     14|                                  " non-string.\n"));
  565|     14|                return JSON_ERR_QNONSTRING;
  ------------------
  |  |  170|     14|#define JSON_ERR_QNONSTRING    19      // quoted value when expecting nonstring
  ------------------
  566|     14|            }
  567|  36.7k|            if (!value_quoted &&
  ------------------
  |  Branch (567:17): [True: 28.0k, False: 8.72k]
  ------------------
  568|  36.7k|                (cursor->type == t_string ||
  ------------------
  |  Branch (568:18): [True: 19, False: 28.0k]
  ------------------
  569|  28.0k|                 cursor->type == t_check ||
  ------------------
  |  Branch (569:18): [True: 30, False: 27.9k]
  ------------------
  570|  28.0k|                 cursor->type == t_time ||
  ------------------
  |  Branch (570:18): [True: 8, False: 27.9k]
  ------------------
  571|  28.0k|                 cursor->map != 0)) {
  ------------------
  |  Branch (571:18): [True: 7, False: 27.9k]
  ------------------
  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.7k|            if (cursor->map != 0) {
  ------------------
  |  Branch (576:17): [True: 441, False: 36.2k]
  ------------------
  577|    892|                for (mp = cursor->map; mp->name != NULL; mp++)
  ------------------
  |  Branch (577:40): [True: 825, False: 67]
  ------------------
  578|    825|                    if (strcmp(mp->name, valbuf) == 0) {
  ------------------
  |  Branch (578:25): [True: 374, False: 451]
  ------------------
  579|    374|                        goto foundit;
  580|    374|                    }
  581|     67|                json_debug_trace((1, "Invalid enumerated value string %s.\n",
  ------------------
  |  |  110|     67|#define json_debug_trace(args) (void) json_trace args
  ------------------
  582|     67|                                  valbuf));
  583|     67|                return JSON_ERR_BADENUM;
  ------------------
  |  |  169|     67|#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.6k|            if (cursor->type == t_check) {
  ------------------
  |  Branch (587:17): [True: 756, False: 35.8k]
  ------------------
  588|    756|                lptr = cursor->dflt.check;
  589|  35.8k|            } else {
  590|  35.8k|                lptr = json_target_address(cursor, parent, offset);
  591|  35.8k|            }
  592|  36.6k|            if (NULL != lptr) {
  ------------------
  |  Branch (592:17): [True: 20.5k, False: 16.0k]
  ------------------
  593|  20.5k|                switch (cursor->type) {
  ------------------
  |  Branch (593:25): [True: 0, False: 20.5k]
  ------------------
  594|    415|                case t_byte:
  ------------------
  |  Branch (594:17): [True: 415, False: 20.1k]
  ------------------
  595|    415|                    {
  596|    415|                        int tmp = atoi(valbuf);
  597|    415|                        lptr[0] = (char)tmp;
  598|    415|                    }
  599|    415|                    break;
  600|    820|                case t_ubyte:
  ------------------
  |  Branch (600:17): [True: 820, False: 19.7k]
  ------------------
  601|    820|                    {
  602|    820|                        int tmp = atoi(valbuf);
  603|    820|                        lptr[0] = (unsigned char)tmp;
  604|    820|                    }
  605|    820|                    break;
  606|  1.64k|                case t_integer:
  ------------------
  |  Branch (606:17): [True: 1.64k, False: 18.9k]
  ------------------
  607|  1.64k|                    {
  608|  1.64k|                        int tmp = atoi(valbuf);
  609|  1.64k|                        memcpy(lptr, &tmp, sizeof(int));
  610|  1.64k|                    }
  611|  1.64k|                    break;
  612|  1.17k|                case t_uinteger:
  ------------------
  |  Branch (612:17): [True: 1.17k, False: 19.3k]
  ------------------
  613|  1.17k|                    {
  614|  1.17k|                        unsigned int tmp = (unsigned int)atol(valbuf);
  615|  1.17k|                        memcpy(lptr, &tmp, sizeof(unsigned int));
  616|  1.17k|                    }
  617|  1.17k|                    break;
  618|      0|                case t_longint:
  ------------------
  |  Branch (618:17): [True: 0, False: 20.5k]
  ------------------
  619|      0|                    {
  620|      0|                        long tmp = atol(valbuf);
  621|      0|                        memcpy(lptr, &tmp, sizeof(long));
  622|      0|                    }
  623|      0|                    break;
  624|    520|                case t_ulongint:
  ------------------
  |  Branch (624:17): [True: 520, False: 20.0k]
  ------------------
  625|    520|                    {
  626|    520|                        unsigned long tmp = (unsigned long)atoll(valbuf);
  627|    520|                        memcpy(lptr, &tmp, sizeof(unsigned long));
  628|    520|                    }
  629|    520|                    break;
  630|  1.67k|                case t_short:
  ------------------
  |  Branch (630:17): [True: 1.67k, False: 18.8k]
  ------------------
  631|  1.67k|                    {
  632|  1.67k|                        short tmp = atoi(valbuf);
  633|  1.67k|                        memcpy(lptr, &tmp, sizeof(short));
  634|  1.67k|                    }
  635|  1.67k|                    break;
  636|      0|                case t_ushort:
  ------------------
  |  Branch (636:17): [True: 0, False: 20.5k]
  ------------------
  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.48k|                case t_time:
  ------------------
  |  Branch (642:17): [True: 2.48k, False: 18.0k]
  ------------------
  643|  2.48k|                    {
  644|  2.48k|                        timespec_t ts_tmp = iso8601_to_timespec(valbuf);
  645|  2.48k|                        memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  646|  2.48k|                    }
  647|  2.48k|                    break;
  648|    388|                case t_timespec:
  ------------------
  |  Branch (648:17): [True: 388, False: 20.1k]
  ------------------
  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|  5.19k|                case t_real:
  ------------------
  |  Branch (658:17): [True: 5.19k, False: 15.3k]
  ------------------
  659|  5.19k|                    {
  660|  5.19k|                        double tmp = safe_atof(valbuf);
  661|  5.19k|                        if (0 != isfinite(tmp)) {
  ------------------
  |  Branch (661:29): [True: 4.18k, False: 1.01k]
  ------------------
  662|  4.18k|                            memcpy(lptr, &tmp, sizeof(double));
  663|  4.18k|                        } // else leave at .dflt
  664|  5.19k|                    }
  665|  5.19k|                    break;
  666|  1.06k|                case t_string:
  ------------------
  |  Branch (666:17): [True: 1.06k, False: 19.5k]
  ------------------
  667|  1.06k|                    if (NULL != parent &&
  ------------------
  |  Branch (667:25): [True: 390, False: 674]
  ------------------
  668|  1.06k|                        parent->element_type != t_structobject &&
  ------------------
  |  Branch (668:25): [True: 0, False: 390]
  ------------------
  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.89k|                case t_boolean:
  ------------------
  |  Branch (674:17): [True: 1.89k, False: 18.6k]
  ------------------
  675|  1.89k|                    {
  676|  1.89k|                        bool tmp = (strcmp(valbuf, "true") == 0);
  677|  1.89k|                        memcpy(lptr, &tmp, sizeof(bool));
  678|  1.89k|                    }
  679|  1.89k|                    break;
  680|    437|                case t_character:
  ------------------
  |  Branch (680:17): [True: 437, False: 20.1k]
  ------------------
  681|    437|                    if (strnlen(valbuf, 2) > 1) {
  ------------------
  |  Branch (681:25): [True: 7, False: 430]
  ------------------
  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|    430|                    } else {
  685|    430|                        lptr[0] = valbuf[0];
  686|    430|                    }
  687|    430|                    break;
  688|  2.10k|                case t_ignore:  // silences a compiler warning
  ------------------
  |  Branch (688:17): [True: 2.10k, False: 18.4k]
  ------------------
  689|  2.10k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.10k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  690|  2.10k|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (690:17): [True: 0, False: 20.5k]
  ------------------
  691|  2.10k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.10k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  692|  2.10k|                case t_structobject:
  ------------------
  |  Branch (692:17): [True: 0, False: 20.5k]
  ------------------
  693|  2.10k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.10k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  694|  2.10k|                case t_array:
  ------------------
  |  Branch (694:17): [True: 0, False: 20.5k]
  ------------------
  695|  2.10k|                    break;
  696|    756|                case t_check:
  ------------------
  |  Branch (696:17): [True: 756, False: 19.8k]
  ------------------
  697|    756|                    if (strcmp(cursor->dflt.check, valbuf) != 0) {
  ------------------
  |  Branch (697:25): [True: 180, False: 576]
  ------------------
  698|    180|                        json_debug_trace((1, "Required attribute value %s"
  ------------------
  |  |  110|    180|#define json_debug_trace(args) (void) json_trace args
  ------------------
  699|    180|                                          " not present.\n",
  700|    180|                                          cursor->dflt.check));
  701|       |                        // don't update end here, leave at start of attribute
  702|    180|                        return JSON_ERR_CHECKFAIL;
  ------------------
  |  |  167|    180|#define JSON_ERR_CHECKFAIL     16      // check attribute not matched
  ------------------
  703|    180|                    }
  704|    576|                    break;
  705|  20.5k|                }
  706|  20.5k|            }
  707|  36.4k|            FALLTHROUGH
  ------------------
  |  |   55|  36.4k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  708|  37.4k|        case post_element:
  ------------------
  |  Branch (708:9): [True: 1.03k, False: 503k]
  ------------------
  709|  37.4k|            if (isspace((unsigned char) *cp)) {
  710|    233|                continue;
  711|    233|            }
  712|  37.2k|            if (*cp == ',') {
  ------------------
  |  Branch (712:17): [True: 31.4k, False: 5.79k]
  ------------------
  713|  31.4k|                state = await_attr;
  714|  31.4k|            } else if (*cp == '}') {
  ------------------
  |  Branch (714:24): [True: 5.17k, False: 620]
  ------------------
  715|  5.17k|                ++cp;
  716|  5.17k|                goto good_parse;
  717|  5.17k|            } else {
  718|    620|                json_debug_trace((1, "Garbage while expecting comma or }\n"));
  ------------------
  |  |  110|    620|#define json_debug_trace(args) (void) json_trace args
  ------------------
  719|    620|                if (NULL != end) {
  ------------------
  |  Branch (719:21): [True: 19, False: 601]
  ------------------
  720|     19|                    *end = cp;
  721|     19|                }
  722|    620|                return JSON_ERR_BADTRAIL;
  ------------------
  |  |  160|    620|#define JSON_ERR_BADTRAIL       9      // garbage expecting comma or } or ]
  ------------------
  723|    620|            }
  724|  31.4k|            break;
  725|   504k|        }
  726|   504k|    }
  727|  2.55k|    if (state == init) {
  ------------------
  |  Branch (727:9): [True: 42, False: 2.51k]
  ------------------
  728|     42|        json_debug_trace((1, "Input was empty or white-space only\n"));
  ------------------
  |  |  110|     42|#define json_debug_trace(args) (void) json_trace args
  ------------------
  729|     42|        return JSON_ERR_EMPTY;
  ------------------
  |  |  176|     42|#define JSON_ERR_EMPTY         25      // input was empty or white-space only
  ------------------
  730|     42|    }
  731|       |
  732|  7.69k|  good_parse:
  733|       |    // in case there's another object following, consume trailing WS
  734|  7.69k|    while (isspace((unsigned char)*cp)) {
  735|    417|        ++cp;
  736|    417|    }
  737|  7.69k|    if (NULL != end) {
  ------------------
  |  Branch (737:9): [True: 4.81k, False: 2.88k]
  ------------------
  738|  4.81k|        *end = cp;
  739|  4.81k|    }
  740|  7.69k|    json_debug_trace((1, "JSON parse ends.\n"));
  ------------------
  |  |  110|  7.69k|#define json_debug_trace(args) (void) json_trace args
  ------------------
  741|  7.69k|    return 0;
  742|  2.55k|}
json.c:json_target_address:
  115|   172k|{
  116|   172k|    char *targetaddr = NULL;
  117|   172k|    if (NULL == parent ||
  ------------------
  |  Branch (117:9): [True: 95.4k, False: 77.4k]
  ------------------
  118|   172k|        parent->element_type != t_structobject) {
  ------------------
  |  Branch (118:9): [True: 0, False: 77.4k]
  ------------------
  119|       |        // ordinary case - use the address in the cursor structure
  120|  95.4k|        switch (cursor->type) {
  121|      0|        case t_byte:
  ------------------
  |  Branch (121:9): [True: 0, False: 95.4k]
  ------------------
  122|      0|            targetaddr = (char *)&cursor->addr.byte[offset];
  123|      0|            break;
  124|    863|        case t_ubyte:
  ------------------
  |  Branch (124:9): [True: 863, False: 94.6k]
  ------------------
  125|    863|            targetaddr = (char *)&cursor->addr.ubyte[offset];
  126|    863|            break;
  127|  20.3k|        case t_ignore:
  ------------------
  |  Branch (127:9): [True: 20.3k, False: 75.1k]
  ------------------
  128|  20.3k|            targetaddr = NULL;
  129|  20.3k|            break;
  130|  16.5k|        case t_integer:
  ------------------
  |  Branch (130:9): [True: 16.5k, False: 78.9k]
  ------------------
  131|  16.5k|            targetaddr = (char *)&cursor->addr.integer[offset];
  132|  16.5k|            break;
  133|  6.20k|        case t_uinteger:
  ------------------
  |  Branch (133:9): [True: 6.20k, False: 89.2k]
  ------------------
  134|  6.20k|            targetaddr = (char *)&cursor->addr.uinteger[offset];
  135|  6.20k|            break;
  136|      0|        case t_longint:
  ------------------
  |  Branch (136:9): [True: 0, False: 95.4k]
  ------------------
  137|      0|            targetaddr = (char *)&cursor->addr.longint[offset];
  138|      0|            break;
  139|    628|        case t_ulongint:
  ------------------
  |  Branch (139:9): [True: 628, False: 94.8k]
  ------------------
  140|    628|            targetaddr = (char *)&cursor->addr.ulongint[offset];
  141|    628|            break;
  142|      0|        case t_short:
  ------------------
  |  Branch (142:9): [True: 0, False: 95.4k]
  ------------------
  143|      0|            targetaddr = (char *)&cursor->addr.shortint[offset];
  144|      0|            break;
  145|      0|        case t_ushort:
  ------------------
  |  Branch (145:9): [True: 0, False: 95.4k]
  ------------------
  146|      0|            targetaddr = (char *)&cursor->addr.ushortint[offset];
  147|      0|            break;
  148|  3.49k|        case t_time:
  ------------------
  |  Branch (148:9): [True: 3.49k, False: 92.0k]
  ------------------
  149|  3.49k|            targetaddr = (char *)&cursor->addr.ts[offset];
  150|  3.49k|            break;
  151|      0|        case t_timespec:
  ------------------
  |  Branch (151:9): [True: 0, False: 95.4k]
  ------------------
  152|      0|            targetaddr = (char *)&cursor->addr.ts[offset];
  153|      0|            break;
  154|  32.7k|        case t_real:
  ------------------
  |  Branch (154:9): [True: 32.7k, False: 62.7k]
  ------------------
  155|  32.7k|            targetaddr = (char *)&cursor->addr.real[offset];
  156|  32.7k|            break;
  157|  6.69k|        case t_string:
  ------------------
  |  Branch (157:9): [True: 6.69k, False: 88.8k]
  ------------------
  158|  6.69k|            targetaddr = cursor->addr.string;
  159|  6.69k|            break;
  160|  1.67k|        case t_boolean:
  ------------------
  |  Branch (160:9): [True: 1.67k, False: 93.8k]
  ------------------
  161|  1.67k|            targetaddr = (char *)&cursor->addr.boolean[offset];
  162|  1.67k|            break;
  163|    888|        case t_character:
  ------------------
  |  Branch (163:9): [True: 888, False: 94.6k]
  ------------------
  164|    888|            targetaddr = (char *)&cursor->addr.character[offset];
  165|    888|            break;
  166|  5.49k|        default:
  ------------------
  |  Branch (166:9): [True: 5.49k, False: 90.0k]
  ------------------
  167|  5.49k|            targetaddr = NULL;
  168|  5.49k|            break;
  169|  95.4k|        }
  170|  95.4k|    } else {
  171|       |        // tricky case - hacking a member in an array of structures
  172|  77.4k|        targetaddr =
  173|  77.4k|            parent->arr.objects.base + (offset * parent->arr.objects.stride) +
  174|  77.4k|            cursor->addr.offset;
  175|  77.4k|    }
  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:
  669|  2.75k|{
  670|  2.75k|    int real_sec = 0, real_nsec = 0, clock_sec = 0, clock_nsec = 0;
  671|  2.75k|    const struct json_attr_t json_attrs_toff[] = {
  672|       |        // *INDENT-OFF*
  673|  2.75k|        {"class",     t_check,   .dflt.check = "TOFF"},
  674|  2.75k|        {"device",    t_string,  .addr.string = gpsdata->dev.path,
  675|  2.75k|                                 .len = sizeof(gpsdata->dev.path)},
  676|  2.75k|        {"real_sec",  t_integer, .addr.integer = &real_sec,
  677|  2.75k|                                 .dflt.integer = 0},
  678|  2.75k|        {"real_nsec", t_integer, .addr.integer = &real_nsec,
  679|  2.75k|                                 .dflt.integer = 0},
  680|  2.75k|        {"clock_sec", t_integer, .addr.integer = &clock_sec,
  681|  2.75k|                                 .dflt.integer = 0},
  682|  2.75k|        {"clock_nsec",t_integer, .addr.integer = &clock_nsec,
  683|  2.75k|                                 .dflt.integer = 0},
  684|       |        // ignore unknown keys, for cross-version compatibility
  685|  2.75k|        {"", t_ignore},
  686|  2.75k|        {NULL},
  687|       |        // *INDENT-ON*
  688|  2.75k|    };
  689|  2.75k|    int status;
  690|       |
  691|  2.75k|    memset(&gpsdata->toff, 0, sizeof(gpsdata->toff));
  692|  2.75k|    status = json_read_object(buf, json_attrs_toff, endptr);
  693|  2.75k|    gpsdata->toff.real.tv_sec = (time_t)real_sec;
  694|  2.75k|    gpsdata->toff.real.tv_nsec = (long)real_nsec;
  695|  2.75k|    gpsdata->toff.clock.tv_sec = (time_t)clock_sec;
  696|  2.75k|    gpsdata->toff.clock.tv_nsec = (long)clock_nsec;
  697|  2.75k|    if (status != 0)
  ------------------
  |  Branch (697:9): [True: 1.03k, False: 1.71k]
  ------------------
  698|  1.03k|        return status;
  699|       |
  700|  1.71k|    return status;
  701|  2.75k|}
json_pps_read:
  705|     37|{
  706|     37|    int real_sec = 0, real_nsec = 0, clock_sec = 0, clock_nsec = 0, precision=0;
  707|     37|    int qErr = 0;
  708|       |
  709|     37|    const struct json_attr_t json_attrs_pps[] = {
  710|       |        // *INDENT-OFF*
  711|     37|        {"class",     t_check,   .dflt.check = "PPS"},
  712|     37|        {"device",    t_string,  .addr.string = gpsdata->dev.path,
  713|     37|                                 .len = sizeof(gpsdata->dev.path)},
  714|     37|        {"real_sec",  t_integer, .addr.integer = &real_sec,
  715|     37|                                 .dflt.integer = 0},
  716|     37|        {"real_nsec", t_integer, .addr.integer = &real_nsec,
  717|     37|                                 .dflt.integer = 0},
  718|     37|        {"clock_sec", t_integer, .addr.integer = &clock_sec,
  719|     37|                                 .dflt.integer = 0},
  720|     37|        {"clock_nsec",t_integer, .addr.integer = &clock_nsec,
  721|     37|                                 .dflt.integer = 0},
  722|     37|        {"precision", t_integer, .addr.integer = &precision,
  723|     37|                                 .dflt.integer = 0},
  724|     37|        {"qErr", t_integer, .addr.integer = &qErr,
  725|     37|                                 .dflt.integer = 0},
  726|       |        // ignore unknown keys, for cross-version compatibility
  727|     37|        {"", t_ignore},
  728|     37|        {NULL},
  729|       |        // *INDENT-ON*
  730|     37|    };
  731|     37|    int status;
  732|       |
  733|     37|    memset(&gpsdata->pps, 0, sizeof(gpsdata->pps));
  734|     37|    status = json_read_object(buf, json_attrs_pps, endptr);
  735|       |
  736|       |    // This is good until GPS are more than nanosec accurate
  737|     37|    gpsdata->pps.real.tv_sec = (time_t)real_sec;
  738|     37|    gpsdata->pps.real.tv_nsec = (long)real_nsec;
  739|     37|    gpsdata->pps.clock.tv_sec = (time_t)clock_sec;
  740|     37|    gpsdata->pps.clock.tv_nsec = (long)clock_nsec;
  741|       |    // hope qErr fits in int
  742|     37|    gpsdata->qErr = (long)qErr;
  743|       |
  744|       |    // FIXME: precision is currently parsed but discarded
  745|     37|    return status;
  746|     37|}
json_oscillator_read:
  750|     16|{
  751|     16|    bool running = false, reference = false, disciplined = false;
  752|     16|    int delta = 0;
  753|     16|    const struct json_attr_t json_attrs_osc[] = {
  754|       |        // *INDENT-OFF*
  755|     16|        {"class",       t_check,   .dflt.check = "OSC"},
  756|     16|        {"device",      t_string,  .addr.string = gpsdata->dev.path,
  757|     16|                                   .len = sizeof(gpsdata->dev.path)},
  758|     16|        {"running",     t_boolean, .addr.boolean = &running,
  759|     16|                                   .dflt.boolean = false},
  760|     16|        {"reference",   t_boolean, .addr.boolean = &reference,
  761|     16|                                   .dflt.boolean = false},
  762|     16|        {"disciplined", t_boolean, .addr.boolean = &disciplined,
  763|     16|                                   .dflt.boolean = false},
  764|     16|        {"delta",       t_integer, .addr.integer = &delta,
  765|     16|                                   .dflt.integer = 0},
  766|       |        // ignore unknown keys, for cross-version compatibility
  767|     16|        {"", t_ignore},
  768|     16|        {NULL},
  769|       |        // *INDENT-ON*
  770|     16|    };
  771|     16|    int status;
  772|       |
  773|     16|    memset(&gpsdata->osc, 0, sizeof(gpsdata->osc));
  774|     16|    status = json_read_object(buf, json_attrs_osc, endptr);
  775|       |
  776|     16|    gpsdata->osc.running = running;
  777|     16|    gpsdata->osc.reference = reference;
  778|     16|    gpsdata->osc.disciplined = disciplined;
  779|     16|    gpsdata->osc.delta = delta;
  780|       |
  781|     16|    return status;
  782|     16|}
libgps_json_unpack:
  794|  2.72k|{
  795|  2.72k|    int status;
  796|  2.72k|    char *classtag = strstr(buf, "\"class\":");
  797|       |
  798|  2.72k|    if (NULL == classtag) {
  ------------------
  |  Branch (798:9): [True: 394, False: 2.33k]
  ------------------
  799|    394|        return -1;
  800|    394|    }
  801|       |
  802|  2.33k|    if (str_starts_with(classtag, "\"class\":\"TPV\"")) {
  ------------------
  |  Branch (802:9): [True: 385, False: 1.94k]
  ------------------
  803|    385|        status = json_tpv_read(buf, gpsdata, end);
  804|    385|        gpsdata->set = STATUS_SET;
  ------------------
  |  | 2840|    385|#define STATUS_SET      (1llu<<9)
  ------------------
  805|    385|        if (0 != gpsdata->fix.time.tv_sec) {
  ------------------
  |  Branch (805:13): [True: 233, False: 152]
  ------------------
  806|    233|            gpsdata->set |= TIME_SET;
  ------------------
  |  | 2833|    233|#define TIME_SET        (1llu<<2)
  ------------------
  807|    233|        }
  808|    385|        if (0 != isfinite(gpsdata->fix.ept)) {
  ------------------
  |  Branch (808:13): [True: 1, False: 384]
  ------------------
  809|      1|            gpsdata->set |= TIMERR_SET;
  ------------------
  |  | 2834|      1|#define TIMERR_SET      (1llu<<3)
  ------------------
  810|      1|        }
  811|    385|        if (0 != isfinite(gpsdata->fix.longitude)) {
  ------------------
  |  Branch (811:13): [True: 1, False: 384]
  ------------------
  812|      1|            gpsdata->set |= LATLON_SET;
  ------------------
  |  | 2835|      1|#define LATLON_SET      (1llu<<4)
  ------------------
  813|      1|        }
  814|    385|        if (0 != isfinite(gpsdata->fix.altitude) ||
  ------------------
  |  Branch (814:13): [True: 1, False: 384]
  ------------------
  815|    385|            0 != isfinite(gpsdata->fix.altHAE) ||
  ------------------
  |  Branch (815:13): [True: 1, False: 383]
  ------------------
  816|    385|            0 != isfinite(gpsdata->fix.depth) ||
  ------------------
  |  Branch (816:13): [True: 1, False: 382]
  ------------------
  817|    385|            0 != isfinite(gpsdata->fix.altMSL)) {
  ------------------
  |  Branch (817:13): [True: 1, False: 381]
  ------------------
  818|      4|            gpsdata->set |= ALTITUDE_SET;
  ------------------
  |  | 2836|      4|#define ALTITUDE_SET    (1llu<<5)
  ------------------
  819|      4|        }
  820|    385|        if (0 != isfinite(gpsdata->fix.epx) &&
  ------------------
  |  Branch (820:13): [True: 3, False: 382]
  ------------------
  821|    385|            0 != isfinite(gpsdata->fix.epy)) {
  ------------------
  |  Branch (821:13): [True: 2, False: 1]
  ------------------
  822|      2|            gpsdata->set |= HERR_SET;
  ------------------
  |  | 2843|      2|#define HERR_SET        (1llu<<12)
  ------------------
  823|      2|        }
  824|    385|        if (0 != isfinite(gpsdata->fix.epv)) {
  ------------------
  |  Branch (824:13): [True: 1, False: 384]
  ------------------
  825|      1|            gpsdata->set |= VERR_SET;
  ------------------
  |  | 2844|      1|#define VERR_SET        (1llu<<13)
  ------------------
  826|      1|        }
  827|    385|        if (0 != isfinite(gpsdata->fix.track)) {
  ------------------
  |  Branch (827:13): [True: 1, False: 384]
  ------------------
  828|      1|            gpsdata->set |= TRACK_SET;
  ------------------
  |  | 2838|      1|#define TRACK_SET       (1llu<<7)
  ------------------
  829|      1|        }
  830|    385|        if (0 != isfinite(gpsdata->fix.magnetic_track) ||
  ------------------
  |  Branch (830:13): [True: 1, False: 384]
  ------------------
  831|    385|            0 != isfinite(gpsdata->fix.magnetic_var)) {
  ------------------
  |  Branch (831:13): [True: 1, False: 383]
  ------------------
  832|      2|            gpsdata->set |= MAGNETIC_TRACK_SET;
  ------------------
  |  | 2869|      2|#define MAGNETIC_TRACK_SET (1llu<<38)
  ------------------
  833|      2|        }
  834|    385|        if (0 != isfinite(gpsdata->fix.speed)) {
  ------------------
  |  Branch (834:13): [True: 1, False: 384]
  ------------------
  835|      1|            gpsdata->set |= SPEED_SET;
  ------------------
  |  | 2837|      1|#define SPEED_SET       (1llu<<6)
  ------------------
  836|      1|        }
  837|    385|        if (0 != isfinite(gpsdata->fix.climb)) {
  ------------------
  |  Branch (837:13): [True: 1, False: 384]
  ------------------
  838|      1|            gpsdata->set |= CLIMB_SET;
  ------------------
  |  | 2839|      1|#define CLIMB_SET       (1llu<<8)
  ------------------
  839|      1|        }
  840|    385|        if (0 != isfinite(gpsdata->fix.epd)) {
  ------------------
  |  Branch (840:13): [True: 1, False: 384]
  ------------------
  841|      1|            gpsdata->set |= TRACKERR_SET;
  ------------------
  |  | 2848|      1|#define TRACKERR_SET    (1llu<<17)
  ------------------
  842|      1|        }
  843|    385|        if (0 != isfinite(gpsdata->fix.eps)) {
  ------------------
  |  Branch (843:13): [True: 1, False: 384]
  ------------------
  844|      1|            gpsdata->set |= SPEEDERR_SET;
  ------------------
  |  | 2847|      1|#define SPEEDERR_SET    (1llu<<16)
  ------------------
  845|      1|        }
  846|    385|        if (0 != isfinite(gpsdata->fix.epc)) {
  ------------------
  |  Branch (846:13): [True: 1, False: 384]
  ------------------
  847|      1|            gpsdata->set |= CLIMBERR_SET;
  ------------------
  |  | 2849|      1|#define CLIMBERR_SET    (1llu<<18)
  ------------------
  848|      1|        }
  849|    385|        if (MODE_NOT_SEEN != gpsdata->fix.mode) {
  ------------------
  |  |  196|    385|#define MODE_NOT_SEEN   0       // mode update not seen yet
  ------------------
  |  Branch (849:13): [True: 56, False: 329]
  ------------------
  850|     56|            gpsdata->set |= MODE_SET;
  ------------------
  |  | 2841|     56|#define MODE_SET        (1llu<<10)
  ------------------
  851|     56|        }
  852|    385|        if (0 != isfinite(gpsdata->fix.wanglem) ||
  ------------------
  |  Branch (852:13): [True: 1, False: 384]
  ------------------
  853|    385|            0 != isfinite(gpsdata->fix.wangler) ||
  ------------------
  |  Branch (853:13): [True: 1, False: 383]
  ------------------
  854|    385|            0 != isfinite(gpsdata->fix.wanglet) ||
  ------------------
  |  Branch (854:13): [True: 1, False: 382]
  ------------------
  855|    385|            0 != isfinite(gpsdata->fix.wspeedr) ||
  ------------------
  |  Branch (855:13): [True: 1, False: 381]
  ------------------
  856|    385|            0 != isfinite(gpsdata->fix.wspeedt)) {
  ------------------
  |  Branch (856:13): [True: 1, False: 380]
  ------------------
  857|      5|            gpsdata->set |= NAVDATA_SET;
  ------------------
  |  | 2865|      5|#define NAVDATA_SET     (1llu<<34)
  ------------------
  858|      5|        }
  859|    385|        if (0 != isfinite(gpsdata->fix.NED.relPosN) ||
  ------------------
  |  Branch (859:13): [True: 1, False: 384]
  ------------------
  860|    385|            0 != isfinite(gpsdata->fix.NED.relPosE) ||
  ------------------
  |  Branch (860:13): [True: 1, False: 383]
  ------------------
  861|    385|            0 != isfinite(gpsdata->fix.NED.relPosD) ||
  ------------------
  |  Branch (861:13): [True: 1, False: 382]
  ------------------
  862|    385|            0 != isfinite(gpsdata->fix.NED.relPosH) ||
  ------------------
  |  Branch (862:13): [True: 1, False: 381]
  ------------------
  863|    385|            0 != isfinite(gpsdata->fix.NED.relPosL) ||
  ------------------
  |  Branch (863:13): [True: 1, False: 380]
  ------------------
  864|    385|            0 != isfinite(gpsdata->fix.NED.velN) ||
  ------------------
  |  Branch (864:13): [True: 1, False: 379]
  ------------------
  865|    385|            0 != isfinite(gpsdata->fix.NED.velE) ||
  ------------------
  |  Branch (865:13): [True: 1, False: 378]
  ------------------
  866|    385|            0 != isfinite(gpsdata->fix.NED.velD)) {
  ------------------
  |  Branch (866:13): [True: 1, False: 377]
  ------------------
  867|      8|            gpsdata->set |= NED_SET;
  ------------------
  |  | 2871|      8|#define NED_SET         (1llu<<40)
  ------------------
  868|      8|        }
  869|    385|        if ((0 != isfinite(gpsdata->fix.ecef.x)) &&
  ------------------
  |  Branch (869:13): [True: 3, False: 382]
  ------------------
  870|    385|            (0 != isfinite(gpsdata->fix.ecef.y)) &&
  ------------------
  |  Branch (870:13): [True: 2, False: 1]
  ------------------
  871|    385|            (0 != isfinite(gpsdata->fix.ecef.z))) {
  ------------------
  |  Branch (871:13): [True: 1, False: 1]
  ------------------
  872|       |            // All, or none.  Clients can just do their own isfinite()s
  873|      1|            gpsdata->set |= ECEF_SET;
  ------------------
  |  | 2867|      1|#define ECEF_SET        (1llu<<36)
  ------------------
  874|      1|        }
  875|    385|        if ((0 != isfinite(gpsdata->fix.ecef.vx)) &&
  ------------------
  |  Branch (875:13): [True: 3, False: 382]
  ------------------
  876|    385|            (0 != isfinite(gpsdata->fix.ecef.vy)) &&
  ------------------
  |  Branch (876:13): [True: 2, False: 1]
  ------------------
  877|    385|            (0 != isfinite(gpsdata->fix.ecef.vz))) {
  ------------------
  |  Branch (877:13): [True: 1, False: 1]
  ------------------
  878|       |            // All, or none.  Clients can just do their own isfinite()s
  879|      1|            gpsdata->set |= VECEF_SET;
  ------------------
  |  | 2868|      1|#define VECEF_SET       (1llu<<37)
  ------------------
  880|      1|        }
  881|    385|        return FILTER(status);
  ------------------
  |  |  789|    385|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    385|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 385]
  |  |  ------------------
  ------------------
  882|    385|    }
  883|  1.94k|    if (str_starts_with(classtag, "\"class\":\"GST\"")) {
  ------------------
  |  Branch (883:9): [True: 332, False: 1.61k]
  ------------------
  884|    332|        status = json_noise_read(buf, gpsdata, end);
  885|    332|        if (PASS(status)) {
  ------------------
  |  |  788|    332|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     20|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 312, False: 20]
  |  |  |  Branch (788:32): [True: 0, False: 20]
  |  |  ------------------
  ------------------
  886|    312|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|    312|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|    312|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|    312|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|    312|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|    312|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|    312|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|    312|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|    312|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|    312|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|    312|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|    312|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|    312|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|    312|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|    312|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|    312|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  887|    312|            gpsdata->set |= GST_SET;
  ------------------
  |  | 2858|    312|#define GST_SET         (1llu<<27)
  ------------------
  888|    312|        }
  889|    332|        return FILTER(status);
  ------------------
  |  |  789|    332|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    332|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 332]
  |  |  ------------------
  ------------------
  890|    332|    }
  891|  1.61k|    if (str_starts_with(classtag, "\"class\":\"SKY\"")) {
  ------------------
  |  Branch (891:9): [True: 172, False: 1.44k]
  ------------------
  892|    172|        status = json_sky_read(buf, gpsdata, end);
  893|    172|        return FILTER(status);
  ------------------
  |  |  789|    172|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    172|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 172]
  |  |  ------------------
  ------------------
  894|    172|    }
  895|  1.44k|    if (str_starts_with(classtag, "\"class\":\"ATT\"")) {
  ------------------
  |  Branch (895:9): [True: 61, False: 1.38k]
  ------------------
  896|     61|        status = json_att_read(buf, gpsdata, end);
  897|     61|        if (PASS(status)) {
  ------------------
  |  |  788|     61|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     30|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 31, False: 30]
  |  |  |  Branch (788:32): [True: 0, False: 30]
  |  |  ------------------
  ------------------
  898|     31|            gpsdata->set |= ATTITUDE_SET;
  ------------------
  |  | 2845|     31|#define ATTITUDE_SET    (1llu<<14)
  ------------------
  899|     31|        }
  900|     61|        return FILTER(status);
  ------------------
  |  |  789|     61|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     61|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 61]
  |  |  ------------------
  ------------------
  901|     61|    }
  902|  1.38k|    if (str_starts_with(classtag, "\"class\":\"IMU\"")) {
  ------------------
  |  Branch (902:9): [True: 47, False: 1.33k]
  ------------------
  903|     47|        status = json_imu_read(buf, gpsdata, end);
  904|     47|        if (PASS(status)) {
  ------------------
  |  |  788|     47|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     34|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 13, False: 34]
  |  |  |  Branch (788:32): [True: 0, False: 34]
  |  |  ------------------
  ------------------
  905|     13|            gpsdata->set |= IMU_SET;
  ------------------
  |  | 2874|     13|#define IMU_SET         (1llu<<43)
  ------------------
  906|     13|        }
  907|     47|        return FILTER(status);
  ------------------
  |  |  789|     47|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     47|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 47]
  |  |  ------------------
  ------------------
  908|     47|    }
  909|  1.33k|    if (str_starts_with(classtag, "\"class\":\"DEVICES\"")) {
  ------------------
  |  Branch (909:9): [True: 51, False: 1.28k]
  ------------------
  910|     51|        status = json_devicelist_read(buf, gpsdata, end);
  911|     51|        if (PASS(status)) {
  ------------------
  |  |  788|     51|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     49|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 2, False: 49]
  |  |  |  Branch (788:32): [True: 0, False: 49]
  |  |  ------------------
  ------------------
  912|      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)
  |  |  ------------------
  ------------------
  913|      2|            gpsdata->set |= DEVICELIST_SET;
  ------------------
  |  | 2851|      2|#define DEVICELIST_SET  (1llu<<20)
  ------------------
  914|      2|        }
  915|     51|        return FILTER(status);
  ------------------
  |  |  789|     51|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     51|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 51]
  |  |  ------------------
  ------------------
  916|     51|    }
  917|  1.28k|    if (str_starts_with(classtag, "\"class\":\"DEVICE\"")) {
  ------------------
  |  Branch (917:9): [True: 19, False: 1.26k]
  ------------------
  918|     19|        status = json_device_read(buf, &gpsdata->dev, end);
  919|     19|        if (PASS(status))
  ------------------
  |  |  788|     19|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     15|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 4, False: 15]
  |  |  |  Branch (788:32): [True: 0, False: 15]
  |  |  ------------------
  ------------------
  920|      4|            gpsdata->set |= DEVICE_SET;
  ------------------
  |  | 2850|      4|#define DEVICE_SET      (1llu<<19)
  ------------------
  921|     19|        return FILTER(status);
  ------------------
  |  |  789|     19|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     19|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 19]
  |  |  ------------------
  ------------------
  922|     19|    }
  923|  1.26k|    if (str_starts_with(classtag, "\"class\":\"WATCH\"")) {
  ------------------
  |  Branch (923:9): [True: 52, False: 1.21k]
  ------------------
  924|     52|        status = json_watch_read(buf, &gpsdata->policy, end);
  925|     52|        if (PASS(status)) {
  ------------------
  |  |  788|     52|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|      6|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 46, False: 6]
  |  |  |  Branch (788:32): [True: 0, False: 6]
  |  |  ------------------
  ------------------
  926|     46|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     46|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     46|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     46|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     46|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     46|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     46|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     46|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     46|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     46|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     46|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     46|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     46|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     46|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     46|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     46|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  927|     46|            gpsdata->set |= POLICY_SET;
  ------------------
  |  | 2860|     46|#define POLICY_SET      (1llu<<29)
  ------------------
  928|     46|        }
  929|     52|        return FILTER(status);
  ------------------
  |  |  789|     52|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     52|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 52]
  |  |  ------------------
  ------------------
  930|     52|    }
  931|  1.21k|    if (str_starts_with(classtag, "\"class\":\"VERSION\"")) {
  ------------------
  |  Branch (931:9): [True: 13, False: 1.20k]
  ------------------
  932|     13|        status = json_version_read(buf, gpsdata, end);
  933|     13|        if (status ==  0) {
  ------------------
  |  Branch (933:13): [True: 2, False: 11]
  ------------------
  934|      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)
  |  |  ------------------
  ------------------
  935|      2|            gpsdata->set |= VERSION_SET;
  ------------------
  |  | 2859|      2|#define VERSION_SET     (1llu<<28)
  ------------------
  936|      2|        }
  937|     13|        return FILTER(status);
  ------------------
  |  |  789|     13|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     13|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 13]
  |  |  ------------------
  ------------------
  938|     13|    }
  939|  1.20k|    if (str_starts_with(classtag, "\"class\":\"RTCM2\"")) {
  ------------------
  |  Branch (939:9): [True: 287, False: 914]
  ------------------
  940|    287|        status = json_rtcm2_read(buf,
  941|    287|                                 gpsdata->dev.path, sizeof(gpsdata->dev.path),
  942|    287|                                 &gpsdata->rtcm2, end);
  943|    287|        if (PASS(status)) {
  ------------------
  |  |  788|    287|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|    211|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 76, False: 211]
  |  |  |  Branch (788:32): [True: 8, False: 203]
  |  |  ------------------
  ------------------
  944|     84|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     84|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     84|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     84|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     84|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     84|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     84|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     84|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     84|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     84|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     84|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     84|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     84|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     84|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     84|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     84|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  945|     84|            gpsdata->set |= RTCM2_SET;
  ------------------
  |  | 2853|     84|#define RTCM2_SET       (1llu<<22)
  ------------------
  946|     84|        }
  947|    287|        return FILTER(status);
  ------------------
  |  |  789|    287|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    287|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 8, False: 279]
  |  |  ------------------
  ------------------
  948|    287|    }
  949|    914|    if (str_starts_with(classtag, "\"class\":\"RTCM3\"")) {
  ------------------
  |  Branch (949:9): [True: 137, False: 777]
  ------------------
  950|    137|        status = json_rtcm3_read(buf,
  951|    137|                                 gpsdata->dev.path, sizeof(gpsdata->dev.path),
  952|    137|                                 &gpsdata->rtcm3, end);
  953|    137|        if (PASS(status)) {
  ------------------
  |  |  788|    137|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|    111|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 26, False: 111]
  |  |  |  Branch (788:32): [True: 4, False: 107]
  |  |  ------------------
  ------------------
  954|     30|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     30|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     30|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     30|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     30|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     30|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     30|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     30|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     30|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     30|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     30|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     30|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     30|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     30|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     30|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     30|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  955|     30|            gpsdata->set |= RTCM3_SET;
  ------------------
  |  | 2854|     30|#define RTCM3_SET       (1llu<<23)
  ------------------
  956|     30|        }
  957|    137|        return FILTER(status);
  ------------------
  |  |  789|    137|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    137|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 4, False: 133]
  |  |  ------------------
  ------------------
  958|    137|    }
  959|    777|#ifdef AIVDM_ENABLE
  960|    777|    if (str_starts_with(classtag, "\"class\":\"AIS\"")) {
  ------------------
  |  Branch (960:9): [True: 337, False: 440]
  ------------------
  961|    337|        status = json_ais_read(buf,
  962|    337|                               gpsdata->dev.path, sizeof(gpsdata->dev.path),
  963|    337|                               &gpsdata->ais, end);
  964|    337|        if (PASS(status)) {
  ------------------
  |  |  788|    337|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|    179|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 158, False: 179]
  |  |  |  Branch (788:32): [True: 31, False: 148]
  |  |  ------------------
  ------------------
  965|    189|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|    189|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|    189|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|    189|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|    189|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|    189|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|    189|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|    189|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|    189|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|    189|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|    189|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|    189|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|    189|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|    189|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|    189|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|    189|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  966|    189|            gpsdata->set |= AIS_SET;
  ------------------
  |  | 2855|    189|#define AIS_SET         (1llu<<24)
  ------------------
  967|    189|        }
  968|    337|        return FILTER(status);
  ------------------
  |  |  789|    337|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    337|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 31, False: 306]
  |  |  ------------------
  ------------------
  969|    337|    }
  970|    440|#endif  // AIVDM_ENABLE
  971|    440|    if (str_starts_with(classtag, "\"class\":\"ERROR\"")) {
  ------------------
  |  Branch (971:9): [True: 9, False: 431]
  ------------------
  972|      9|        status = json_error_read(buf, gpsdata, end);
  973|      9|        if (PASS(status)) {
  ------------------
  |  |  788|      9|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|      6|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 3, False: 6]
  |  |  |  Branch (788:32): [True: 0, False: 6]
  |  |  ------------------
  ------------------
  974|      3|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|      3|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|      3|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|      3|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|      3|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|      3|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|      3|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|      3|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|      3|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|      3|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|      3|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|      3|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|      3|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|      3|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|      3|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|      3|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  975|      3|            gpsdata->set |= ERROR_SET;
  ------------------
  |  | 2862|      3|#define ERROR_SET       (1llu<<31)
  ------------------
  976|      3|        }
  977|      9|        return FILTER(status);
  ------------------
  |  |  789|      9|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|      9|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 9]
  |  |  ------------------
  ------------------
  978|      9|    }
  979|    431|    if (str_starts_with(classtag, "\"class\":\"TOFF\"")) {
  ------------------
  |  Branch (979:9): [True: 28, False: 403]
  ------------------
  980|     28|        status = json_toff_read(buf, gpsdata, end);
  981|     28|        if (PASS(status)) {
  ------------------
  |  |  788|     28|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     14|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 14, False: 14]
  |  |  |  Branch (788:32): [True: 0, False: 14]
  |  |  ------------------
  ------------------
  982|     14|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     14|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     14|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     14|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     14|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     14|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     14|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     14|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     14|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     14|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     14|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     14|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     14|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     14|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     14|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     14|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  983|     14|            gpsdata->set |= TOFF_SET;
  ------------------
  |  | 2863|     14|#define TOFF_SET        (1llu<<32)      // not yet used
  ------------------
  984|     14|        }
  985|     28|        return FILTER(status);
  ------------------
  |  |  789|     28|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     28|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 28]
  |  |  ------------------
  ------------------
  986|     28|    }
  987|    403|    if (str_starts_with(classtag, "\"class\":\"PPS\"")) {
  ------------------
  |  Branch (987:9): [True: 37, False: 366]
  ------------------
  988|     37|        status = json_pps_read(buf, gpsdata, end);
  989|     37|        if (PASS(status)) {
  ------------------
  |  |  788|     37|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|     12|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 25, False: 12]
  |  |  |  Branch (788:32): [True: 0, False: 12]
  |  |  ------------------
  ------------------
  990|     25|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     25|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     25|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     25|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     25|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     25|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     25|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     25|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     25|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     25|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     25|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     25|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     25|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     25|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     25|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     25|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  991|     25|            gpsdata->set |= PPS_SET;
  ------------------
  |  | 2864|     25|#define PPS_SET         (1llu<<33)
  ------------------
  992|     25|        }
  993|     37|        return FILTER(status);
  ------------------
  |  |  789|     37|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     37|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 37]
  |  |  ------------------
  ------------------
  994|     37|    }
  995|    366|    if (str_starts_with(classtag, "\"class\":\"OSC\"")) {
  ------------------
  |  Branch (995:9): [True: 16, False: 350]
  ------------------
  996|     16|        status = json_oscillator_read(buf, gpsdata, end);
  997|     16|        if (PASS(status)) {
  ------------------
  |  |  788|     16|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|      6|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 10, False: 6]
  |  |  |  Branch (788:32): [True: 0, False: 6]
  |  |  ------------------
  ------------------
  998|     10|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     10|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     10|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     10|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     10|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     10|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     10|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     10|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     10|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     10|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     10|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     10|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     10|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     10|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     10|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     10|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  999|     10|            gpsdata->set |= OSCILLATOR_SET;
  ------------------
  |  | 2866|     10|#define OSCILLATOR_SET  (1llu<<35)
  ------------------
 1000|     10|        }
 1001|     16|        return FILTER(status);
  ------------------
  |  |  789|     16|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|     16|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 16]
  |  |  ------------------
  ------------------
 1002|     16|    }
 1003|    350|    if (str_starts_with(classtag, "\"class\":\"RAW\"")) {
  ------------------
  |  Branch (1003:9): [True: 131, False: 219]
  ------------------
 1004|    131|        status = json_raw_read(buf, gpsdata, end);
 1005|    131|        if (PASS(status)) {
  ------------------
  |  |  788|    131|#define PASS(n) (((n) == 0) || ((n) == JSON_ERR_BADATTR))
  |  |  ------------------
  |  |  |  |  154|    113|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (788:18): [True: 18, False: 113]
  |  |  |  Branch (788:32): [True: 0, False: 113]
  |  |  ------------------
  ------------------
 1006|     18|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2930|     18|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2855|     18|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2862|     18|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2858|     18|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2931|     18|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2861|     18|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2866|     18|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2864|     18|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2870|     18|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2932|     18|                         RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2853|     18|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2854|     18|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2857|     18|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2863|     18|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SUBFRAME_SET|TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2859|     18|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
 1007|     18|            gpsdata->set |= RAW_SET;
  ------------------
  |  | 2870|     18|#define RAW_SET         (1llu<<39)
  ------------------
 1008|     18|        }
 1009|    131|        return FILTER(status);
  ------------------
  |  |  789|    131|#define FILTER(n) ((n) == JSON_ERR_BADATTR ? 0 : n)
  |  |  ------------------
  |  |  |  |  154|    131|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (789:20): [True: 0, False: 131]
  |  |  ------------------
  ------------------
 1010|    131|    }
 1011|       |    // else, unkwown class type
 1012|    219|    return -1;
 1013|    350|}
libgps_json.c:json_tpv_read:
   36|    385|{
   37|    385|    int ret;
   38|       |
   39|    385|    const struct json_attr_t json_attrs_1[] = {
   40|       |        // *INDENT-OFF*
   41|    385|        {"class",  t_check,   .dflt.check = "TPV"},
   42|    385|        {"alt",    t_real,    .addr.real = &gpsdata->fix.altitude,
   43|    385|                                 .dflt.real = NAN}, // DEPRECATED, undefined
   44|    385|        {"altHAE", t_real,    .addr.real = &gpsdata->fix.altHAE,
   45|    385|                                 .dflt.real = NAN},
   46|    385|        {"altMSL", t_real,    .addr.real = &gpsdata->fix.altMSL,
   47|    385|                                 .dflt.real = NAN},
   48|    385|        {"ant",    t_integer, .addr.integer = &gpsdata->fix.ant_stat,
   49|    385|                                 .dflt.integer = 0},
   50|    385|        {"baseS",     t_integer,   .addr.integer = &gpsdata->fix.base.status,
   51|    385|         .dflt.integer = STATUS_UNK},     // aka zero
  ------------------
  |  |  207|    385|#define STATUS_UNK      0       // Unknown status
  ------------------
   52|    385|        {"baseE",     t_real,      .addr.real = &gpsdata->fix.base.east,
   53|    385|         .dflt.real = NAN},
   54|    385|        {"baseN",     t_real,      .addr.real = &gpsdata->fix.base.north,
   55|    385|         .dflt.real = NAN},
   56|    385|        {"baseU",     t_real,      .addr.real = &gpsdata->fix.base.up,
   57|    385|         .dflt.real = NAN},
   58|    385|        {"baseL",     t_real,      .addr.real = &gpsdata->fix.base.length,
   59|    385|         .dflt.real = NAN},
   60|    385|        {"baseC",     t_real,      .addr.real = &gpsdata->fix.base.course,
   61|    385|         .dflt.real = NAN},
   62|    385|        {"climb",  t_real,    .addr.real = &gpsdata->fix.climb,
   63|    385|                                 .dflt.real = NAN},
   64|    385|        {"datum",  t_string,  .addr.string = gpsdata->fix.datum,
   65|    385|                                 .len = sizeof(gpsdata->fix.datum)},
   66|    385|        {"device", t_string,  .addr.string = gpsdata->dev.path,
   67|    385|                                 .len = sizeof(gpsdata->dev.path)},
   68|    385|        {"depth", t_real,  .addr.real = &gpsdata->fix.depth,
   69|    385|                                 .dflt.real = NAN},
   70|    385|        {"dgpsAge", t_real, .addr.real = &gpsdata->fix.dgps_age,
   71|    385|                                 .dflt.real = NAN},
   72|    385|        {"dgpsRatio", t_real, .addr.real = &gpsdata->fix.base.ratio,
   73|    385|                                 .dflt.real = NAN},
   74|    385|        {"dgpsSta", t_integer, .addr.integer = &gpsdata->fix.dgps_station,
   75|    385|                                 .dflt.integer = -1},
   76|    385|        {"ecefx",  t_real,    .addr.real = &gpsdata->fix.ecef.x,
   77|    385|                                 .dflt.real = NAN},
   78|    385|        {"ecefy",  t_real,    .addr.real = &gpsdata->fix.ecef.y,
   79|    385|                                 .dflt.real = NAN},
   80|    385|        {"ecefz",  t_real,    .addr.real = &gpsdata->fix.ecef.z,
   81|    385|                                 .dflt.real = NAN},
   82|    385|        {"ecefvx", t_real,    .addr.real = &gpsdata->fix.ecef.vx,
   83|    385|                                 .dflt.real = NAN},
   84|    385|        {"ecefvy", t_real,    .addr.real = &gpsdata->fix.ecef.vy,
   85|    385|                                 .dflt.real = NAN},
   86|    385|        {"ecefvz", t_real,    .addr.real = &gpsdata->fix.ecef.vz,
   87|    385|                                 .dflt.real = NAN},
   88|    385|        {"ecefpAcc", t_real,  .addr.real = &gpsdata->fix.ecef.pAcc,
   89|    385|                                 .dflt.real = NAN},
   90|    385|        {"ecefvAcc", t_real,  .addr.real = &gpsdata->fix.ecef.vAcc,
   91|    385|                                 .dflt.real = NAN},
   92|    385|        {"epc",    t_real,    .addr.real = &gpsdata->fix.epc,
   93|    385|                                 .dflt.real = NAN},
   94|    385|        {"epd",    t_real,    .addr.real = &gpsdata->fix.epd,
   95|    385|                                 .dflt.real = NAN},
   96|    385|        {"eph",    t_real,    .addr.real = &gpsdata->fix.eph,
   97|    385|                                 .dflt.real = NAN},
   98|    385|        {"eps",    t_real,    .addr.real = &gpsdata->fix.eps,
   99|    385|                                 .dflt.real = NAN},
  100|    385|        {"ept",    t_real,    .addr.real = &gpsdata->fix.ept,
  101|    385|                                 .dflt.real = NAN},
  102|    385|        {"epx",    t_real,    .addr.real = &gpsdata->fix.epx,
  103|    385|                                 .dflt.real = NAN},
  104|    385|        {"epy",    t_real,    .addr.real = &gpsdata->fix.epy,
  105|    385|                                 .dflt.real = NAN},
  106|    385|        {"epv",    t_real,    .addr.real = &gpsdata->fix.epv,
  107|    385|                                 .dflt.real = NAN},
  108|    385|        {"geoidSep", t_real,  .addr.real = &gpsdata->fix.geoid_sep,
  109|    385|                                 .dflt.real = NAN},
  110|    385|        {"lat",    t_real,    .addr.real = &gpsdata->fix.latitude,
  111|    385|                                 .dflt.real = NAN},
  112|    385|        {"jam",    t_integer, .addr.integer = &gpsdata->fix.jam,
  113|    385|                                 .dflt.integer = -1},
  114|    385|        {"leapseconds",   t_integer, .addr.integer = &gpsdata->leap_seconds,
  115|    385|                                 .dflt.integer = 0},
  116|    385|        {"lon",    t_real,    .addr.real = &gpsdata->fix.longitude,
  117|    385|                                 .dflt.real = NAN},
  118|    385|        {"magtrack",  t_real,    .addr.real = &gpsdata->fix.magnetic_track,
  119|    385|                                 .dflt.real = NAN},
  120|    385|        {"magvar",  t_real,   .addr.real = &gpsdata->fix.magnetic_var,
  121|    385|                                 .dflt.real = NAN},
  122|    385|        {"mode",   t_integer, .addr.integer = &gpsdata->fix.mode,
  123|    385|                                 .dflt.integer = MODE_NOT_SEEN},
  ------------------
  |  |  196|    385|#define MODE_NOT_SEEN   0       // mode update not seen yet
  ------------------
  124|    385|        {"relD", t_real,  .addr.real = &gpsdata->fix.NED.relPosD,
  125|    385|                                 .dflt.real = NAN},
  126|    385|        {"relE", t_real,  .addr.real = &gpsdata->fix.NED.relPosE,
  127|    385|                                 .dflt.real = NAN},
  128|    385|        {"relN", t_real,  .addr.real = &gpsdata->fix.NED.relPosN,
  129|    385|                                 .dflt.real = NAN},
  130|    385|        {"relH", t_real,  .addr.real = &gpsdata->fix.NED.relPosH,
  131|    385|                                 .dflt.real = NAN},
  132|    385|        {"relL", t_real,  .addr.real = &gpsdata->fix.NED.relPosL,
  133|    385|                                 .dflt.real = NAN},
  134|    385|        {"temp",   t_real, .addr.real = &gpsdata->fix.temp,
  135|    385|                                 .dflt.real = NAN},
  136|    385|        {"time",   t_time,    .addr.ts = &gpsdata->fix.time,
  137|    385|                                 .dflt.ts = {0, 0}},
  138|    385|        {"track",  t_real,    .addr.real = &gpsdata->fix.track,
  139|    385|                                 .dflt.real = NAN},
  140|    385|        {"sep",    t_real,    .addr.real = &gpsdata->fix.sep,
  141|    385|                                 .dflt.real = NAN},
  142|    385|        {"speed",  t_real,    .addr.real = &gpsdata->fix.speed,
  143|    385|                                 .dflt.real = NAN},
  144|    385|        {"status", t_integer, .addr.integer = &gpsdata->fix.status,
  145|    385|                                 .dflt.integer = STATUS_UNK},
  ------------------
  |  |  207|    385|#define STATUS_UNK      0       // Unknown status
  ------------------
  146|    385|        {"velD", t_real,  .addr.real = &gpsdata->fix.NED.velD,
  147|    385|                                 .dflt.real = NAN},
  148|    385|        {"velE", t_real,  .addr.real = &gpsdata->fix.NED.velE,
  149|    385|                                 .dflt.real = NAN},
  150|    385|        {"velN", t_real,  .addr.real = &gpsdata->fix.NED.velN,
  151|    385|                                 .dflt.real = NAN},
  152|    385|        {"wanglem", t_real, .addr.real = &gpsdata->fix.wanglem,
  153|    385|                                 .dflt.real = NAN},
  154|    385|        {"wangler", t_real, .addr.real = &gpsdata->fix.wangler,
  155|    385|                                 .dflt.real = NAN},
  156|    385|        {"wanglet", t_real, .addr.real = &gpsdata->fix.wanglet,
  157|    385|                                 .dflt.real = NAN},
  158|    385|        {"wspeedr", t_real, .addr.real = &gpsdata->fix.wspeedr,
  159|    385|                                 .dflt.real = NAN},
  160|    385|        {"wspeedt", t_real, .addr.real = &gpsdata->fix.wspeedt,
  161|    385|                                 .dflt.real = NAN},
  162|    385|        {"wtemp", t_real, .addr.real = &gpsdata->fix.wtemp,
  163|    385|                                 .dflt.real = NAN},
  164|       |        // ignore unknown keys, for cross-version compatibility
  165|    385|        {"", t_ignore},
  166|       |
  167|    385|        {NULL},
  168|       |        // *INDENT-ON*
  169|    385|    };
  170|       |
  171|    385|    ret = json_read_object(buf, json_attrs_1, endptr);
  172|    385|    return ret;
  173|    385|}
libgps_json.c:json_noise_read:
  177|    332|{
  178|    332|    int ret;
  179|       |
  180|    332|    const struct json_attr_t json_attrs_1[] = {
  181|       |        // *INDENT-OFF*
  182|    332|        {"class",  t_check,   .dflt.check = "GST"},
  183|    332|        {"device", t_string,  .addr.string = gpsdata->dev.path,
  184|    332|                                 .len = sizeof(gpsdata->dev.path)},
  185|    332|        {"time",   t_time,    .addr.ts = &gpsdata->gst.utctime,
  186|    332|                                 .dflt.ts = {0, 0}},
  187|    332|        {"alt",    t_real,    .addr.real = &gpsdata->gst.alt_err_deviation,
  188|    332|                                 .dflt.real = NAN},
  189|    332|        {"lat",    t_real,    .addr.real = &gpsdata->gst.lat_err_deviation,
  190|    332|                                 .dflt.real = NAN},
  191|    332|        {"lon",    t_real,    .addr.real = &gpsdata->gst.lon_err_deviation,
  192|    332|                                 .dflt.real = NAN},
  193|    332|        {"major",  t_real,    .addr.real = &gpsdata->gst.smajor_deviation,
  194|    332|                                 .dflt.real = NAN},
  195|    332|        {"minor",  t_real,    .addr.real = &gpsdata->gst.sminor_deviation,
  196|    332|                                 .dflt.real = NAN},
  197|    332|        {"orient", t_real,    .addr.real = &gpsdata->gst.smajor_orientation,
  198|    332|                                 .dflt.real = NAN},
  199|    332|        {"rms",    t_real,    .addr.real = &gpsdata->gst.rms_deviation,
  200|    332|                                 .dflt.real = NAN},
  201|    332|        {"ve",     t_real,    .addr.real = &gpsdata->gst.ve_err_deviation,
  202|    332|                                 .dflt.real = NAN},
  203|    332|        {"vn",     t_real,    .addr.real = &gpsdata->gst.vn_err_deviation,
  204|    332|                                 .dflt.real = NAN},
  205|    332|        {"vu",     t_real,    .addr.real = &gpsdata->gst.vu_err_deviation,
  206|    332|                                 .dflt.real = NAN},
  207|       |        // ignore unknown keys, for cross-version compatibility
  208|    332|        {"", t_ignore},
  209|    332|        {NULL},
  210|       |        // *INDENT-ON*
  211|    332|    };
  212|       |
  213|    332|    ret = json_read_object(buf, json_attrs_1, endptr);
  214|       |
  215|    332|    return ret;
  216|    332|}
libgps_json.c:json_sky_read:
  293|    172|{
  294|       |
  295|    172|    const struct json_attr_t json_attrs_satellites[] = {
  296|       |        // *INDENT-OFF*
  297|    172|        {"PRN",    t_short,   STRUCTOBJECT(struct satellite_t, PRN)},
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  298|    172|        {"az",     t_real,    STRUCTOBJECT(struct satellite_t, azimuth),
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  299|    172|                              .dflt.real = NAN},
  300|    172|        {"el",     t_real,    STRUCTOBJECT(struct satellite_t, elevation),
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  301|    172|                              .dflt.real = NAN},
  302|    172|        {"freqid", t_byte,    STRUCTOBJECT(struct satellite_t, freqid),
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  303|    172|                              .dflt.byte = -1},
  304|    172|        {"gnssid", t_ubyte,   STRUCTOBJECT(struct satellite_t, gnssid)},
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  305|    172|        {"health", t_ubyte,   STRUCTOBJECT(struct satellite_t, health),
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  306|    172|                              .dflt.ubyte = SAT_HEALTH_UNK},
  ------------------
  |  | 2572|    172|#define SAT_HEALTH_UNK 0
  ------------------
  307|    172|        {"pr",     t_real,    STRUCTOBJECT(struct satellite_t, pr),
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  308|    172|                              .dflt.real = NAN},
  309|    172|        {"prRate", t_real,    STRUCTOBJECT(struct satellite_t, prRate),
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  310|    172|                              .dflt.real = NAN},
  311|    172|        {"prRes",  t_real,    STRUCTOBJECT(struct satellite_t, prRes),
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  312|    172|                              .dflt.real = NAN},
  313|    172|        {"ss",     t_real,    STRUCTOBJECT(struct satellite_t, ss),
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  314|    172|                              .dflt.real = NAN},
  315|    172|        {"sigid",  t_ubyte,   STRUCTOBJECT(struct satellite_t, sigid)},
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  316|    172|        {"svid",   t_ubyte,   STRUCTOBJECT(struct satellite_t, svid)},
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  317|    172|        {"used",   t_boolean, STRUCTOBJECT(struct satellite_t, used)},
  ------------------
  |  |  188|    172|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  318|       |        // ignore unknown keys, for cross-version compatibility
  319|    172|        {"", t_ignore},
  320|       |        // *INDENT-ON*
  321|    172|        {NULL},
  322|    172|    };
  323|       |
  324|    172|    int nSat = -1;  // Use nSat only to know if sats are in SKY
  325|       |
  326|    172|    const struct json_attr_t json_attrs_2[] = {
  327|       |        // *INDENT-OFF*
  328|    172|        {"class",      t_check,   .dflt.check = "SKY"},
  329|    172|        {"device",     t_string,  .addr.string  = gpsdata->dev.path,
  330|    172|                                     .len = sizeof(gpsdata->dev.path)},
  331|    172|        {"gdop",       t_real,    .addr.real    = &gpsdata->dop.gdop,
  332|    172|                                     .dflt.real = NAN},
  333|    172|        {"hdop",       t_real,    .addr.real    = &gpsdata->dop.hdop,
  334|    172|                                     .dflt.real = NAN},
  335|    172|        {"nSat",       t_integer, .addr.integer = &nSat,
  336|    172|                                     .dflt.integer = -1},
  337|    172|        {"pdop",       t_real,    .addr.real    = &gpsdata->dop.pdop,
  338|    172|                                     .dflt.real = NAN},
  339|    172|        {"tdop",       t_real,    .addr.real    = &gpsdata->dop.tdop,
  340|    172|                                     .dflt.real = NAN},
  341|    172|        {"vdop",       t_real,    .addr.real    = &gpsdata->dop.vdop,
  342|    172|                                     .dflt.real = NAN},
  343|    172|        {"xdop",       t_real,    .addr.real    = &gpsdata->dop.xdop,
  344|    172|                                     .dflt.real = NAN},
  345|    172|        {"ydop",       t_real,    .addr.real    = &gpsdata->dop.ydop,
  346|    172|                                     .dflt.real = NAN},
  347|    172|        {"satellites", t_array,
  348|    172|                                   STRUCTARRAY(gpsdata->skyview,
  ------------------
  |  |  190|    172|        .addr.array.element_type = t_structobject, \
  |  |  191|    172|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    172|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    172|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    172|        .addr.array.count = n, \
  |  |  195|    172|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1176|    172|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    172|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    172|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    172|            struct { \
  |  |  |  |  |  |   71|    172|                int unused_int; \
  |  |  |  |  |  |   72|    172|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    172|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    172|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    172|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    172|            }; \
  |  |  |  |  |  |   77|    172|            1; \
  |  |  |  |  |  |   78|    172|        })) \
  |  |  |  |  |  |   79|    172|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  349|    172|                                         json_attrs_satellites,
  350|    172|                                         &gpsdata->satellites_visible)},
  351|    172|        {"time",       t_time,    .addr.ts = &gpsdata->skyview_time,
  352|    172|                                     .dflt.ts = {0, 0}},
  353|    172|        {"uSat",       t_integer, .addr.integer = &gpsdata->satellites_used,
  354|    172|                                     .dflt.integer = 0},
  355|       |        // ignore unknown keys, for cross-version compatibility
  356|    172|        {"", t_ignore},
  357|    172|        {NULL},
  358|       |        // *INDENT-ON*
  359|    172|    };
  360|    172|    int status, i;
  361|       |
  362|    172|    memset(&gpsdata->skyview, 0, sizeof(gpsdata->skyview));
  363|       |
  364|    172|    status = json_read_object(buf, json_attrs_2, endptr);
  365|    172|    if (0 != status) {
  ------------------
  |  Branch (365:9): [True: 52, False: 120]
  ------------------
  366|     52|        return status;
  367|     52|    }
  368|       |
  369|    120|    if (1 == isfinite(gpsdata->dop.hdop) ||
  ------------------
  |  Branch (369:9): [True: 1, False: 119]
  ------------------
  370|    120|        1 == isfinite(gpsdata->dop.xdop) ||
  ------------------
  |  Branch (370:9): [True: 1, False: 118]
  ------------------
  371|    120|        1 == isfinite(gpsdata->dop.ydop) ||
  ------------------
  |  Branch (371:9): [True: 1, False: 117]
  ------------------
  372|    120|        1 == isfinite(gpsdata->dop.vdop) ||
  ------------------
  |  Branch (372:9): [True: 1, False: 116]
  ------------------
  373|    120|        1 == isfinite(gpsdata->dop.tdop) ||
  ------------------
  |  Branch (373:9): [True: 1, False: 115]
  ------------------
  374|    120|        1 == isfinite(gpsdata->dop.pdop) ||
  ------------------
  |  Branch (374:9): [True: 1, False: 114]
  ------------------
  375|    120|        1 == isfinite(gpsdata->dop.gdop)) {
  ------------------
  |  Branch (375:9): [True: 1, False: 113]
  ------------------
  376|       |        // got at least one DOP
  377|      7|        gpsdata->set |= DOP_SET;
  ------------------
  |  | 2842|      7|#define DOP_SET         (1llu<<11)
  ------------------
  378|      7|    }
  379|       |
  380|    120|    gpsdata->satellites_visible = 0;
  381|       |
  382|    120|    if (-1 == nSat) {
  ------------------
  |  Branch (382:9): [True: 30, False: 90]
  ------------------
  383|       |        // no sats in the SKY, likely just dops.  Maybe uSat
  384|     30|        gpsdata->set &= ~SATELLITE_SET;
  ------------------
  |  | 2846|     30|#define SATELLITE_SET   (1llu<<15)
  ------------------
  385|     30|        return 0;
  386|     30|    }
  387|     90|    gpsdata->satellites_used = 0;
  388|       |
  389|     90|    gpsdata->set |= SATELLITE_SET;
  ------------------
  |  | 2846|     90|#define SATELLITE_SET   (1llu<<15)
  ------------------
  390|       |    // recalculate used and visible, do not use nSat, uSat
  391|  16.6k|    for (i = 0; i < MAXCHANNELS; i++) {
  ------------------
  |  |  118|  16.6k|#define MAXCHANNELS     184     // u-blox 9 tracks 140 signals
  ------------------
  |  Branch (391:17): [True: 16.5k, False: 90]
  ------------------
  392|  16.5k|        if (0 < gpsdata->skyview[i].PRN) {
  ------------------
  |  Branch (392:13): [True: 1.50k, False: 15.0k]
  ------------------
  393|  1.50k|            gpsdata->satellites_visible++;
  394|  1.50k|        }
  395|  16.5k|        if (gpsdata->skyview[i].used) {
  ------------------
  |  Branch (395:13): [True: 1.29k, False: 15.2k]
  ------------------
  396|  1.29k|            gpsdata->satellites_used++;
  397|  1.29k|        }
  398|  16.5k|    }
  399|       |
  400|     90|    return 0;
  401|    120|}
libgps_json.c:json_att_read:
  406|     61|{
  407|     61|    struct attitude_t *datap = &gpsdata->attitude;
  408|       |
  409|     61|    const struct json_attr_t json_attrs_1[] = {
  410|       |        // *INDENT-OFF*
  411|     61|        {"class",     t_check,     .dflt.check = "ATT"},
  412|     61|        {"device",    t_string,    .addr.string = gpsdata->dev.path,
  413|     61|         .len = sizeof(gpsdata->dev.path)},
  414|     61|        {"acc_len",   t_real,      .addr.real = &datap->acc_len,
  415|     61|         .dflt.real = NAN},
  416|     61|        {"acc_x",     t_real,      .addr.real = &datap->acc_x,
  417|     61|         .dflt.real = NAN},
  418|     61|        {"acc_y",     t_real,      .addr.real = &datap->acc_y,
  419|     61|         .dflt.real = NAN},
  420|     61|        {"acc_z",     t_real,      .addr.real = &datap->acc_z,
  421|     61|         .dflt.real = NAN},
  422|     61|        {"baseS",     t_integer,   .addr.integer = &datap->base.status,
  423|     61|         .dflt.integer = STATUS_UNK},     // aka zero
  ------------------
  |  |  207|     61|#define STATUS_UNK      0       // Unknown status
  ------------------
  424|     61|        {"baseE",     t_real,      .addr.real = &datap->base.east,
  425|     61|         .dflt.real = NAN},
  426|     61|        {"baseN",     t_real,      .addr.real = &datap->base.north,
  427|     61|         .dflt.real = NAN},
  428|     61|        {"baseU",     t_real,      .addr.real = &datap->base.up,
  429|     61|         .dflt.real = NAN},
  430|     61|        {"baseL",     t_real,      .addr.real = &datap->base.length,
  431|     61|         .dflt.real = NAN},
  432|     61|        {"baseC",     t_real,      .addr.real = &datap->base.course,
  433|     61|         .dflt.real = NAN},
  434|     61|        {"dgpsRatio", t_real, .addr.real = &datap->base.ratio,
  435|     61|         .dflt.real = NAN},
  436|     61|        {"depth",     t_real,      .addr.real = &datap->depth,
  437|     61|         .dflt.real = NAN},
  438|     61|        {"dip",       t_real,      .addr.real = &datap->dip,
  439|     61|         .dflt.real = NAN},
  440|     61|        {"gyro_temp", t_real,      .addr.real = &datap->gyro_x,
  441|     61|         .dflt.real = NAN},
  442|     61|        {"gyro_x",    t_real,      .addr.real = &datap->gyro_x,
  443|     61|         .dflt.real = NAN},
  444|     61|        {"gyro_y",    t_real,      .addr.real = &datap->gyro_y,
  445|     61|         .dflt.real = NAN},
  446|     61|        {"gyro_z",    t_real,      .addr.real = &datap->gyro_z,
  447|     61|         .dflt.real = NAN},
  448|     61|        {"heading",   t_real,      .addr.real = &datap->heading,
  449|     61|         .dflt.real = NAN},
  450|     61|        {"mag_len",   t_real,      .addr.real = &datap->mag_len,
  451|     61|         .dflt.real = NAN},
  452|     61|        {"mag_st",    t_character, .addr.character = &datap->mag_st},
  453|     61|        {"mag_x",     t_real,      .addr.real = &datap->mag_x,
  454|     61|         .dflt.real = NAN},
  455|     61|        {"mag_y",     t_real,      .addr.real = &datap->mag_y,
  456|     61|         .dflt.real = NAN},
  457|     61|        {"mag_z",     t_real,      .addr.real = &datap->mag_z,
  458|     61|         .dflt.real = NAN},
  459|     61|        {"mheading",   t_real,     .addr.real = &datap->mheading,
  460|     61|         .dflt.real = NAN},
  461|     61|        {"msg",       t_string,    .addr.string = datap->msg,
  462|     61|         .len = sizeof(datap->msg)},
  463|     61|        {"pitch_st",  t_character, .addr.character = &datap->pitch_st},
  464|     61|        {"pitch",     t_real,      .addr.real = &datap->pitch,
  465|     61|         .dflt.real = NAN},
  466|     61|        {"roll_st",   t_character, .addr.character = &datap->roll_st},
  467|     61|        {"roll",      t_real,      .addr.real = &datap->roll,
  468|     61|         .dflt.real = NAN},
  469|     61|        {"temp",      t_real,      .addr.real = &datap->temp,
  470|     61|         .dflt.real = NAN},
  471|     61|        {"time",      t_time,      .addr.ts = &datap->mtime, .dflt.ts = {0, 0}},
  472|     61|        {"timeTag",   t_ulongint,  .addr.ulongint = &datap->timeTag,
  473|     61|         .dflt.ulongint = 0},
  474|     61|        {"yaw_st",    t_character, .addr.character = &datap->yaw_st},
  475|     61|        {"yaw",       t_real,      .addr.real = &datap->yaw, .dflt.real = NAN},
  476|       |
  477|       |        // ignore unknown keys, for cross-version compatibility
  478|     61|        {"", t_ignore},
  479|     61|        {NULL},
  480|       |        // *INDENT-ON*
  481|     61|    };
  482|       |
  483|     61|    return json_read_object(buf, json_attrs_1, endptr);
  484|     61|}
libgps_json.c:json_imu_read:
  489|     47|{
  490|       |    // the client only uses the first slot.
  491|     47|    struct attitude_t *datap = &gpsdata->imu[0];
  492|       |
  493|     47|    const struct json_attr_t json_attrs_1[] = {
  494|       |        // *INDENT-OFF*
  495|     47|        {"class",     t_check,     .dflt.check = "IMU"},
  496|     47|        {"device",    t_string,    .addr.string = gpsdata->dev.path,
  497|     47|         .len = sizeof(gpsdata->dev.path)},
  498|     47|        {"acc_len",   t_real,      .addr.real = &datap->acc_len,
  499|     47|         .dflt.real = NAN},
  500|     47|        {"acc_x",     t_real,      .addr.real = &datap->acc_x,
  501|     47|         .dflt.real = NAN},
  502|     47|        {"acc_y",     t_real,      .addr.real = &datap->acc_y,
  503|     47|         .dflt.real = NAN},
  504|     47|        {"acc_z",     t_real,      .addr.real = &datap->acc_z,
  505|     47|         .dflt.real = NAN},
  506|     47|        {"depth",     t_real,      .addr.real = &datap->depth,
  507|     47|         .dflt.real = NAN},
  508|     47|        {"dip",       t_real,      .addr.real = &datap->dip,
  509|     47|         .dflt.real = NAN},
  510|     47|        {"gyro_temp", t_real,      .addr.real = &datap->gyro_temp,
  511|     47|         .dflt.real = NAN},
  512|     47|        {"gyro_x",    t_real,      .addr.real = &datap->gyro_x,
  513|     47|         .dflt.real = NAN},
  514|     47|        {"gyro_y",    t_real,      .addr.real = &datap->gyro_y,
  515|     47|         .dflt.real = NAN},
  516|     47|        {"gyro_z",    t_real,      .addr.real = &datap->gyro_z,
  517|     47|         .dflt.real = NAN},
  518|     47|        {"heading",   t_real,      .addr.real = &datap->heading,
  519|     47|         .dflt.real = NAN},
  520|     47|        {"mag_len",   t_real,      .addr.real = &datap->mag_len,
  521|     47|         .dflt.real = NAN},
  522|     47|        {"mag_st",    t_character, .addr.character = &datap->mag_st},
  523|     47|        {"mag_x",     t_real,      .addr.real = &datap->mag_x,
  524|     47|         .dflt.real = NAN},
  525|     47|        {"mag_y",     t_real,      .addr.real = &datap->mag_y,
  526|     47|         .dflt.real = NAN},
  527|     47|        {"mag_z",     t_real,      .addr.real = &datap->mag_z,
  528|     47|         .dflt.real = NAN},
  529|     47|        {"msg",       t_string,    .addr.string = datap->msg,
  530|     47|         .len = sizeof(datap->msg)},
  531|     47|        {"pitch_st",  t_character, .addr.character = &datap->pitch_st},
  532|     47|        {"pitch",     t_real,      .addr.real = &datap->pitch,
  533|     47|         .dflt.real = NAN},
  534|     47|        {"roll_st",   t_character, .addr.character = &datap->roll_st},
  535|     47|        {"roll",      t_real,      .addr.real = &datap->roll,
  536|     47|         .dflt.real = NAN},
  537|     47|        {"temp",      t_real,      .addr.real = &datap->temp,
  538|     47|         .dflt.real = NAN},
  539|     47|        {"time",      t_time,      .addr.ts = &datap->mtime, .dflt.ts = {0, 0}},
  540|     47|        {"timeTag",   t_ulongint,  .addr.ulongint = &datap->timeTag,
  541|     47|         .dflt.ulongint = 0},
  542|     47|        {"yaw_st",    t_character, .addr.character = &datap->yaw_st},
  543|     47|        {"yaw",       t_real,      .addr.real = &datap->yaw, .dflt.real = NAN},
  544|       |
  545|       |        // ignore unknown keys, for cross-version compatibility
  546|     47|        {"", t_ignore},
  547|     47|        {NULL},
  548|       |        // *INDENT-ON*
  549|     47|    };
  550|       |
  551|     47|    return json_read_object(buf, json_attrs_1, endptr);
  552|     47|}
libgps_json.c:json_devicelist_read:
  556|     51|{
  557|     51|    const struct json_attr_t json_attrs_subdevices[] = {
  558|       |        // *INDENT-OFF*
  559|     51|        {"class",      t_check,      .dflt.check = "DEVICE"},
  560|     51|        {"path",       t_string,     STRUCTOBJECT(struct devconfig_t, path),
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  561|     51|         .len = sizeof(gpsdata->devices.list[0].path)},
  562|     51|        {"activated",  t_time,
  563|     51|         STRUCTOBJECT(struct devconfig_t, activated)},
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  564|     51|        {"activated",  t_real,
  565|     51|         STRUCTOBJECT(struct devconfig_t, activated)},
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  566|     51|        {"flags",      t_integer,    STRUCTOBJECT(struct devconfig_t, flags)},
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  567|     51|        {"driver",     t_string,     STRUCTOBJECT(struct devconfig_t, driver),
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  568|     51|         .len = sizeof(gpsdata->devices.list[0].driver)},
  569|     51|        {"hexdata",    t_string,     STRUCTOBJECT(struct devconfig_t, hexdata),
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  570|     51|         .len = sizeof(gpsdata->devices.list[0].hexdata)},
  571|     51|        {"sernum",     t_string,     STRUCTOBJECT(struct devconfig_t, sernum),
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  572|     51|                            .len = sizeof(gpsdata->devices.list[0].sernum)},
  573|     51|        {"subtype",    t_string,     STRUCTOBJECT(struct devconfig_t, subtype),
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  574|     51|                            .len = sizeof(gpsdata->devices.list[0].subtype)},
  575|     51|        {"subtype1",   t_string,     STRUCTOBJECT(struct devconfig_t, subtype1),
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  576|     51|                            .len = sizeof(gpsdata->devices.list[0].subtype1)},
  577|     51|        {"native",     t_integer, STRUCTOBJECT(struct devconfig_t, driver_mode),
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  578|     51|                                        .dflt.integer = -1},
  579|     51|        {"bps",        t_uinteger,   STRUCTOBJECT(struct devconfig_t, baudrate),
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  580|     51|                                        .dflt.uinteger = DEVDEFAULT_BPS},
  ------------------
  |  |   53|     51|#define DEVDEFAULT_BPS          0
  ------------------
  581|     51|        {"parity",     t_character,  STRUCTOBJECT(struct devconfig_t, parity),
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  582|     51|                                        .dflt.character = DEVDEFAULT_PARITY},
  ------------------
  |  |   54|     51|#define DEVDEFAULT_PARITY       'X'
  ------------------
  583|     51|        {"stopbits",   t_uinteger,   STRUCTOBJECT(struct devconfig_t, stopbits),
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  584|     51|                                        .dflt.integer = DEVDEFAULT_STOPBITS},
  ------------------
  |  |   55|     51|#define DEVDEFAULT_STOPBITS     3
  ------------------
  585|     51|        {"cycle",      t_timespec,   STRUCTOBJECT(struct devconfig_t, cycle),
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  586|     51|                                        .dflt.ts = {0,0}},
  587|     51|        {"mincycle",   t_timespec,   STRUCTOBJECT(struct devconfig_t, mincycle),
  ------------------
  |  |  188|     51|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  588|     51|                                        .dflt.ts = {0,0}},
  589|       |        // ignore unknown keys, for cross-version compatibility
  590|     51|        {"", t_ignore},
  591|     51|        {NULL},
  592|       |        // *INDENT-ON*
  593|     51|    };
  594|     51|    const struct json_attr_t json_attrs_devices[] = {
  595|     51|        {"class", t_check,.dflt.check = "DEVICES"},
  596|     51|        {"devices", t_array, STRUCTARRAY(gpsdata->devices.list,
  ------------------
  |  |  190|     51|        .addr.array.element_type = t_structobject, \
  |  |  191|     51|        .addr.array.arr.objects.subtype = e, \
  |  |  192|     51|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|     51|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|     51|        .addr.array.count = n, \
  |  |  195|     51|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1176|     51|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|     51|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|     51|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|     51|            struct { \
  |  |  |  |  |  |   71|     51|                int unused_int; \
  |  |  |  |  |  |   72|     51|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|     51|            } zero_init = {0}; \
  |  |  |  |  |  |   74|     51|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|     51|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|     51|            }; \
  |  |  |  |  |  |   77|     51|            1; \
  |  |  |  |  |  |   78|     51|        })) \
  |  |  |  |  |  |   79|     51|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  597|     51|                                         json_attrs_subdevices,
  598|     51|                                         &gpsdata->devices.ndevices)},
  599|       |        // ignore unknown keys, for cross-version compatibility
  600|     51|        {"", t_ignore},
  601|     51|        {NULL},
  602|     51|    };
  603|     51|    int status;
  604|       |
  605|     51|    memset(&gpsdata->devices, 0, sizeof(gpsdata->devices));
  606|     51|    status = json_read_object(buf, json_attrs_devices, endptr);
  607|     51|    if (status != 0) {
  ------------------
  |  Branch (607:9): [True: 49, False: 2]
  ------------------
  608|     49|        return status;
  609|     49|    }
  610|       |
  611|      2|    (void)clock_gettime(CLOCK_REALTIME, &gpsdata->devices.time);
  612|      2|    return 0;
  613|     51|}
libgps_json.c:json_version_read:
  617|     13|{
  618|     13|    const struct json_attr_t json_attrs_version[] = {
  619|       |        // *INDENT-OFF*
  620|     13|        {"class",     t_check,   .dflt.check = "VERSION"},
  621|     13|        {"release",   t_string,  .addr.string  = gpsdata->version.release,
  622|     13|                                    .len = sizeof(gpsdata->version.release)},
  623|     13|        {"rev",       t_string,  .addr.string  = gpsdata->version.rev,
  624|     13|                                    .len = sizeof(gpsdata->version.rev)},
  625|     13|        {"proto_major", t_integer,
  626|     13|         .addr.integer = &gpsdata->version.proto_major},
  627|     13|        {"proto_minor", t_integer,
  628|     13|         .addr.integer = &gpsdata->version.proto_minor},
  629|     13|        {"remote",    t_string,  .addr.string  = gpsdata->version.remote,
  630|     13|                                    .len = sizeof(gpsdata->version.remote)},
  631|       |        // ignore unknown keys, for cross-version compatibility
  632|     13|        {"", t_ignore},
  633|     13|        {NULL},
  634|       |        // *INDENT-ON*
  635|     13|    };
  636|     13|    int status;
  637|       |
  638|     13|    memset(&gpsdata->version, 0, sizeof(gpsdata->version));
  639|     13|    status = json_read_object(buf, json_attrs_version, endptr);
  640|       |
  641|     13|    return status;
  642|     13|}
libgps_json.c:json_error_read:
  646|      9|{
  647|      9|    const struct json_attr_t json_attrs_error[] = {
  648|       |        // *INDENT-OFF*
  649|      9|        {"class",     t_check,   .dflt.check = "ERROR"},
  650|      9|        {"message",   t_string,  .addr.string  = gpsdata->error,
  651|      9|                                    .len = sizeof(gpsdata->error)},
  652|       |        // ignore unknown keys, for cross-version compatibility
  653|      9|        {"", t_ignore},
  654|      9|        {NULL},
  655|       |        // *INDENT-ON*
  656|      9|    };
  657|      9|    int status;
  658|       |
  659|      9|    memset(&gpsdata->error, 0, sizeof(gpsdata->error));
  660|      9|    status = json_read_object(buf, json_attrs_error, endptr);
  661|      9|    if (status != 0)
  ------------------
  |  Branch (661:9): [True: 6, False: 3]
  ------------------
  662|      6|        return status;
  663|       |
  664|      3|    return status;
  665|      9|}
libgps_json.c:json_raw_read:
  221|    131|{
  222|    131|    int measurements;
  223|       |    // initialized to shut up clang
  224|    131|    double mtime_s = 0.0, mtime_ns = 0.0;
  225|       |
  226|    131|    const struct json_attr_t json_attrs_meas[] = {
  227|       |        // *INDENT-OFF*
  228|    131|        {"gnssid",       t_ubyte,    STRUCTOBJECT(struct meas_t, gnssid)},
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  229|    131|        {"svid",         t_ubyte,    STRUCTOBJECT(struct meas_t, svid)},
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  230|    131|        {"sigid",        t_ubyte,    STRUCTOBJECT(struct meas_t, sigid),
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  231|    131|                                     .dflt.ubyte = 0},
  232|    131|        {"snr",          t_ubyte,    STRUCTOBJECT(struct meas_t, snr)},
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  233|    131|        {"freqid",       t_ubyte,    STRUCTOBJECT(struct meas_t, freqid),
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  234|    131|                                     .dflt.ubyte = 0},
  235|    131|        {"obs",          t_string,   STRUCTOBJECT(struct meas_t, obs_code),
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  236|    131|                                .len = sizeof(gpsdata->raw.meas[0].obs_code)},
  237|    131|        {"lli",          t_ubyte,    STRUCTOBJECT(struct meas_t, lli),
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  238|    131|                                     .dflt.ubyte = 0},
  239|    131|        {"locktime",     t_uinteger, STRUCTOBJECT(struct meas_t, locktime),
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  240|    131|                                     .dflt.uinteger = 0},
  241|    131|        {"carrierphase", t_real,     STRUCTOBJECT(struct meas_t, carrierphase),
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  242|    131|                                     .dflt.real = NAN},
  243|    131|        {"pseudorange",  t_real,     STRUCTOBJECT(struct meas_t, pseudorange),
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  244|    131|                                     .dflt.real = NAN},
  245|    131|        {"doppler",      t_real,     STRUCTOBJECT(struct meas_t, doppler),
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  246|    131|                                     .dflt.real = NAN},
  247|    131|        {"c2c",          t_real,     STRUCTOBJECT(struct meas_t, c2c),
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  248|    131|                                    .dflt.real = NAN},
  249|    131|        {"l2c",          t_real,     STRUCTOBJECT(struct meas_t, l2c),
  ------------------
  |  |  188|    131|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  250|    131|                                    .dflt.real = NAN},
  251|       |        // ignore unknown keys, for cross-version compatibility
  252|    131|        {"", t_ignore},
  253|       |        // *INDENT-ON*
  254|    131|        {NULL},
  255|    131|    };
  256|    131|    const struct json_attr_t json_attrs_raw[] = {
  257|       |        // *INDENT-OFF*
  258|    131|        {"class",      t_check,   .dflt.check = "RAW"},
  259|    131|        {"device",     t_string,  .addr.string  = gpsdata->dev.path,
  260|    131|                                    .len = sizeof(gpsdata->dev.path)},
  261|    131|        {"time",       t_real,    .addr.real = &mtime_s,
  262|    131|                                 .dflt.real = NAN},
  263|    131|        {"nsec",       t_real,    .addr.real = &mtime_ns,
  264|    131|                                 .dflt.real = NAN},
  265|    131|        {"rawdata",    t_array,   STRUCTARRAY(gpsdata->raw.meas,
  ------------------
  |  |  190|    131|        .addr.array.element_type = t_structobject, \
  |  |  191|    131|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    131|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    131|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    131|        .addr.array.count = n, \
  |  |  195|    131|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1176|    131|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    131|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    131|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    131|            struct { \
  |  |  |  |  |  |   71|    131|                int unused_int; \
  |  |  |  |  |  |   72|    131|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    131|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    131|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    131|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    131|            }; \
  |  |  |  |  |  |   77|    131|            1; \
  |  |  |  |  |  |   78|    131|        })) \
  |  |  |  |  |  |   79|    131|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  266|    131|                                     json_attrs_meas, &measurements)},
  267|       |        // ignore unknown keys, for cross-version compatibility
  268|    131|        {"", t_ignore},
  269|    131|        {NULL},
  270|       |        // *INDENT-ON*
  271|    131|    };
  272|    131|    int status;
  273|       |
  274|    131|    memset(&gpsdata->raw, 0, sizeof(gpsdata->raw));
  275|       |
  276|    131|    status = json_read_object(buf, json_attrs_raw, endptr);
  277|    131|    if (0 != status) {
  ------------------
  |  Branch (277:9): [True: 113, False: 18]
  ------------------
  278|    113|        return status;
  279|    113|    }
  280|     18|    gpsdata->set |= RAW_SET;
  ------------------
  |  | 2870|     18|#define RAW_SET         (1llu<<39)
  ------------------
  281|     18|    if (0 == isfinite(mtime_s) ||
  ------------------
  |  Branch (281:9): [True: 15, False: 3]
  ------------------
  282|     18|        0 == isfinite(mtime_ns)) {
  ------------------
  |  Branch (282:9): [True: 2, False: 1]
  ------------------
  283|     17|        return status;
  284|     17|    }
  285|      1|    gpsdata->raw.mtime.tv_sec = (time_t)mtime_s;
  286|      1|    gpsdata->raw.mtime.tv_nsec = (long)mtime_ns;
  287|       |
  288|      1|    return 0;
  289|     18|}

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: 870]
  ------------------
  279|    194|            memcpy(dst, src, siz - 1);
  280|    194|            dst[siz - 1] = '\0';
  281|    870|        } else {
  282|    870|            memcpy(dst, src, len + 1);
  283|    870|        }
  284|  1.06k|    }
  285|  1.06k|    return len;
  286|  1.06k|}

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

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

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

