summaryrefslogtreecommitdiff
path: root/driver_ais.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-08-27 20:26:01 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-08-27 20:26:56 -0400
commit068a90a92337d8476a69ed0048723e7587f6209f (patch)
treefdf92a4fad19701d7469d827feeb4ae5b51c4fb2 /driver_ais.c
parent7b0feb181260ff4e005547a3ae870ebc545b1e85 (diff)
downloadgpsd-068a90a92337d8476a69ed0048723e7587f6209f.tar.gz
Now that the transition is done we can restore the gpsd_report name.
All regression tests pass.
Diffstat (limited to 'driver_ais.c')
-rw-r--r--driver_ais.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/driver_ais.c b/driver_ais.c
index 675955d2..f000e01f 100644
--- a/driver_ais.c
+++ b/driver_ais.c
@@ -59,7 +59,7 @@ static void from_sixbit(unsigned char *bitvec, uint start, int count, char *to)
}
/*@ +charint @*/
-bool ais_binary_decode(const struct errout_t *errout,
+bool ais_binary_decode(const struct gpsd_errout_t *errout,
struct ais_t *ais,
const unsigned char *bits, size_t bitlen,
struct ais_type24_queue_t *type24_queue)
@@ -78,24 +78,24 @@ bool ais_binary_decode(const struct errout_t *errout,
ais->type = UBITS(0, 6);
ais->repeat = UBITS(6, 2);
ais->mmsi = UBITS(8, 30);
- gpsd_notify(errout, LOG_INF,
+ gpsd_report(errout, LOG_INF,
"AIVDM message type %d, MMSI %09d:\n",
ais->type, ais->mmsi);
#define PERMISSIVE_LENGTH_CHECK(correct) \
if (bitlen < correct) { \
- gpsd_notify(errout, LOG_ERROR, \
+ gpsd_report(errout, LOG_ERROR, \
"AIVDM message type %d size < %d bits (%zd).\n", \
ais->type, correct, bitlen); \
return false; \
} else if (bitlen > correct) { \
- gpsd_notify(errout, LOG_WARN, \
+ gpsd_report(errout, LOG_WARN, \
"AIVDM message type %d size > %d bits (%zd).\n", \
ais->type, correct, bitlen); \
}
#define RANGE_CHECK(min, max) \
if (bitlen < min || bitlen > max) { \
- gpsd_notify(errout, LOG_ERROR, \
+ gpsd_report(errout, LOG_ERROR, \
"AIVDM message type %d size is out of range (%zd).\n", \
ais->type, bitlen); \
return false; \
@@ -145,7 +145,7 @@ bool ais_binary_decode(const struct errout_t *errout,
break;
case 5: /* Ship static and voyage related data */
if (bitlen != 424) {
- gpsd_notify(errout, LOG_WARN,
+ gpsd_report(errout, LOG_WARN,
"AIVDM message type 5 size not 424 bits (%zd).\n",
bitlen);
/*
@@ -944,7 +944,7 @@ bool ais_binary_decode(const struct errout_t *errout,
{
struct ais_type24a_t *saveptr = &type24_queue->ships[type24_queue->index];
- gpsd_notify(errout, LOG_PROG,
+ gpsd_report(errout, LOG_PROG,
"AIVDM: 24A from %09u stashed.\n",
ais->mmsi);
saveptr->mmsi = ais->mmsi;
@@ -991,7 +991,7 @@ bool ais_binary_decode(const struct errout_t *errout,
(void)strlcpy(ais->type24.shipname,
type24_queue->ships[i].shipname,
sizeof(type24_queue->ships[i].shipname));
- gpsd_notify(errout, LOG_PROG,
+ gpsd_report(errout, LOG_PROG,
"AIVDM 24B from %09u matches a 24A.\n",
ais->mmsi);
/* prevent false match if a 24B is repeated */
@@ -1005,7 +1005,7 @@ bool ais_binary_decode(const struct errout_t *errout,
ais->type24.part = part_b;
return true;
default:
- gpsd_notify(errout, LOG_WARN,
+ gpsd_report(errout, LOG_WARN,
"AIVDM message type 24 of subtype unknown.\n");
return false;
}
@@ -1013,7 +1013,7 @@ bool ais_binary_decode(const struct errout_t *errout,
case 25: /* Binary Message, Single Slot */
/* this check and the following one reject line noise */
if (bitlen < 40 || bitlen > 168) {
- gpsd_notify(errout, LOG_WARN,
+ gpsd_report(errout, LOG_WARN,
"AIVDM message type 25 size not between 40 to 168 bits (%zd).\n",
bitlen);
return false;
@@ -1021,7 +1021,7 @@ bool ais_binary_decode(const struct errout_t *errout,
ais->type25.addressed = (bool)UBITS(38, 1);
ais->type25.structured = (bool)UBITS(39, 1);
if (bitlen < (unsigned)(40 + (16*ais->type25.structured) + (30*ais->type25.addressed))) {
- gpsd_notify(errout, LOG_WARN,
+ gpsd_report(errout, LOG_WARN,
"AIVDM message type 25 too short for mode.\n");
return false;
}
@@ -1049,7 +1049,7 @@ bool ais_binary_decode(const struct errout_t *errout,
ais->type26.addressed = (bool)UBITS(38, 1);
ais->type26.structured = (bool)UBITS(39, 1);
if ((signed)bitlen < 40 + 16*ais->type26.structured + 30*ais->type26.addressed + 20) {
- gpsd_notify(errout, LOG_WARN,
+ gpsd_report(errout, LOG_WARN,
"AIVDM message type 26 too short for mode.\n");
return false;
}
@@ -1064,7 +1064,7 @@ bool ais_binary_decode(const struct errout_t *errout,
break;
case 27: /* Long Range AIS Broadcast message */
if (bitlen != 96 && bitlen != 168) {
- gpsd_notify(errout, LOG_WARN,
+ gpsd_report(errout, LOG_WARN,
"unexpected AIVDM message type 27 (%zd).\n",
bitlen);
return false;
@@ -1073,7 +1073,7 @@ bool ais_binary_decode(const struct errout_t *errout,
* This is an implementation error observed in the wild,
* sending a full 168-bit slot rather than just 96 bits.
*/
- gpsd_notify(errout, LOG_WARN,
+ gpsd_report(errout, LOG_WARN,
"oversized 169=8-bit AIVDM message type 27.\n");
}
ais->type27.accuracy = (bool)UBITS(38, 1);
@@ -1086,7 +1086,7 @@ bool ais_binary_decode(const struct errout_t *errout,
ais->type27.gnss = (bool)UBITS(94, 1);
break;
default:
- gpsd_notify(errout, LOG_ERROR,
+ gpsd_report(errout, LOG_ERROR,
"Unparsed AIVDM message type %d.\n",ais->type);
return false;
}