@@ -48,7 +48,7 @@ int main( int argc, char *argv[] )
48
48
49
49
};
50
50
51
- #define NUM_DEMO_MSGS 10
51
+ #define NUM_DEMO_MSGS 11
52
52
char * demo_msgs [] = { "!AIVDM,1,1,,B,15MqvC0Oh9G?qinK?VlPhA480@2n,0*1F,123,14" ,
53
53
"!AIVDM,1,1,,B,15Mf@6P001G?v68K??4SejL<00Sl,0*71" ,
54
54
"!AIVDM,1,1,,B,15Mn4kPP01G?qNvK>:grkOv<0<11,0*55" ,
@@ -58,7 +58,8 @@ int main( int argc, char *argv[] )
58
58
"$BSVDM,1,1,,B,15MqvC0Oh:G?qj0K?Vp@di4B0@5>,0*5D" ,
59
59
"!AIVDM,1,1,,B,15Mts3?P@;G8RB@JLbgamrBF0H6B,0*16,142,aass,12311" ,
60
60
"!AIVDM,1,1,,A,34a=CB1001JwAEhHra0qk4wF2000,0*5B" ,
61
- "\s:ASM//Port=63//MMSI=2573225,c:1301961602*7A\!BSVDM,1,1,,A,13P<JR50h00IkkJQi<Dt29ef0`PL,0*57"
61
+ "\\s:ASM//Port=63//MMSI=2573225,c:1301961602*7A\\!BSVDM,1,1,,A,13P<JR50h00IkkJQi<Dt29ef0`PL,0*57" ,
62
+ "AIVDM,1,1,,A,18UG;P0012G?Uq4EdHa=c;7@051@,0*53"
62
63
};
63
64
64
65
@@ -292,13 +293,17 @@ int main( int argc, char *argv[] )
292
293
293
294
for (i = 0 ; i < NUM_DEMO_MSGS ; i ++ )
294
295
{
295
- if ( assemble_vdm ( & ais , demo_msgs [i ] ) != 0 )
296
+ int err ;
297
+
298
+ printf ( "%d of %d: %s\n" , i + 1 , NUM_DEMO_MSGS , demo_msgs [i ]);
299
+ if ( (err = assemble_vdm ( & ais , demo_msgs [i ] )) != 0 ) {
300
+ printf ("ERROR %d\n" , err );
296
301
continue ;
302
+ }
297
303
298
304
ais .msgid = (unsigned char ) get_6bit ( & ais .six_state , 6 );
299
305
300
306
/* Process the AIS message */
301
- printf ( "%d of %d: %s\n" , i + 1 , NUM_DEMO_MSGS , demo_msgs [i ]);
302
307
printf ( "msgid : %d\n" , ais .msgid );
303
308
304
309
/* process message with appropriate parser */
0 commit comments