mak08 / VRDashboard

Monitor VR boat data and call online sailing route optimizer
GNU General Public License v3.0
24 stars 20 forks source link

AIS Sentence #42

Open GeGaX opened 3 years ago

GeGaX commented 3 years ago

Hi Michael 😉, (Sorry not too present lately)

I am told about a concern about decoding AIS sentences

By following the doc, we see that the message must not be more than 168 bits or the messages are 174 bits so the decoder crashes

Which doc did you follow for the coding of AIS sentences?

=> DOC

GeGaX commented 3 years ago

Hi Michael 😉, One of my teammate has just found the bug on the AIS which works on "lax" software but which is in error on those which respect the standard.

    function formatAIVDM_AIS_msg5 (mmsi, uinfo) {
        var s = "AIVDM";
        s += "," + "1";                                    // number of fragment
        s += "," + "1";                                    // fragment number
        s += "," + "";                                     // message id
        s += "," + "B";                                    // Radio Canal
        s += "," + formatUtilAIVDM_AIS_msg5(mmsi, uinfo);  // payload
        s += ",4"                                          // padding    HERE THE VALUE IS " 2 " not " 4 " 
        return s;
    }