Closed Oritide closed 7 years ago
If this is a multi-frame message you need to let the decoder do not forget that you should provide a session object to store multi-part messages "Function AisDecode (input, session)"
See comment on https://github.com/SignalK/signalk-parser-nmea0183/issues/32
@fulup-bzh I have a object for storing session and have had it work for all other multi line messages this is the first that has not worked
Then we have a bug, if you have a fix to propose, I would be more than happy to include it.
Here is another one that doesn't decode fully from a different ship:
!AIVDM,2,1,6,A,53n>Nv82E:?thA<b2218tp`61=E10u9@E:2222162@e754rdR>0j0CQC,0*33
!AIVDM,2,2,6,A,8<M`1Sl`11Dm2CP,2*5D
I Think I have had this ship here before and it decoded fully unfortunately I did not save the message
Next time please store the message so we may reproduce the error.
I have done some testing and it seems to be the AIS_version_indicator is not less than 2. at line 309: if( AIS_version_indicator < 2 ) {
setting it to 3 or <= 2 makes it work not sure if this causes any issues elsewhere?
Well done, would need to check in the spec to understand what this is. I must say that I do not remember why I placed it to "2". Any idea what this indicator is ?
Not sure your comments say: // Get the AIS Version indicator // 0 = station compliant with Recommendation ITU-R M.1371-1 // 1 = station compliant with Recommendation ITU-R M.1371-3 // 2-3 = station compliant with future editions
guessing the ships are using a slightly newer AIS Version and this was coded when it was only version 1?
yeah looks like that has been updated https://www.navcen.uscg.gov/?pageName=AISMessagesAStatic says:
AIS version indicator 0 = station compliant with Recommendation ITU-R M.1371-1 1 = station compliant with Recommendation ITU-R M.1371-3 (or later) 2 = station compliant with Recommendation ITU-R M.1371-5 (or later) 3 = station compliant with future editions
It looks like we could just ignore this value, don't you think so ?
I think so just looks like it is to say they are compliant with certain recommendations
If you move it out with a comment, I will merge your proposal.
I add a pull request. Hope to be not to fast with this.
Oritide I think this might be closed now, isn't it ? As you open it, I leave you to close it.
Just had a ship go by that sent this message:
Unfortunately the decoder seemed to ignore a lot of the data and only output this: