Skip to content
This repository
Newer
Older
100644 609 lines (497 sloc) 28.053 kb
3f6276f6 » schwehr
2010-05-03 simple c++ program to excecise the interface
1 #include "ais.h"
2
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
3 #include "ais8_001_22.h"
4
62f99518 » schwehr
2010-05-05 class B message 18/B looks to be working
5 //using namespace std;
55451839 » schwehr
2010-05-05 error handling now in place. starting on classb
6
3f6276f6 » schwehr
2010-05-03 simple c++ program to excecise the interface
7 #define UNUSED __attribute((__unused__))
8
7601f5db » schwehr
2010-05-09 close to have the memory leak plugged
9 int main(UNUSED int argc, UNUSED char* argv[]) {
3f6276f6 » schwehr
2010-05-03 simple c++ program to excecise the interface
10 build_nmea_lookup();
55451839 » schwehr
2010-05-05 error handling now in place. starting on classb
11
9b5dab14 » schwehr
2010-05-31 working on 366_34
12 //CHECKPOINT;
13
55451839 » schwehr
2010-05-05 error handling now in place. starting on classb
14 ////////////////////////////////////////
15 // 1
16 ////////////////////////////////////////
17
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
18 if (true) {
55451839 » schwehr
2010-05-05 error handling now in place. starting on classb
19 // !AIVDM,1,1,,B,15Mq4J0P01EREODRv4@74gv00HRq,0*72,b003669970,1272412824
20 Ais1_2_3("15Mq4J0P01EREODRv4@74gv00HRq");
21 // !AIVDM,1,1,,B,1EN2?oWP00ER5SLRvNPi9gwl0000,0*51,b003669970,1272412824
22 Ais1_2_3("");
23 // !AIVDM,1,1,,B,15N3QPPP0dI?uu>@smtj8wv028Rs,0*23,b003669977,1272412827
24 Ais1_2_3("");
25 // !AIVDM,1,1,,B,15N3J`P01tqr<CDJlP1DKSUn0<04,0*43,b003665001,1272412825
26 Ais1_2_3("15N3J`P01tqr<CDJlP1DKSUn0<04");
27
28 // Bad sized packets
29 Ais1_2_3("15N3J`P01tqr<CDJlP1DKSUn0<0400000"); // too large
30 Ais1_2_3("15N3J`P01tqr<CDJlP1DKSUn"); // too small
31 Ais1_2_3("95N3J`P01tqr<CDJlP1DKSUn0<04"); // wrong message type in the 1st char
32 std::cout << "Expecting bad characters 'zXYZ[\\]^_'" << std::endl;
33 Ais1_2_3("1zXYZ[\\]^_tr<CDJlP1DKSUn0<04"); // invalid character
34
35 }
36
37 ////////////////////////////////////////
38 // 7 and 13
39 ////////////////////////////////////////
03e7b50a » schwehr
2010-05-11 bit more work
40
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
41 if (true) {
03e7b50a » schwehr
2010-05-11 bit more work
42 // Causes bus error
43 // !AIVDM,1,1,,A,74i:pT000000,0*52,b003669977,1273190417
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
44 //CHECKPOINT;
03e7b50a » schwehr
2010-05-11 bit more work
45 {Ais7_13 msg("74i:pT000000"); msg.print();}
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
46 //CHECKPOINT;
03e7b50a » schwehr
2010-05-11 bit more work
47
62f99518 » schwehr
2010-05-05 class B message 18/B looks to be working
48 {Ais7_13 msg("75Mu6d0P17IP?PfGSC29WOvb0<14"); msg.print();}
49
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
50 //CHECKPOINT;
62f99518 » schwehr
2010-05-05 class B message 18/B looks to be working
51 { Ais7_13 msg("74eGSe@0owtf"); msg.print(); }
52
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
53 //CHECKPOINT;
62f99518 » schwehr
2010-05-05 class B message 18/B looks to be working
54 {
55 Ais7_13 msg("74eGSe@0owt");
56 assert(msg.had_error());
57 std::cout << "expect error " << AIS_ERR_BAD_BIT_COUNT << ": " << msg.get_error() << std::endl;
58 //msg.print();
59 }
55451839 » schwehr
2010-05-05 error handling now in place. starting on classb
60 }
62f99518 » schwehr
2010-05-05 class B message 18/B looks to be working
61
d8516314 » schwehr
2010-05-06 added msg 14 - safety broadcast
62
63 //////////////////////////////////////////////////////////////////////
9a2558c8 » schwehr
2010-05-20 starting on message 8s
64 // 8 - BBM
65 //////////////////////////////////////////////////////////////////////
66
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
67 if (true) {
56b1a5cf » schwehr
2010-05-24 msg 8 1:11 imo/met hydro
68 int i=0;
69 {
70 // !AIVDM,1,1,8,A,852HH<h0BjMv0=v6kWW<0Pb5<0A8h4=:0010000000000000000002>003P,2*09,1269959103.21
71 Ais8 msg("852HH<h0BjMv0=v6kWW<0Pb5<0A8h4=:0010000000000000000002>003P"); i++;
72 if (!msg.had_error()) msg.print();
73 else std::cout<<"FAILED 8 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
74 std::cout << "\n";
75 }
76
77 }
78
79 ///// 1 11 IMO Met Hydro
9b5dab14 » schwehr
2010-05-31 working on 366_34
80
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
81 if (true) {
82 //CHECKPOINT;
9a2558c8 » schwehr
2010-05-20 starting on message 8s
83 int i=0;
56b1a5cf » schwehr
2010-05-24 msg 8 1:11 imo/met hydro
84 // !AIVDM,1,1,8,A,852HH<h0BjMv0=v6kWW<0Pb5<0A8h4=:0010000000000000000002>003P,2*09,1269959103.21
9a2558c8 » schwehr
2010-05-20 starting on message 8s
85 {
56b1a5cf » schwehr
2010-05-24 msg 8 1:11 imo/met hydro
86 Ais8_1_11 msg("852HH<h0BjMv0=v6kWW<0Pb5<0A8h4=:0010000000000000000002>003P"); i++;
9a2558c8 » schwehr
2010-05-20 starting on message 8s
87 if (!msg.had_error()) msg.print();
88 else std::cout<<"FAILED 8 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
89 std::cout << "\n";
90 }
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
91 //CHECKPOINT;
9b5dab14 » schwehr
2010-05-31 working on 366_34
92
93 }
94
95 ///// 366 34 - Old Zone Messages - Used up to Summer 2010 in Boston
96 // http://schwehr.org/blog/archives/2009-10.html#e2009-10-15T16_52_31.txt
97 if (false) {
98 CHECKPOINT;
99 int i=0;
100 // Whales observed: !AIVDM,1,1,,B,803OvriK`R0FaqT6gOv763PKLT;0,0*25,d-089,S0392,t204010.00,T10.45701635,r003669945,1255466410,cornell,1255466411.9
101 {
a49bec66 »
2010-09-07 Working on the area notice based on the RTCM doc from Greg, but witho…
102 Ais8_366_22 msg("803OvriK`R0FaqT6gOv763PKLT;0"); i++;
9b5dab14 » schwehr
2010-05-31 working on 366_34
103 if (!msg.had_error()) msg.print();
104 else std::cout<<"FAILED 8 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
105 std::cout << "\n";
106 }
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
107 //CHECKPOINT;
9a2558c8 » schwehr
2010-05-20 starting on message 8s
108
109 }
56b1a5cf » schwehr
2010-05-24 msg 8 1:11 imo/met hydro
110
9b5dab14 » schwehr
2010-05-31 working on 366_34
111
9a2558c8 » schwehr
2010-05-20 starting on message 8s
112 //////////////////////////////////////////////////////////////////////
0d187b20 » schwehr
2010-05-14 ais msg 9 - sar position
113 // 9 - Search and rescue
114 //////////////////////////////////////////////////////////////////////
115
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
116 if (true) {
0d187b20 » schwehr
2010-05-14 ais msg 9 - sar position
117 int i=0;
118 // !AIVDM,1,1,,B,9002=mQq1oIJvt6;2eUn>Sh0040<,0*5D,b003669979,1273709011
119 {
120 Ais9 msg("9002=mQq1oIJvt6;2eUn>Sh0040<"); i++;
121 if (!msg.had_error()) msg.print();
72fe7def » schwehr
2010-05-15 adding more messages
122 else std::cout<<"FAILED 9 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
0d187b20 » schwehr
2010-05-14 ais msg 9 - sar position
123 std::cout << "\n";
124 }
125 // !AIVDM,1,1,,A,9002=mQrAgIK1cd;1m`F@0@00<3w,0*45,b2003669980,1273709054
126 {
127 Ais9 msg("9002=mQrAgIK1cd;1m`F@0@00<3w"); i++;
128 if (!msg.had_error()) msg.print();
72fe7def » schwehr
2010-05-15 adding more messages
129 else std::cout<<"FAILED 9 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
130 std::cout << "\n";
131 }
132 }
133
134
135 //////////////////////////////////////////////////////////////////////
136 // 10 - ":" UTC and date inquery
137 //////////////////////////////////////////////////////////////////////
138
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
139 if (true) {
72fe7def » schwehr
2010-05-15 adding more messages
140 int i=0;
141 // !AIVDM,1,1,,B,:5CoIn0kwN0P,0*23,b003669708,1273711619
142 {
143 Ais10 msg(":5CoIn0kwN0P"); i++;
144 if (!msg.had_error()) msg.print();
145 else std::cout<<"FAILED 10 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
146 std::cout << "\n";
147 }
148 // !AIVDM,1,1,,B,:3PTOn1ifeq0,0*13,d-096,S0215,t005405.00,T05.73646837,r11NTRQ1,1273712049
149 {
150 Ais10 msg(":3PTOn1ifeq0"); i++;
151 if (!msg.had_error()) msg.print();
152 else std::cout<<"FAILED 10 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
153 std::cout << "\n";
154 }
155 }
156
157 //////////////////////////////////////////////////////////////////////
158 // 11 - "" UTC/date response - same as 4
159 //////////////////////////////////////////////////////////////////////
160
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
161 if (true) {
72fe7def » schwehr
2010-05-15 adding more messages
162 int i=0;
163 // AIVDM,1,1,,A,;4eG>3iuaFP2:r3OiBH7;8i00000,0*65,d-104,S0420,t000211.00,T11.21643139,r09STOL1,1273708934
164 {
165 Ais4_11 msg(";4eG>3iuaFP2:r3OiBH7;8i00000"); i++;
166 if (!msg.had_error()) msg.print();
167 else std::cout<<"FAILED 11 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
168 std::cout << "\n";
169 }
170 }
171
172 //////////////////////////////////////////////////////////////////////
173 // 12 - "<" Addressed Safety message
174 //////////////////////////////////////////////////////////////////////
175
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
176 if (true) {
72fe7def » schwehr
2010-05-15 adding more messages
177 int i=0;
178 // !AIVDM,1,1,,A,<02:oP0kKcv0@<51C5PB5@?BDPD?P:?2?EB7PDB16693P381>>5<PikP,0*37
179 // From AISHUB via GPSD
180 {
181 Ais12 msg("<02:oP0kKcv0@<51C5PB5@?BDPD?P:?2?EB7PDB16693P381>>5<PikP"); i++;
182 if (!msg.had_error()) msg.print();
183 else std::cout<<"FAILED 12 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
184 std::cout << "\n";
185 }
186 // !AIVDM,1,1,,B,<3@oGf0kErm0G81Dw0,4*5C,d-115,S9999,r003669930,1273716298
187 {
188 Ais12 msg("<3@oGf0kErm0G81Dw0"); i++;
189 if (!msg.had_error()) msg.print();
190 else std::cout<<"FAILED 12 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
0d187b20 » schwehr
2010-05-14 ais msg 9 - sar position
191 std::cout << "\n";
192 }
193 }
194
72fe7def » schwehr
2010-05-15 adding more messages
195
196
0d187b20 » schwehr
2010-05-14 ais msg 9 - sar position
197 //////////////////////////////////////////////////////////////////////
d8516314 » schwehr
2010-05-06 added msg 14 - safety broadcast
198 // 14 - Safety Broadcast
199 //////////////////////////////////////////////////////////////////////
200
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
201 if (true) {
d8516314 » schwehr
2010-05-06 added msg 14 - safety broadcast
202 // From GPSD - !AIVDM,1,1,,A,>5?Per18=HB1U:1@E=B0m<L,2*51
203 {
204 Ais14 msg(">5?Per18=HB1U:1@E=B0m<L");
205 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED 14 1\n";
206 std::cout << "\n";
207 }
208 // From GPSD - !AIVDM,1,1,,A,>3R1p10E3;;R0USCR0HO>0@gN10kGJp,2*7F
209 {
210 Ais14 msg(">3R1p10E3;;R0USCR0HO>0@gN10kGJp");
211 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
212 std::cout << "\n";
213 }
214 // From GPSD - !AIVDM,1,1,,A,>4aDT81@E=@,2*2E
215 {
216 Ais14 msg(">4aDT81@E=@");
217 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
218 std::cout << "\n";
219 }
220 }
221
62f99518 » schwehr
2010-05-05 class B message 18/B looks to be working
222 //////////////////////////////////////////////////////////////////////
72fe7def » schwehr
2010-05-15 adding more messages
223 // 15 - ? Interrogation
224 //////////////////////////////////////////////////////////////////////
225
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
226 std::cout << "FIX: what is wrong with 15?" << std::endl;
72fe7def » schwehr
2010-05-15 adding more messages
227 if (false) {
120c0e24 » schwehr
2010-05-18 need many more docs
228 int i=0;
72fe7def » schwehr
2010-05-15 adding more messages
229 // From GPSD - !AIVDM,1,1,,A,?5OP=l00052HD00,2*5B
230 {
120c0e24 » schwehr
2010-05-18 need many more docs
231 Ais15 msg("?5OP=l00052HD00"); i++;
72fe7def » schwehr
2010-05-15 adding more messages
232 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED 15 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
233 std::cout << "\n";
234 }
235 // !AIVDM,1,1,,B,?h3Owpi;EluT000,2*61,b003669703,1273708908
236 {
120c0e24 » schwehr
2010-05-18 need many more docs
237 Ais15 msg("?h3Owpi;EluT000"); i++;
72fe7def » schwehr
2010-05-15 adding more messages
238 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED 15 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
239 std::cout << "\n";
240 }
241 //!AIVDM,1,1,,B,?h3Ovn1GP<K0<P@59a0,2*04,d-077,S1832,t004248.00,T48.85520485,r07RPAL1,1272415370
242 {
120c0e24 » schwehr
2010-05-18 need many more docs
243 Ais15 msg("?h3Ovn1GP<K0<P@59a0"); i++;
72fe7def » schwehr
2010-05-15 adding more messages
244 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED 15 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
245 std::cout << "\n";
246 }
120c0e24 » schwehr
2010-05-18 need many more docs
247 }
72fe7def » schwehr
2010-05-15 adding more messages
248
01501900 » schwehr
2010-05-18 more header definitions for AIS major messages
249 // !AIVDM,1,1,,B,@h3OwhiGOl583h0000000500,0*30,b003669956,1272442253
250
251
72fe7def » schwehr
2010-05-15 adding more messages
252 //////////////////////////////////////////////////////////////////////
62f99518 » schwehr
2010-05-05 class B message 18/B looks to be working
253 // 18 - Class B
254 //////////////////////////////////////////////////////////////////////
255
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
256 if (true) {
62f99518 » schwehr
2010-05-05 class B message 18/B looks to be working
257 // !AIVDM,1,1,,A,B5N3SRP0FFJFC`4:CQDFKwiP200>,0*75,b003669952,1272413103
258 { Ais18 msg("B5N3SRP0FFJFC`4:CQDFKwiP200>"); msg.print(); std::cout << std::endl; }
259 // !AIVDM,1,1,,B,B5NGjdP03MkEvV6vJTN`SwuUoP06,0*08,b003669703,1272412832
260 { Ais18 msg("B5NGjdP03MkEvV6vJTN`SwuUoP06"); msg.print(); std::cout << std::endl; }
261 // !AIVDM,1,1,,B,BU2K5MP005kN8WVSrcP03wb5oP00,0*44,d-077,S0791,t000021.00,T21.09527304,r13SCDS1,1272412822
262 { Ais18 msg("B5MtL4P00FK?Pa4I98`G`uS0200>"); msg.print(); std::cout << std::endl; }
263 // !AIVDM,1,1,,B,B5MtL4P00FK?Pa4I98`G`uS0200>,0*61,d-079,S0269,t000007.00,T07.17528574,r08RROB1,1272412808
264 { Ais18 msg(""); msg.print(); }
265
266
267 // !AIVDM,1,1,,B,Bov9gKvWbf;juI`NN@CeG1DF;3Gs,0*6D,d-126,S2121,t101756.00,T56.56587008,r09SMRQ1,1272449876
268 { Ais18 msg("Bov9gKvWbf;juI`NN@CeG1DF;3Gs"); msg.print(); std::cout << std::endl; }
269 // !AIVDM,1,1,,B,B@MMSv=E@JJd``ksAupQpveN`VH?,0*3F,d-126,S1407,t130537.00,T37.53680769,r09SSAG1,1272459940
270 { Ais18 msg("B@MMSv=E@JJd``ksAupQpveN`VH?"); msg.print(); std::cout << std::endl; }
271
272 }
113e8620 » schwehr
2010-05-06 Add message 19
273
274
275
276 //////////////////////////////////////////////////////////////////////
277 // 19 - Class B equip pos report
278 //////////////////////////////////////////////////////////////////////
279
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
280 if (true) {
113e8620 » schwehr
2010-05-06 Add message 19
281 // !AIVDM,1,1,,B,C5N3SRP0IFJKmE4:v6pBGw`@62PaLELTBJ:V00000000S0D:R220,0*3A,b003669952,1272415462
282 {
283 Ais19 msg("C5N3SRP0IFJKmE4:v6pBGw`@62PaLELTBJ:V00000000S0D:R220");
284 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
285 std::cout << "\n";
286 }
287
288 // !AIVDM,1,1,2,B,C5MtL4al06K?Pa4I99@G`us>@2fF0000000000000000?P000020,0*73,d-080,S2043,t013454.00,T54.48188603,r08RROB1,1272418496
289 {
290 Ais19 msg("C5MtL4al06K?Pa4I99@G`us>@2fF0000000000000000?P000020");
291 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
292 std::cout << "\n";
293 }
294
295 }
fa39f6cb » schwehr
2010-05-09 Message 24 now included
296
9b5dab14 » schwehr
2010-05-31 working on 366_34
297
298 //////////////////////////////////////////////////////////////////////
299 // 21 - ATON status report
300 //////////////////////////////////////////////////////////////////////
301
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
302 if (true) {
9b5dab14 » schwehr
2010-05-31 working on 366_34
303 //CHECKPOINT;
304 int i=0;
305 // From OHMEX test at CCOM
306 // !AIVDM,1,1,,A,E52HH<h:W4?Sa2Pb?Q0dgVPa4W0uM`P9<EmvH00000u@20,4*15,1269957000.16
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
307 if (true) {
9b5dab14 » schwehr
2010-05-31 working on 366_34
308 CHECKPOINT;
309 Ais21 msg("E52HH<h:W4?Sa2Pb?Q0dgVPa4W0uM`P9<EmvH00000u@20"); i++;
310 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED 21 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
311 std::cout << "\n";
312 }
313
314 //!AIVDM,2,1,5,B,E1mg=5J1T4W0h97aRh6ba84<h2d;W:Te=eLvH50```q,0*46
315 //!AIVDM,2,2,5,B,:D44QDlp0C1DU00,2*36
316 // Becomes !AIVDM,1,1,5,B,E1mg=5J1T4W0h97aRh6ba84<h2d;W:Te=eLvH50```q:D44QDlp0C1DU00,2*63
317 {
318 Ais21 msg("E1mg=5J1T4W0h97aRh6ba84<h2d;W:Te=eLvH50```q:D44QDlp0C1DU00"); i++;
319 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED 21 "<< i << " "<< AIS_STATUS_STRINGS[msg.get_error()] << "\n";
320 std::cout << "\n";
321 }
322
323 }
324
325
fa39f6cb » schwehr
2010-05-09 Message 24 now included
326 //////////////////////////////////////////////////////////////////////
327 // 24 - Class B static data msgs A and B
328 //////////////////////////////////////////////////////////////////////
329
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
330 if (true) {
fa39f6cb » schwehr
2010-05-09 Message 24 now included
331 // !AIVDM,1,1,,B,H5NHcTP<51@4TrM>10584@U<D00,2*77,x337805,b003669710,1241895000
332 {
333 Ais24 msg("H5NHcTP<51@4TrM>10584@U<D00");
334 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
335 std::cout << "\n";
336 }
337 // !AIVDM,1,1,,B,HU2K5NTn13BijklG44oppk103210,0*06,s23294,d-114,T44.21624911,x731910,r13RSMT1,1241894986
338 {
339 Ais24 msg("HU2K5NTn13BijklG44oppk103210");
340 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
341 std::cout << "\n";
342 }
343
344
345 }
346
62f99518 » schwehr
2010-05-05 class B message 18/B looks to be working
347 //////////////////////////////
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
348 // msg 8 366 22 Zone Broadcast - This message is not good
a49bec66 »
2010-09-07 Working on the area notice based on the RTCM doc from Greg, but witho…
349 //////////////////////////////
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
350 CHECKPOINT;
a49bec66 »
2010-09-07 Working on the area notice based on the RTCM doc from Greg, but witho…
351
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
352 if (false) {
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
353 if (true) {
a49bec66 »
2010-09-07 Working on the area notice based on the RTCM doc from Greg, but witho…
354 // Point
fe15ce2e »
2011-02-03 some changes from a while ago
355 std::cout << "Point: ****\n";
a49bec66 »
2010-09-07 Working on the area notice based on the RTCM doc from Greg, but witho…
356 Ais8_366_22 msg("81mg=5AKUP:0>H0007P=P?I0<12h000000");
357 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
358 std::cout << "\n";
359 }
360
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
361 if (true) {
a49bec66 »
2010-09-07 Working on the area notice based on the RTCM doc from Greg, but witho…
362 //# Circle
363 // AreaNotice: type=1 start=2009-07-06 00:00:04 duration=60 m link_id=10 sub-areas: 1
364 // !ECBBM,1,1,3,A,8,5fF0`2qP000N1n0uT0h7mH3E0000,5*42
365 // !AIVDM,1,1,,A,81mg=5AKUP:0fH0007PMP?I0<1uF0m@000,3*1A
366 // decoded: AreaNotice: type=1 start=2010-07-06 12:00:00 duration=60 m link_id=10 sub-areas: 1
367 // original_geojson: {"mmsi": 123456789, "repeat": 0, "msgtype": 8, "bbm": {"areas": [{"geometry": {"type": "Polygon", "coordinates": [[-69.74852592241444, 42.050347260650405], ... , [-69.7496029998759, 42.05782539742527], [-69.74881795586683, 42.054106048943325], [-69.74852592241444, 42.050347260650405]]}, "radius": 4260, "area_shape_name": "circle", "area_shape": 0}], "bbm_type": [366, 22], "bbm_name": "area_notice", "freetext": null}}
fe15ce2e »
2011-02-03 some changes from a while ago
368 std::cout << "\nCircle: ****\n";
a49bec66 »
2010-09-07 Working on the area notice based on the RTCM doc from Greg, but witho…
369 Ais8_366_22 msg("81mg=5AKUP:0fH0007PMP?I0<1uF0m@000");
370 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
371 std::cout << "\n";
372 }
0fc6efb3 » Kurt Schwehr
2010-09-08 Msg 8:366:22 is starting to work. Should handle everything at a low l…
373
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
374 if (true) {
0fc6efb3 » Kurt Schwehr
2010-09-08 Msg 8:366:22 is starting to work. Should handle everything at a low l…
375 //if (true) {
376 std::cout << "========== Rectangle =========\n\n";
377 // AreaNotice: type=3 start=2009-07-06 00:00:04 duration=60 m link_id=10 sub-areas: 1
378 // {"mmsi": 123456789, "repeat": 0, "msgtype": 8, "bbm": {"areas": [{"n_dim": 1000, "orientation": 0, "geometry": {"type": "Polygon", "coordinates": [[-69.80000000000004, 42.099999999999966], [-69.75162960655275, 42.100327032875335], [-69.7517359921246, 42.10933275886458], [-69.80011323018579, 42.1090056233274], [-69.80000000000004, 42.099999999999966]]}, "area_shape": 1, "e_dim": 4000, "area_shape_name": "rectangle"}], "bbm_type": [366, 22], "bbm_name": "area_notice", "freetext": null}}
379 // !ECBBM,1,1,3,A,8,5fF0`6qP000N6n0uT0h;OgU0D000,5*27
380 // !AIVDM,1,1,,A,81mg=5AKUP:1fH0007QeP?I0<2osq@5000,3*07
381 Ais8_366_22 msg("81mg=5AKUP:1fH0007QeP?I0<2osq@5000");
382 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
383 std::cout << "\n";
384 }
385
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
386 if (true) {
0fc6efb3 » Kurt Schwehr
2010-09-08 Msg 8:366:22 is starting to work. Should handle everything at a low l…
387 std::cout << "========== Sector =========\n\n";
388 //Sector AreaNotice: type=4 start=2009-07-06 00:00:04 duration=60 m link_id=10 sub-areas: 1
389 Ais8_366_22 msg("81mg=5AKUP:2>H0007R=P?I0<3jQwl0:6@");
390 if (!msg.had_error()) msg.print(); else std::cout<<"Sector FAILED\n";
391 std::cout << "\n";
392 }
393
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
394 if (true) {
0fc6efb3 » Kurt Schwehr
2010-09-08 Msg 8:366:22 is starting to work. Should handle everything at a low l…
395 std::cout << "========== Line =========\n\n";
396 // Line - 1 segment
397 {
398 Ais8_366_22 msg("81mg=5AKUP:5>H0007P=P?I0>CQh000003@D7QJ00;@01J000"); //81mg=5AKUP:2fH0007P=P?I0<4e7p00003@D7QJ00;@");
399 if (!msg.had_error()) msg.print(); else std::cout<<"Line seg FAILED\n";
400 }
401 std::cout << "========== END LINE ==========\n\n";
402 }
403
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
404 if (true) {
0fc6efb3 » Kurt Schwehr
2010-09-08 Msg 8:366:22 is starting to work. Should handle everything at a low l…
405 std::cout << "========== Polygon =========\n\n";
406 // Polygon - 2 segment - triangle
407 {
408 Ais8_366_22 msg("81mg=5AKUP:3>H0007P=P?I0<5Wep000040DchFWWc@01J000");
409 if (!msg.had_error()) msg.print(); else std::cout<<"Polygon FAILED\n";
410 }
411 std::cout << "========== END POLYGON ==========\n\n";
412 }
413
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
414 if (true) {
0fc6efb3 » Kurt Schwehr
2010-09-08 Msg 8:366:22 is starting to work. Should handle everything at a low l…
415 std::cout << "========== START TEXT ==========\n\nText should be [EXPLANATION]\n";
416 // Text AreaNotice: type=7 start=2009-07-06 00:00:04 duration=60 m link_id=10 sub-areas: 2
417 {
418 Ais8_366_22 msg("81mg=5AKUP:3fH0007P=P?I0<6RCp000055H@<1>1D9?>0000");
419 if (!msg.had_error()) msg.print(); else std::cout<<"Text FAILED\n";
420 }
421 std::cout << "========== END TEXT ==========\n\n";
422 }
423
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
424 if (true) {
0fc6efb3 » Kurt Schwehr
2010-09-08 Msg 8:366:22 is starting to work. Should handle everything at a low l…
425 // one-of-each
426 std::cout << "========== START ONE OF EACH ==========\n\n";
427 Ais8_366_22 msg("81mg=5AKUP:4>H0007P=P?I0<8GOp00000=P?I0<8GOsr0001MPdd0<8GOv@j002MQ9w0<8GOq;0:6@=QWB0<8GOp00003EDG9J00;@01J000=R4U0<8GOp000040DchFWWc@01J005C?=5PD5HD000000");
428 if (!msg.had_error()) msg.print(); else std::cout<<"one of each FAILED\n";
429 std::cout << "\n";
430 std::cout << "========== START ONE OF EACH ==========\n\n";
431 }
432
a49bec66 »
2010-09-07 Working on the area notice based on the RTCM doc from Greg, but witho…
433 }
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
434 CHECKPOINT;
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
435
436
a49bec66 »
2010-09-07 Working on the area notice based on the RTCM doc from Greg, but witho…
437 //////////////////////////////
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
438 // msg 8 1 22 Zone Broadcast
62f99518 » schwehr
2010-05-05 class B message 18/B looks to be working
439 //////////////////////////////
440
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
441 if (true) {
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
442 std::cout << "bbm: 8 1 22" << std::endl;
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
443 //for (size_t i=0; i < AIS8_001_22_NUM_NAMES; i++) {
444 // std::cout << i << "\t" << notice_names[i] << "\n";
445 //}
446
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
447 if (true) {
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
448 // Point
449 /*
450 AreaNotice: type=0 start=2011-07-06 00:00:00 duration=60 m link_id=10 sub-areas: 1
451 !AIVDM,1,1,,A,81mg=5@0EP:0>H0007P>0<D1<qp400000,0*1D
452
453 001000000001110101101111001101000101010000000000010101100000001010000000001110011000000000000000000000000111100000001110000000001100010100000001001100111001111000000100000000000000000000000000000000
454
455 decoded: AreaNotice: type=0 start=2011-07-06 00:00:00 duration=60 m link_id=10 sub-areas: 1
456
457 original_geojson: {"mmsi": 123456789, "repeat": 0, "msgtype": 8, "bbm": {"start": "2011-07-06T00:00:00Z", "link_id": 10, "duration_min": 60, "freetext": null, "area_type_desc": "Caution Area: Marine mammal habitat", "stop": "2011-07-06T01:00:00Z", "areas": [{"geometry": {"type": "Point", "coordinates": [-69.8, 42.0]}, "area_shape_name": "point", "area_shape": 0}], "bbm_type": [1, 22], "bbm_name": "area_notice", "area_type": 0}}
458 */
459
460
461 std::cout << "\n\nPoint: ****\n";
462 Ais8_001_22 msg("81mg=5@0EP:0>H0007P>0<D1<qp400000");
463 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
464 std::cout << "\n";
465 }
466
467
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
468 if (true) {
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
469 // Circle
470 /*
471 AreaNotice: type=0 start=2011-07-06 00:00:00 duration=60 m link_id=10 sub-areas: 1
472 "mmsi": 123456789, "repeat": 0, "msgtype": 8, "bbm": {"start": "2011-07-06T00:00:00Z", "link_id": 10, "duration_min": 60, "freetext": null, "area_type_desc": "Caution Area: Marine mammal habitat", "stop": "2011-07-06T01:00:00Z", "areas": [{"geometry": {"type": "Polygon", "coordinates": [[-69.74852592241444, 42.050347260650405],
473 [-69.74852592241444, 42.050347260650405]]}, "center_ll": [-69.8, 42.05], "radius_m": 4260, "area_shape_name": "circle", "area_shape": 0}], "bbm_type": [1, 22], "bbm_name": "area_notice", "area_type": 0}}
474
475 !AIVDM,1,1,,A,81mg=5@0EP:0>H0007PN0<D1<wg46b000,0*28
476 */
477
478 std::cout << "\n\nCircle: ****\n";
479 Ais8_001_22 msg("81mg=5@0EP:0>H0007PN0<D1<wg46b000");
480 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
481 std::cout << "\n";
482 }
483
484
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
485 if (true) {
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
486 // Rect
487 /*
488 AreaNotice: type=3 start=2011-07-06 05:31:00 duration=60 m link_id=10 sub-areas: 1
489 {"mmsi": 123456789, "repeat": 0, "msgtype": 8,
490 "bbm": {"start": "2011-07-06T05:31:00Z", "link_id": 10, "duration_min": 60, "freetext": null, "area_type_desc": "Caution Area: Marine mammals in area - Report Sightings", "stop": "2011-07-06T06:31:00Z",
491 "areas": [
492 {"n_dim": 1000, "orientation": 0, "geometry": {"type": "Polygon", "coordinates": [
493 [-69.80000000000004, 42.14999999999998],
494 [-69.75159155785775, 42.15032733770786],
495 [-69.75169812451595, 42.15933298502247],
496 [-69.80011342866348, 42.15900554457626],
497 [-69.80000000000004, 42.14999999999998]]},
498 "area_shape": 1, "e_dim": 4000, "area_shape_name": "rectangle"}
499 ],
500 "bbm_type": [1, 22],
501 "bbm_name": "area_notice",
502 "area_type": 3}}
503 !AIVDM,1,1,,A,81mg=5@0EP:1fHcp07Qf0<D1=;Lt:0`00,0*63
504 001000000001110101101111001101000101010000000000010101100000001010000001101110011000101011111000000000000111100001101110000000001100010100000001001101001011011100111100001010000000101000000000000000
505 */
506
507 std::cout << "\n\nRect: ****\n";
508 Ais8_001_22 msg("81mg=5@0EP:1fHcp07Qf0<D1=;Lt:0`00");
509 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
510 std::cout << "\n";
511 }
512
513
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
514 if (true) {
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
515 /*
516 AreaNotice: type=4 start=2011-07-06 12:49:00 duration=60 m link_id=10 sub-areas: 1
517 {"mmsi": 123456789, "repeat": 0, "msgtype": 8, "bbm": {"start": "2011-07-06T12:49:00Z", "link_id": 10, "duration_min": 60, "freetext": null, "area_type_desc": "Caution Area: Protected Habitat - Reduce Speed", "stop": "2011-07-06T13:49:00Z", "areas": [{"geometry": {"type": "Polygon", "coordinates": [[-69.80000000000004, 42.19999999999997], ... [-69.80000000000004, 42.19999999999997]]}, "area_shape": 2, "radius": 4000, "left_bound": 10, "right_bound": 50, "area_shape_name": "sector"}], "bbm_type": [1, 22], "bbm_name": "area_notice", "area_type": 4}}
518 !AIVDM,1,1,,A,81mg=5@0EP:2>IV807R>0<D1=ACtvP1@j,0*3D
519 001000000001110101101111001101000101010000000000010101100000001010000010001110011001100110001000000000000111100010001110000000001100010100000001001101010001010011111100111110100000000001010000110010
520
521 */
522 std::cout << "\n\nSECTOR: ****\n";
523 Ais8_001_22 msg("81mg=5@0EP:2>IV807R>0<D1=ACtvP1@j");
524 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
525 std::cout << "\n";
526 }
527
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
528 if (true) {
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
529 /*
530 Line - 1 segment
531 AreaNotice: type=5 start=2011-07-06 15:01:00 duration=60 m link_id=10 sub-areas: 1
532 {"mmsi": 123456789, "repeat": 0, "msgtype": 8, "bbm": {"start": "2011-07-06T15:01:00Z", "link_id": 10, "duration_min": 60, "freetext": null, "area_type_desc": "Caution Area: Protected Habitat - Stay Clear", "stop": "2011-07-06T16:01:00Z", "areas": [{"geometry": {"type": "LineString", "coordinates": [[-69.80000000000004, 42.249999999999964], [-69.79521587502177, 42.271319707450346]]}, "area_shape_name": "waypoints/polyline", "area_shape": 3}], "bbm_type": [1, 22], "bbm_name": "area_notice", "area_type": 5}}
533 !AIVDM,2,1,,A,81mg=5@0EP:2fIp807P>0<D1=G:t00000J2QpFP05`0,0*2A
534 !AIVDM,2,2,,A,1J000,3*6E
535 001000000001110101101111001101000101010000000000010101100000001010000010101110011001111000001000000000000111100000001110000000001100010100000001001101010111001010111100000000000000000000000000000000011010000010100001111000010110100000000000000101101000000000000001011010000000000000000
536
537 norm: !AIVDM,1,1,,A,81mg=5@0EP:2fIp807P>0<D1=G:t00000J2QpFP05`01J000,3*61,rUNKNOWN,1296942146
538 */
539 std::cout << "\n\n: ****\n";
540 Ais8_001_22 msg("81mg=5@0EP:2fIp807P>0<D1=G:t00000J2QpFP05`01J000");
541 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
542 std::cout << "\n";
543 }
544
a49bec66 »
2010-09-07 Working on the area notice based on the RTCM doc from Greg, but witho…
545
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
546 if (true) {
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
547 /*
548 # Polygon - 2 segment - triangle
549 AreaNotice: type=6 start=2011-07-06 20:59:00 duration=60 m link_id=10 sub-areas: 1
550 {"mmsi": 123456789, "repeat": 0, "msgtype": 8, "bbm": {"start": "2011-07-06T20:59:00Z", "link_id": 10, "duration_min": 60, "freetext": null, "area_type_desc": "Caution Area: Protected Habitat - No fishing or anchoring", "stop": "2011-07-06T21:59:00Z", "areas": [{"geometry": {"type": "Polygon", "coordinates": [[-69.80000000000004, 42.299999999999955], [-69.79720758254113, 42.31243643739742], [-69.77354796545391, 42.31259848584068], [-69.80000000000004, 42.299999999999955]]}, "area_shape_name": "polygon", "area_shape": 4}], "bbm_type": [1, 22], "bbm_name": "area_notice", "area_type": 6}}
551 !AIVDM,2,1,,A,81mg=5@0EP:3>JWH07P>0<D1=M1t00000R2Q65`HM`0,0*3B
552 !AIVDM,2,2,,A,1J000,3*6E
553 001000000001110101101111001101000101010000000000010101100000001010000011001110011010100111011000000000000111100000001110000000001100010100000001001101011101000001111100000000000000000000000000000000100010000010100001000110000101101000011000011101101000000000000001011010000000000000000
554
555 norm: !AIVDM,1,1,,A,81mg=5@0EP:3>JWH07P>0<D1=M1t00000R2Q65`HM`01J000,3*70,rUNKNOWN,1296942146
556
557 */
558 std::cout << "\n\n: Polygon - Triangle****\n";
559 Ais8_001_22 msg("81mg=5@0EP:3>JWH07P>0<D1=M1t00000R2Q65`HM`01J000");
560 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
561 std::cout << "\n";
562 }
563
564
565 if (true) {
566 /*
567 # Text
568 AreaNotice: type=7 start=2011-07-06 23:59:00 duration=60 m link_id=10 sub-areas: 2
569 {"mmsi": 123456789, "repeat": 0, "msgtype": 8, "bbm": {"start": "2011-07-06T23:59:00Z", "link_id": 10, "duration_min": 60, "freetext": "EXPLANATION", "area_type_desc": "Caution Area: Derelicts (drifting objects)", "stop": "2011-07-07T00:59:00Z", "areas": [{"geometry": {"type": "Point", "coordinates": [-69.8, 42.34999999999998]}, "area_shape_name": "point", "area_shape": 0}, {"text": "EXPLANATION", "area_shape_name": "freetext", "area_shape": 5}], "bbm_type": [1, 22], "bbm_name": "area_notice", "area_type": 7}}
570 !AIVDM,2,1,,A,81mg=5@0EP:3fJwH07P>0<D1=Rpt00000`c21P9h:Q9,0*49
571 !AIVDM,2,2,,A,qh000,3*0C
572 001000000001110101101111001101000101010000000000010101100000001010000011101110011010111111011000000000000111100000001110000000001100010100000001001101100010111000111100000000000000000000000000000000101000101011000010000001100000001001110000001010100001001001111001110000000000000000000
573
574 !AIVDM,1,1,,A,81mg=5@0EP:3fJwH07P>0<D1=Rpt00000`c21P9h:Q9qh000,3*60,rUNKNOWN,1296942146
575
576 */
577 std::cout << "\n\nText: ****\n";
578 Ais8_001_22 msg("81mg=5@0EP:3fJwH07P>0<D1=Rpt00000`c21P9h:Q9qh000");
579 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
580 std::cout << "\n";
581 }
582
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
583 #if 0
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
584
585 if (true) {
586 /*
587
588 */
589 std::cout << "\n\n: ****\n";
590 Ais8_001_22 msg("");
591 if (!msg.had_error()) msg.print(); else std::cout<<"FAILED\n";
592 std::cout << "\n";
593 }
1a757ea0 »
2011-03-31 why are the gtest framework tests failing when my custom old tests work?
594 #endif
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
595
596
597
598 }
599
600
601 //////////////////////////////
602 // DONE
603 //////////////////////////////
a49bec66 »
2010-09-07 Working on the area notice based on the RTCM doc from Greg, but witho…
604
791c882f »
2011-02-05 First round of tests appear to work for the IMO area notice that come…
605 std::cerr << "Shutting down" << std::endl;
a49bec66 »
2010-09-07 Working on the area notice based on the RTCM doc from Greg, but witho…
606
3f6276f6 » schwehr
2010-05-03 simple c++ program to excecise the interface
607 return 0;
62f99518 » schwehr
2010-05-05 class B message 18/B looks to be working
608
3f6276f6 » schwehr
2010-05-03 simple c++ program to excecise the interface
609 }
Something went wrong with that request. Please try again.