summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-05-26 18:51:11 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-05-26 18:51:11 -0400
commit18dbd26897d9cae19f2538fe4f36083e0d8317a7 (patch)
tree4e3388a16e083906b20b9fb903931bd7bcf05331
parentc54972810f014001fae6021c34b8c1ce8ec5f0bf (diff)
downloadgpsd-18dbd26897d9cae19f2538fe4f36083e0d8317a7.tar.gz
Array boundary markers now include a dimension.
-rwxr-xr-xdevtools/tablegen.py7
-rw-r--r--www/AIVDM.txt16
2 files changed, 12 insertions, 11 deletions
diff --git a/devtools/tablegen.py b/devtools/tablegen.py
index 25f89f10..edac90b7 100755
--- a/devtools/tablegen.py
+++ b/devtools/tablegen.py
@@ -85,7 +85,7 @@ def make_driver_code(wfp):
if ftype == 'x':
print >>wfp,"\t/* skip %s bit%s */" % (width, ["", "s"][width>'1'])
continue
- if ftype == 'a':
+ if ftype[0] == 'a':
print >>wfp, '#define ARRAY_BASE %s' % offsets[i].strip()
print >>wfp, '#define ELEMENT_SIZE %s' % trailing
print >>wfp, indent + "for (i = 0; ARRAY_BASE + (ELEMENT_SIZE*i) <= ais_context->bitlen; i++) {"
@@ -137,10 +137,11 @@ def make_structure(wfp):
continue
if ftype == 'x' or not record:
continue
- if ftype == 'a':
+ if ftype[0] == 'a':
print >>wfp, tabify(baseindent + inwards) + "struct {"
inwards += step
arrayname = name
+ arraydim = ftype[1:]
continue
if ftype == 'u' or ftype == 'e' or ftype[0] == 'U':
decl = "unsigned int %s;\t/* %s */" % (name, description)
@@ -156,7 +157,7 @@ def make_structure(wfp):
print >>wfp, tabify(baseindent + inwards) + decl
if arrayname:
inwards -= step
- print >>wfp, tabify(baseindent + inwards) + "} %s[DIMENSION_UNKNOWN];" % arrayname
+ print >>wfp, tabify(baseindent + inwards) + "} %s[%s];" % (arrayname, arraydim)
print >>wfp, tabify(baseindent) + "} %s;" % structname
def make_json_dumper(wfp):
diff --git a/www/AIVDM.txt b/www/AIVDM.txt
index 550adb7c..70c13bae 100644
--- a/www/AIVDM.txt
+++ b/www/AIVDM.txt
@@ -487,7 +487,8 @@ type descriptions.
|x| Spare or reserved bit
|t| String (packed six-bit ASCII)
|d| Data (uninterpreted binary)
-|a| Array boundary. Following fields are repeated to end of message
+|a| Array boundary, suffix is maximum array size.
+ Following fields are repeated to end of message
|==============================================================================
The field breakdowns in this document have been checked against live
@@ -961,7 +962,7 @@ different widths for the latitude, longitude, and current-speed fields
|82-87 | 6 |FID |fid |u|FID = 14
|88-91 | 4 |Month |month |u|1-12; 0 = N/A (default)
|92-96 | 5 |Day |day |u|1-31; 0 = N/A (default)
-|97 | | |tidal |a|Tidal information
+|97 | | |tidal |a3|Tidal information
|0-26 | 27 |Latitude |lat |I4|Unit = minutes * 0.0001,
91000 = N/A (default),
N positive, S negative.
@@ -1597,7 +1598,7 @@ A message 6 subtype. DAC = 001 FID = 28. Variable length: 204-1029 bits.
262,143 = N/A (default),
|144-148 | 5 | |waycount |u|Waypoint count (1-16),
Values 17-31 are not used.
-|149 | | |waypoint |a|Waypoint array
+|149 | | |waypoint |a16|Waypoint array
|0-27 | 28 |Longitude |lon |I4|Minutes * 0.0001,
181000 = N/A (default),
E positive, W negative.
@@ -1676,7 +1677,7 @@ different bit widths for the latitude and longitude fields.
|82-87 | 6 |FID |fid |u|FID = 32
|88-91 | 4 |Month |month |u|1-12; 0 = N/A (default)
|92-96 | 5 |Day |day |u|1-31; 0 = N/A (default)
-|97 | | |tidal |a|Tidal information
+|97 | | |tidal |a3|Tidal information
|0-24 | 25 |Longitude |lon |I3|Unit = minutes * 0.001,
181000 = N/A (default),
E positive, W negative.
@@ -2922,7 +2923,7 @@ A message 8 subtype. DAC = 001 FID = 27. Variable length: 172-997 bits.
|0-5 | 6 |Message Type |type |u|Constant: 8
|6-7 | 2 |Repeat Indicator |repeat |u|As in Common Navigation Block
|8-37 | 30 |Source MMSI |mmsi |u|9 decimal digits
-|38-39 | 2 |Spare | |u|Not used
+|38-39 | 2 |Spare | |x|Not used
|40-49 | 10 |DAC |dac |u|DAC = 001
|50-55 | 6 |FID |fid |u|FID = 27
|56-65 | 10 |Message Linkage ID|linkage |u|Unsigned integer
@@ -2936,9 +2937,8 @@ A message 8 subtype. DAC = 001 FID = 27. Variable length: 172-997 bits.
|94-111 | 18 |Duration |duration |u|Minutes from start time,
0 = cancel route,
262,143 = not available (default).
-|112-116 | 5 | |waycount |u|Waypoint count (1-16,)
- Values 17-31 are not used.
-|117 | | |waypoint |a|Waypoint array
+|112-116 | 5 |Waypoint count |waycount |u|1-16, values 17-31 are not used.
+|117 | | |waypoint |a16|Waypoint array
|0-27 | 28 |Longitude |lon |I4|Unit = minutes * 0.0001,
181000 = N/A (default),
E positive, W negative.