[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] devtools/ais.py type25 parsing bug
From: |
Christian Gagneraud |
Subject: |
Re: [gpsd-dev] devtools/ais.py type25 parsing bug |
Date: |
Fri, 27 Jul 2012 15:47:57 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120601 Thunderbird/13.0 |
On 27/07/12 04:29, KIU Shueng Chuan wrote:
Hi,
In devtools/ais.py from gpsd release 3.7, the bitfield definition of
"type25" is causing a TypeError exception in aivdm_unpack().
type25 = {
bitfield("addressed", ...),
bitfield("structured", ..."Dimension to Bow"), # legend field
should be "Binary Data Flag"
...
bitfield("data", None, ...) #
width field set to None causes the exception
}
One of the last few lines of aivdm_unpack() does
offset += inst.width
which chokes on width==None
Changing None to 0 in the bitfield definition makes it work.
Hi Kiu,
Thanks for pointing that out. I will fix that shortly.
Please note, that the gpsd program itself handle this sentence correctly.
Any reason you are using devtools/ais.py?
This script has not been tested as thoroughly as gpsd.
If you want a sand alone stdin-to-stdout decoder use gpsdecode instead.
For reference, the following was the sentence that triggered it:
!AIVDM,1,1,,B,I9NS<Lh01dWK:UN0bOM2MR2d0<<K,0*58
Chris
--
Christian Gagneraud,
Embedded systems engineer.
Techworks Marine
1 Harbour road
Dun Laoghaire
Co. Dublin
Ireland
Tel: + 353 (0) 1 236 5990
Web: http://www.techworks.ie/