We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm having an issue parsing incoming messages with ais message type 5. Parsing these message works with AisLib.
Please advise.
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "portable.h" #include "nmea.h" #include "sixbit.h" #include "vdm_parse.h" int main( int argc, char *argv[] ) { int i = 0; ais_state ais; aismsg_5 msg_5; memset( &ais, 0, sizeof( ais_state ) ); char *msg[] = { "!BSVDM,2,2,4,A,54SkDki@000,2*06", "!BSVDM,2,2,1,A,50E@0000000,2*3C", "!BSVDM,2,2,7,A,5`5QAhH8880,2*52", "!BSVDM,2,2,3,A,5H888888880,2*43", "!BSVDM,2,2,3,B,54SkDki@000,2*02", "!BSVDM,2,2,9,B,50E@0000000,2*37", "!BSVDM,2,2,2,A,5P@Ah000000,2*03", "!BSVDM,2,2,6,A,5`5QAhH8880,2*53", "!BSVDM,2,2,8,B,5H888888880,2*4B", "!BSVDM,2,2,2,B,5R1`0j8<M`0,2*79", "!BSVDM,1,1,,A,53mFl:400000hoG3;@0pE1ADp000,0*39" }; for(i = 0; i < (sizeof(msg) / sizeof(const char*)) ; i++) { if(assemble_vdm( &ais, msg[i]) == 0) { ais.msgid = (unsigned char) get_6bit( &ais.six_state, 6 ); printf("msgid: %d, parse result: %d\n", ais.msgid, parse_ais_5(&ais, &msg_5)); } } return 0; }
Output:
msgid: 5, parse result: 2 msgid: 5, parse result: 2 msgid: 5, parse result: 2 msgid: 5, parse result: 2 msgid: 5, parse result: 2 msgid: 5, parse result: 2 msgid: 5, parse result: 2 msgid: 5, parse result: 2 msgid: 5, parse result: 2 msgid: 5, parse result: 2 msgid: 5, parse result: 2
The text was updated successfully, but these errors were encountered:
Error 2 means you don't have enough bits for the message. Looking at your example data I see a couple of things that are going to cause problems:
I do note that assemble_vdm doesn't give an error 5 when you feed it the out of sequence sentences so I'll look into that.
Sorry, something went wrong.
type5: add parsing code for ais message type 5
2ee9e6e
not working at the moment. either I'm missing something or it's an issue with our parser lib [1] [1]: bcl/aisparser#15
Fixed by #19
No branches or pull requests
I'm having an issue parsing incoming messages with ais message type 5. Parsing these message works with AisLib.
Please advise.
Output:
The text was updated successfully, but these errors were encountered: