[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gpsd-commit-watch
Subject:    [Gpsd-commit-watch] r5590 - in trunk: . test www
From:       esr at BerliOS <esr () mail ! berlios ! de>
Date:       2009-05-27 9:42:29
Message-ID: 200905270942.n4R9gTj3027573 () sheep ! berlios ! de
[Download RAW message or body]

Author: esr
Date: 2009-05-27 11:42:28 +0200 (Wed, 27 May 2009)
New Revision: 5590

Modified:
   trunk/driver_aivdm.c
   trunk/gps.h
   trunk/test/schwehr.aivdm
   trunk/test/schwehr.aivdm.chk
   trunk/www/AIVDM.txt
Log:
Add support for decoding AIS message type 10.


Modified: trunk/driver_aivdm.c
===================================================================
--- trunk/driver_aivdm.c	2009-05-27 08:41:10 UTC (rev 5589)
+++ trunk/driver_aivdm.c	2009-05-27 09:42:28 UTC (rev 5590)
@@ -294,6 +294,11 @@
 			ais->type9.cog, 
 			ais->type9.utc_second);
 	    break;
+        case 10: /* UTC/Date inquiry */
+	    ais->type10.spare          = UBITS(38, 2);
+	    ais->type10.dest_mmsi      = UBITS(40, 30);
+	    ais->type10.spare2         = UBITS(70, 2);
+	    break;
         case 12: /* Safety Related Message */
 	    ais->type12.seqno          = UBITS(38, 2);
 	    ais->type12.dest_mmsi      = UBITS(40, 30);
@@ -772,6 +777,17 @@
 #undef TYPE9_SCALED_UNLABELED
 #undef TYPE9_SCALED_LABELED
 	break;
+    case 10:	/* UTC/Date Inquiry */
+#define TYPE10_UNLABELED  "%x,%u,%x\n"
+#define TYPE10_LABELED	"sp=%x,dst=%u,sp2=%x\n"
+	    (void)fprintf(fp,
+			  (labeled ? TYPE10_LABELED : TYPE10_UNLABELED),
+			  ais->type10.spare,
+			  ais->type10.dest_mmsi,
+			  ais->type10.spare2);
+#undef TYPE10_UNLABELED
+#undef TYPE10_LABELED
+	break;
     case 12:	/* Safety Related Message */
 #define TYPE12_UNLABELED  "%u,%u,%u,%s\n"
 #define TYPE12_LABELED	"seq=%u,dst=%u,rexmit=%u,text=%s\n"

Modified: trunk/gps.h
===================================================================
--- trunk/gps.h	2009-05-27 08:41:10 UTC (rev 5589)
+++ trunk/gps.h	2009-05-27 09:42:28 UTC (rev 5590)
@@ -482,7 +482,7 @@
 	    bool raim;			/* RAIM flag */
 	    uint radio;			/* radio status bits */
 	} type123;
-	/* Type 4 - Base Station Report */
+	/* Type 4 - Base Station Report & Type 11 - UTC and Date Response */
 	struct {
 	    uint year;			/* UTC year */
 #define AIS_YEAR_NOT_AVAILABLE	0
@@ -566,6 +566,12 @@
 	    bool raim;			/* RAIM flag */
 	    uint radio;			/* radio status bits */
 	} type9;
+	/* Type 10 - UTC/Date Inquiry */
+	struct {
+	    uint spare;
+	    uint dest_mmsi;		/* destination MMSI */
+	    uint spare2;
+	} type10;
 	/* Type 12 - Safety-Related Message */
 	struct {
 	    uint seqno;			/* sequence number */

Modified: trunk/test/schwehr.aivdm
===================================================================
--- trunk/test/schwehr.aivdm	2009-05-27 08:41:10 UTC (rev 5589)
+++ trunk/test/schwehr.aivdm	2009-05-27 09:42:28 UTC (rev 5590)
@@ -195,6 +195,15 @@
 #       state_slottimeout:   3
 #       state_slotoffset:    12839
 #
+# Type 10:
+!AIVDM,1,1,,B,:5MlU41GMK6@,0*6C
+#       MessageID:        10
+#       RepeatIndicator:  0
+#       UserID:           366814480
+#       Spare1:           0
+#       DestID:           366832740
+#       Spare2:           0
+#
 # Type 18:
 # I had to regenerate the CRC32 for this one myself, it was missing
 # in Kurt's original.

Modified: trunk/test/schwehr.aivdm.chk
===================================================================
--- trunk/test/schwehr.aivdm.chk	2009-05-27 08:41:10 UTC (rev 5589)
+++ trunk/test/schwehr.aivdm.chk	2009-05-27 09:42:28 UTC (rev 5590)
@@ -8,6 +8,7 @@
 7,1,655901842,158483613,321823389,836359488,0
 8,0,366999712,23480,256:3a53dbb7be4a773137f87d7b0445f040dea05d93f593783194ae9b9d9dbe05fb
  9,3,1069287948,4032,932,1,177.3001,106.3532,256.2,48,5b,1,1,2cf227
+10,0,366814480,0,366832740,0
 18,0,338087471,0,0.1,0,-74.0721,40.6845,79.6,511,49,0,1,e0006
 18,0,338088483,0,0.0,0,-70.8112,43.1156,171.6,511,20,0,1,e0006
 19,0,367059850,248,8.7,0,-88.8104,29.5437,335.9,511,46,4,CAPT.J.RIMES,Cargo - all \
ships of this type,5.21.4.4,Undefined,0,0

Modified: trunk/www/AIVDM.txt
===================================================================
--- trunk/www/AIVDM.txt	2009-05-27 08:41:10 UTC (rev 5589)
+++ trunk/www/AIVDM.txt	2009-05-27 09:42:28 UTC (rev 5590)
@@ -338,7 +338,7 @@
 for the ship's radio(s).  The first three digits convey information
 about the country in which the ID was issued <<ITU-MID>>.
 
-Detailed descriptions of message types 1-9, 11-14, and 18-19 follow.
+Detailed descriptions of message types 1-14, and 18-19 follow.
 Information sufficient to decode other message types in the range 1-22
 can be found in <<IALA>>, but they are rare or not of general interest
 so we will not duplicate the information here. Message types 23-24 are
@@ -706,7 +706,7 @@
 
 === Type 9: Standard SAR Aircraft Position Report ===
 
-Total number of bits is 168
+Total number of bits is 168.
 
 `-------`---`-----------------------------`------------------------------------
 Field   Len Description                   Encoding   
@@ -740,6 +740,21 @@
 are even at the same bit offsets.  Time stamp has the same special
 values as in the common navigation block, but is at a different offset.
 
+=== Type 10: UTC/Date Inquiry ===
+
+Request for UTC/Date information from an AIS base station. Total
+number of bits is 72.
+
+`-------`---`-----------------------------`------------------------------------
+Field   Len Description                   Encoding   
+-------------------------------------------------------------------------------
+0-5      6  Message Type                  Unsigned integer: 9
+6-7      2  Repeat Indicator              As in Common Navigation Block
+8-37    30  Source MMSI                   Unsigned integer: 9 decimal digits
+38-39    2  Spare                         Not used
+40-69   30  Destination MMSI              Unsigned integer: 9 decimal digits
+70-71    2  Spare                         Not used
+
 === Type 11: UTC/Date Response ===
 
 Identical to message 4, with the semantics of a response to inquiry.

_______________________________________________
Gpsd-commit-watch mailing list
Gpsd-commit-watch@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/gpsd-commit-watch


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic