summaryrefslogtreecommitdiff
path: root/comms/rxtx/files/patch-src-gnu-io-RXTXPort.java
blob: f71863e31f0b09392e197fbbe9f14f8624fe8873 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
--- src/gnu/io/RXTXPort.java.orig	2008-11-13 23:37:45 UTC
+++ src/gnu/io/RXTXPort.java
@@ -56,6 +56,7 @@
 |   All trademarks belong to their respective owners.
 --------------------------------------------------------------------------*/
 package gnu.io;
+
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.IOException;
@@ -65,93 +66,133 @@ import java.lang.Math;
 /**
 * An extension of gnu.io.SerialPort
 * @see gnu.io.SerialPort
-*/
+**/
 
 final public class RXTXPort extends SerialPort
 {
-	/* I had a report that some JRE's complain when MonitorThread
-	   tries to access private variables
-	*/
+	/** 
+	*	I had a report that some JRE's complain when MonitorThread
+	*	 tries to access private variables
+	**/
 
-	protected final static boolean debug = false;
+	protected final static boolean debug = "true".equals( System.getProperty( "gnu.io.rxtx.DEBUG" ) );
 	protected final static boolean debug_read = false;
 	protected final static boolean debug_read_results = false;
 	protected final static boolean debug_write = false;
-	protected final static boolean debug_events = false;
+	protected final static boolean debug_events = "true".equals( System.getProperty( "gnu.io.rxtx.DEBUG" ) );;
 	protected final static boolean debug_verbose = false;
 
 	private static Zystem z;
 
 	static
 	{
-		try {
+		if (debug) System.out.println("RXTXPort:Static()");
+		
+		try 
+		{
 			z = new Zystem();
-		} catch ( Exception e ) {}
+		} 
+		catch (Exception e) 
+		{
+			if (debug) System.out.println("RXTXPort:Static:Exception Thrown");	
+		}
 
-		if(debug ) 
-			z.reportln( "RXTXPort {}");
-		System.loadLibrary( "rxtxSerial" );
+		if(debug) System.out.println(" Loading Library...");
+		
+		System.loadLibrary("rxtxSerial" );
+		
+		if(debug) System.out.println(" Initializing...");
+		
 		Initialize();
+		
+		if(debug) System.out.println("RXTXPort:Static:Exit");
+		
 	}
 
-	/** Initialize the native library */
+	/**
+	*	Initialize the native library
+	**/
+	
 	private native static void Initialize();
+	
 	boolean MonitorThreadAlive=false;
 
 	/** 
-	*  Open the named port
-	*  @param name the name of the device to open
-	*  @throws  PortInUseException
-	*  @see gnu.io.SerialPort
-	*/
-	public RXTXPort( String name ) throws PortInUseException
+	*	Open the named port
+	*	@param	name the name of the device to open
+	*	@throws	PortInUseException
+	*	@see	gnu.io.SerialPort
+	**/
+	
+	public RXTXPort( String name )
+	throws PortInUseException
 	{
-		if (debug)
-			z.reportln( "RXTXPort:RXTXPort("+name+") called");
-	/* 
-	   commapi/javadocs/API_users_guide.html specifies that whenever
-	   an application tries to open a port in use by another application
-	   the PortInUseException will be thrown
-
-	   I know some didnt like it this way but I'm not sure how to avoid
-	   it.  We will just be writing to a bogus fd if we catch the 
-	   exeption
-
-	   Trent
-	*/
-	//	try {
-			fd = open( name );
-			this.name = name;
-
-			MonitorThreadLock = true;
-			monThread = new MonitorThread();
-			monThread.start();
-			waitForTheNativeCodeSilly();
-			MonitorThreadAlive=true;
-	//	} catch ( PortInUseException e ){}
-		timeout = -1;	/* default disabled timeout */
-		if (debug)
-			z.reportln( "RXTXPort:RXTXPort("+name+") returns with fd = " +
-				fd);
+		if (debug) System.out.println("RXTXPort:RXTXPort(" + name + ")");
+		
+		/**
+		*	commapi/javadocs/API_users_guide.html specifies that whenever
+		*	an application tries to open a port in use by another application
+		*	the PortInUseException will be thrown
+		*	
+		*	I know some didnt like it this way but I'm not sure how to avoid
+		*	it.  We will just be writing to a bogus fd if we catch the 
+		*	exeption
+		*	
+		*	Trent
+		**/
+	
+		/**
+		*	try {
+		**/
+		
+		fd = open( name );
+		this.name = name;
+		
+		MonitorThreadLock = true;
+		monThread = new MonitorThread();
+		monThread.start();
+		waitForTheNativeCodeSilly();
+		MonitorThreadAlive=true;
+		
+		/**
+		*	} catch ( PortInUseException e ){}
+		**/
+		
+		/**
+		*	default disabled timeout
+		**/
+		
+		timeout = -1;	
+		
+		if (debug) System.out.println(
+			"RXTXPort:RXTXPort(" + name + ") returns with fd = " + fd
+		);
 	}
+	
 	private native synchronized int open( String name )
-		throws PortInUseException;
+	throws PortInUseException;
 
 
-	/* dont close the file while accessing the fd */
+	/**
+	*	dont close the file while accessing the fd
+	**/
+	
 	int IOLocked = 0;
+	
 	Object IOLockedMutex = new Object();
 
 	/** File descriptor */
 	private int fd = 0;
 
-	/** a pointer to the event info structure used to share information
-	    between threads so write threads can send output buffer empty
-	    from a pthread if need be.
-
-	    long for 64 bit pointers.
-	*/
+	/**
+	*	a pointer to the event info structure used to share information
+	*	between threads so write threads can send output buffer empty
+	*	from a pthread if need be.
+	*	
+	*	long for 64 bit pointers.
+	**/
 	long eis = 0;
+	
 	/** pid for lock files */
 	int pid = 0;
 
@@ -160,142 +201,202 @@ final public class RXTXPort extends Seri
 
 	/** Output stream */
 	private final SerialOutputStream out = new SerialOutputStream();
+	
 	/** 
-	*  get the OutputStream
-	*  @return OutputStream
-	*/
+	*	get the OutputStream
+	*	@return	OutputStream
+	**/
 	public OutputStream getOutputStream()
 	{
 		if (debug)
-			z.reportln( "RXTXPort:getOutputStream() called and returning");
+		{
+			System.out.println(
+				"RXTXPort:getOutputStream()"
+			);
+		}
+		
 		return out;
+		
 	}
 
 	/** Input stream */
 	private final SerialInputStream in = new SerialInputStream();
+	
 	/** 
-	*  get the InputStream
-	*  @return InputStream
-	*  @see java.io.InputStream
-	*/
+	*	get the InputStream
+	*	@return	InputStream
+	*	@see	java.io.InputStream
+	**/
+	
 	public InputStream getInputStream()
 	{
 		if (debug)
-			z.reportln( "RXTXPort:getInputStream() called and returning");
+		{
+			System.out.println(
+				"RXTXPort:getInputStream:Exit"
+			);
+		}
 		return in;
 	}
 
-	/** 
-	*  Set the SerialPort parameters
-	*  1.5 stop bits requires 5 databits
-	*  @param  b baudrate
-	*  @param  d databits
-	*  @param  s stopbits
-	*  @param  p parity
-	*  @throws UnsupportedCommOperationException
-	*  @see gnu.io.UnsupportedCommOperationException
-
-	*  If speed is not a predifined speed it is assumed to be
-	*  the actual speed desired.
-	*/
 	private native int nativeGetParity( int fd );
 	private native int nativeGetFlowControlMode( int fd );
-	public synchronized void setSerialPortParams( int b, int d, int s,
-		int p )
-		throws UnsupportedCommOperationException
+	
+	/** 
+	*	Set the SerialPort parameters
+	*	1.5 stop bits requires 5 databits
+	*	@param  b baudrate
+	*	@param  d databits
+	*	@param  s stopbits
+	*	@param  p parity
+	*	@throws UnsupportedCommOperationException
+	*	@see gnu.io.UnsupportedCommOperationException
+	*	
+	*	If speed is not a predifined speed it is assumed to be
+	*	the actual speed desired.
+	**/
+	
+	public synchronized void setSerialPortParams(
+		int b, 
+		int d,
+		int s,
+		int p
+	)
+	throws UnsupportedCommOperationException
 	{
-		if (debug)
-			z.reportln( "RXTXPort:setSerialPortParams(" +
-				b + " " + d + " " + s + " " + p + ") called");
+		if (debug) System.out.println(
+			"RXTXPort:setSerialPortParams(b:" + b + " d:" + d + " s:" + s + " p:" + p + ")"
+		);
 		if ( nativeSetSerialPortParams( b, d, s, p ) )
-			throw new UnsupportedCommOperationException(
-				"Invalid Parameter" );
+		{
+			throw new UnsupportedCommOperationException
+			(
+				"Invalid Parameter" 
+			);
+		}
+		
 		speed = b;
-		if( s== STOPBITS_1_5 ) dataBits = DATABITS_5;
-		else dataBits = d;
+		
+		if( s== STOPBITS_1_5 )
+		{
+			dataBits = DATABITS_5;
+		}
+		else
+		{
+			dataBits = d;
+		}
+		
 		stopBits = s;
 		parity = p;
-			z.reportln( "RXTXPort:setSerialPortParams(" +
-				b + " " + d + " " + s + " " + p +
-				") returning");
+		
+		if (debug) System.out.println(
+			"RXTXPort:setSerialPortParams(b:" + b + " d:" + d + " s:" + s + " p:" + p + "):Exit"
+		);
+		
 	}
 
 	/**
-	*  Set the native serial port parameters
-	*  If speed is not a predifined speed it is assumed to be
-	*  the actual speed desired.
-	*/
-	private native boolean nativeSetSerialPortParams( int speed,
-		int dataBits, int stopBits, int parity )
-		throws UnsupportedCommOperationException;
+	*	Set the native serial port parameters
+	*	If speed is not a predifined speed it is assumed to be
+	*	the actual speed desired.
+	**/
+	private native boolean nativeSetSerialPortParams(
+		int speed,
+		int dataBits,
+		int stopBits,
+		int parity
+	)
+	throws UnsupportedCommOperationException;
 
 	/** Line speed in bits-per-second */
 	private int speed=9600;
+	
 	/** 
-	*  @return  int representing the baudrate
-	*  This will not behave as expected with custom speeds
-	*/
+	*	@return  int representing the baudrate
+	*	This will not behave as expected with custom speeds
+	**/
+	
 	public int getBaudRate()
 	{
 		if (debug)
-			z.reportln( "RXTXPort:getBaudRate() called and returning " + speed);
+		{
+			System.out.println(
+				"RXTXPort:getBaudRate:Exit" + speed
+			);
+		}
 		return speed;
 	}
 
-	/** Data bits port parameter */
+	/**
+	* Data bits port parameter 
+	**/
+	
 	private int dataBits=DATABITS_8;
+	
 	/** 
-	*  @return int representing the databits
-	*/
+	*	@return int representing the databits
+	**/
 	public int getDataBits()
 	{
 		if (debug)
-			z.reportln( "RXTXPort:getDataBits() called and returning " + dataBits);
+			System.out.println("RXTXPort:getDataBits(" + dataBits + ")");
 		return dataBits;
 	}
 
 	/** Stop bits port parameter */
 	private int stopBits=SerialPort.STOPBITS_1;
+	
 	/** 
-	*  @return int representing the stopbits
-	*/
+	*	@return int representing the stopbits
+	**/
 	public int getStopBits()
 	{
-		if (debug)
-			z.reportln( "RXTXPort:getStopBits() called and returning " + stopBits);
+		if (debug) System.out.println( 
+			"RXTXPort:getStopBits(" + stopBits + ")"
+		);
 		return stopBits;
 	}
 
 	/** Parity port parameter */
 	private int parity= SerialPort.PARITY_NONE;
+	
 	/** 
-	*  @return int representing the parity
-	*/
+	*	@return int representing the parity
+	**/
 	public int getParity()
 	{
-		if (debug)
-			z.reportln( "RXTXPort:getParity() called and returning " + parity );
+		if (debug) System.out.println(
+			"RXTXPort:getParity(" + parity +")"
+		);
+		
 		return parity;
 	}
 
 
 	/** Flow control */
 	private int flowmode = SerialPort.FLOWCONTROL_NONE;
+	
 	/** 
-	*  @param  flowcontrol FLOWCONTROL_NONE is default
-	*  @see gnu.io.SerialPort#FLOWCONTROL_NONE
-	*/
+	*	@param  flowcontrol FLOWCONTROL_NONE is default
+	*	@see gnu.io.SerialPort#FLOWCONTROL_NONE
+	**/
 	public void setFlowControlMode( int flowcontrol )
 	{
-		if (debug)
-			z.reportln( "RXTXPort:setFlowControlMode( " + flowcontrol + " ) called");
+		if (debug) System.out.println(
+			"RXTXPort:setFlowControlMode(" + flowcontrol + ")"
+		);
+		
 		if(monThreadisInterrupted) 
 		{
-			if( debug_events )
-				z.reportln(  "RXTXPort:setFlowControlMode MonThread is Interrupeted returning" );
+			if (debug_events) System.out.println(
+				"RXTXPort:setFlowControlMode:MonThread Interrupted"
+			);
+			
 			return;
 		}
-		try {
+		
+		try 
+		{
 			setflowcontrol( flowcontrol );
 		}
 		catch( IOException e )
@@ -303,61 +404,75 @@ final public class RXTXPort extends Seri
 			e.printStackTrace();
 			return;
 		}
+		
 		flowmode=flowcontrol;
-		if (debug)
-			z.reportln( "RXTXPort:setFlowControlMode( " + flowcontrol + " ) returning");
+		
+		if (debug) System.out.println(
+			"RXTXPort:setFlowControlMode(" + flowcontrol + " ):Exit"
+		);
 	}
+	
 	/** 
-	*  @return  int representing the flowmode
-	*/
+	*	@return  int representing the flowmode
+	**/
 	public int getFlowControlMode()
 	{
-		if (debug)
-			z.reportln( "RXTXPort:getFlowControlMode() returning " + flowmode );
+		if (debug) System.out.println(
+			"RXTXPort:getFlowControlMode(" + flowmode + ")"
+		);
+		
 		return flowmode;
 	}
+	
 	native void setflowcontrol( int flowcontrol ) throws IOException;
 
 
-	/*
-	linux/drivers/char/n_hdlc.c? FIXME
-		taj@www.linux.org.uk
-	*/
 	/**
-	*  Receive framing control
-	*  @param  f framming
-	*  @throws UnsupportedCommOperationException
-	*/
+	*	linux/drivers/char/n_hdlc.c? FIXME
+	*	taj@www.linux.org.uk
+	**/
+	
+	/**
+	*	Receive framing control
+	*	@param	f framming
+	*	@throws	UnsupportedCommOperationException
+	**/
 	public void enableReceiveFraming( int f )
-		throws UnsupportedCommOperationException
+	throws UnsupportedCommOperationException
 	{
-		if (debug)
-			z.reportln( "RXTXPort:enableReceiveFramming() throwing exception");
-		throw new UnsupportedCommOperationException( "Not supported" );
+		if (debug) System.out.println(
+			"RXTXPort:enableReceiveFramming() throwing exception"
+		);
+		
+		throw new UnsupportedCommOperationException("Not supported" );
 	}
-	/** 
-	*/
+	
 	public void disableReceiveFraming()
 	{
-		if (debug)
-			z.reportln( "RXTXPort:disableReceiveFramming() called and returning (noop)");
+		if (debug) System.out.println(
+			"RXTXPort:disableReceiveFramming()"
+		);
 	}
+	
 	/** 
-	*  @return true if framing is enabled
-	*/
+	*	@return true if framing is enabled
+	**/
 	public boolean isReceiveFramingEnabled()
 	{
-		if (debug)
-			z.reportln( "RXTXPort:isReceiveFrammingEnabled() called and returning " + false );
+		if (debug) System.out.println(
+			"RXTXPort:isReceiveFrammingEnabled(" + false +")"
+		);
 		return false;
 	}
 	/** 
-	*  @return  int representing the framing byte
-	*/
+	*	@return  int representing the framing byte
+	**/
 	public int getReceiveFramingByte()
 	{
-		if (debug)
-			z.reportln( "RXTXPort:getReceiveFrammingByte() called and returning " + 0 );
+		if (debug) System.out.println(
+			"RXTXPort:getReceiveFrammingByte(0)" 
+		);
+		
 		return 0;
 	}
 
@@ -366,38 +481,49 @@ final public class RXTXPort extends Seri
 	private int timeout;
 
 	/** 
-	*  @return  int the timeout
-	*/
+	*	@return  int the timeout
+	**/
 	public native int NativegetReceiveTimeout();
+	
 	/** 
-	*  @return  bloolean true if recieve timeout is enabled
-	*/
+	*	@return  bloolean true if recieve timeout is enabled
+	**/
 	private native boolean NativeisReceiveTimeoutEnabled();
+	
 	/** 
-	*  @param  time
-	*  @param  threshold
-	*  @param  InputBuffer
-	*/
-	private native void NativeEnableReceiveTimeoutThreshold(int time,
-		int threshold,int InputBuffer);
-	/** 
-	*/
+	*	@param  time
+	*	@param  threshold
+	*	@param  InputBuffer
+	**/
+	private native void NativeEnableReceiveTimeoutThreshold(
+		int time,
+		int threshold,
+		int InputBuffer
+	);
+	
 	public void disableReceiveTimeout()
 	{
-		if (debug)
-			z.reportln( "RXTXPort:disableReceiveTimeout() called");
+		if (debug) System.out.println(
+			"RXTXPort:disableReceiveTimeout()"
+		);
+		
 		timeout = -1;
+		
 		NativeEnableReceiveTimeoutThreshold( timeout , threshold, InputBuffer );
-		if (debug)
-			z.reportln( "RXTXPort:disableReceiveTimeout() returning");
+		
+		if (debug) System.out.println(
+			"RXTXPort:disableReceiveTimeout:Exit"
+		);
 	}
+	
 	/** 
-	*  @param time
-	*/
+	*	@param time
+	**/
 	public void enableReceiveTimeout( int time )
 	{
 		if (debug)
-			z.reportln( "RXTXPort:enableReceiveTimeout() called");
+			System.out.println("RXTXPort:enableReceiveTimeout(" + time + ")");
+			
 		if( time >= 0 )
 		{
 			timeout = time;
@@ -411,25 +537,26 @@ final public class RXTXPort extends Seri
 				"Unexpected negative timeout value"
 			);
 		}
+		
 		if (debug)
-			z.reportln( "RXTXPort:enableReceiveTimeout() returning");
+			System.out.println("RXTXPort:enableReceiveTimeout:Exit");
 	}
 	/** 
-	*  @return  boolean true if recieve timeout is enabled
-	*/
+	*	@return  boolean true if recieve timeout is enabled
+	**/
 	public boolean isReceiveTimeoutEnabled()
 	{
 		if (debug)
-			z.reportln( "RXTXPort:isReceiveTimeoutEnabled() called and returning " + NativeisReceiveTimeoutEnabled() );
+			System.out.println("RXTXPort:isReceiveTimeoutEnabled:Exit" + NativeisReceiveTimeoutEnabled() );
 		return( NativeisReceiveTimeoutEnabled() );
 	}
 	/** 
-	*  @return  int the timeout
-	*/
+	*	@return  int the timeout
+	**/
 	public int getReceiveTimeout()
 	{
 		if (debug)
-			z.reportln( "RXTXPort:getReceiveTimeout() called and returning " + NativegetReceiveTimeout() );
+			System.out.println("RXTXPort:getReceiveTimeout:Exit" + NativegetReceiveTimeout() );
 		return(NativegetReceiveTimeout( ));
 	}
 
@@ -438,12 +565,12 @@ final public class RXTXPort extends Seri
 	private int threshold = 0;
 
 	/** 
-	*  @param thresh threshold
-	*/
+	*	@param thresh threshold
+	**/
 	public void enableReceiveThreshold( int thresh )
 	{
 		if (debug)
-			z.reportln( "RXTXPort:enableReceiveThreshold( " + thresh + " ) called");
+			System.out.println("RXTXPort:enableReceiveThreshold(" + thresh + " ) called");
 		if(thresh >=0)
 		{
 			threshold=thresh;
@@ -458,32 +585,32 @@ final public class RXTXPort extends Seri
 			);
 		}
 		if (debug)
-			z.reportln( "RXTXPort:enableReceiveThreshold( " + thresh + " ) returned");
+			System.out.println("RXTXPort:enableReceiveThreshold(" + thresh + " ) returned");
 	}
 	/** 
-	*/
+	**/
 	public void disableReceiveThreshold()
 	{
 		if (debug)
-			z.reportln( "RXTXPort:disableReceiveThreshold() called and returning");
+			System.out.println("RXTXPort:disableReceiveThreshold:Exit");
 		enableReceiveThreshold(0);
 	}
 	/** 
-	*  @return  int the recieve threshold
-	*/
+	*	@return  int the recieve threshold
+	**/
 	public int getReceiveThreshold()
 	{
 		if (debug)
-			z.reportln( "RXTXPort:getReceiveThreshold() called and returning " + threshold);
+			System.out.println("RXTXPort:getReceiveThreshold:Exit" + threshold);
 		return threshold;
 	}
 	/** 
-	*  @return  boolean true if receive threshold is enabled
-	*/
+	*	@return  boolean true if receive threshold is enabled
+	**/
 	public boolean isReceiveThresholdEnabled()
 	{
 		if (debug)
-			z.reportln( "RXTXPort:isReceiveThresholdEnable() called and returning" + (threshold > 0) );
+			System.out.println("RXTXPort:isReceiveThresholdEnable:Exit" + (threshold > 0) );
 		return(threshold>0);
 	}
 
@@ -493,16 +620,17 @@ final public class RXTXPort extends Seri
 		taj@www.linux.org.uk
 
 		These are native stubs...
-	*/
+	**/
 	private int InputBuffer=0;
 	private int OutputBuffer=0;
+	
 	/** 
-	*  @param size
-	*/
+	*	@param size
+	**/
 	public void setInputBufferSize( int size )
 	{
 		if (debug)
-			z.reportln( "RXTXPort:setInputBufferSize( " +
+			System.out.println("RXTXPort:setInputBufferSize(" +
 					size + ") called");
 		if( size < 0 )
 			throw new IllegalArgumentException
@@ -511,103 +639,139 @@ final public class RXTXPort extends Seri
 			);
 		else InputBuffer=size;
 		if (debug)
-			z.reportln( "RXTXPort:setInputBufferSize( " +
+			System.out.println("RXTXPort:setInputBufferSize(" +
 					size + ") returning");
 	}
-	/** 
-	*/
+
 	public int getInputBufferSize()
 	{
-		if (debug)
-			z.reportln( "RXTXPort:getInputBufferSize() called and returning " + InputBuffer );
+		if (debug) System.out.println(
+			"RXTXPort:getInputBufferSize(" + InputBuffer +")"
+		);
 		return(InputBuffer);
 	}
+	
 	/** 
-	*  @param size
-	*/
+	*	@param size
+	**/
 	public void setOutputBufferSize( int size )
 	{
-		if (debug)
-			z.reportln( "RXTXPort:setOutputBufferSize( " +
-					size + ") called");
+		if (debug) System.out.println(
+			"RXTXPort:setOutputBufferSize(" + size + ") called"
+		);
+		
 		if( size < 0 )
-			throw new IllegalArgumentException
-			(
-				"Unexpected negative buffer size value"
-			);
-		else OutputBuffer=size;
-		if (debug)
-			z.reportln( "RXTXPort:setOutputBufferSize( " +
-					size + ") returned");
+		{
+		throw new IllegalArgumentException
+		(
+			"Unexpected negative buffer size value"
+		);
+		}
+		else
+		{
+			OutputBuffer=size;
+		}
+		
+		if (debug) System.out.println(
+			"RXTXPort:setOutputBufferSize(" + size + "):Exit"
+		);
 		
 	}
+
 	/** 
-	*  @return  in the output buffer size
-	*/
+	*	@return  in the output buffer size
+	**/
 	public int getOutputBufferSize()
 	{
-		if (debug)
-			z.reportln( "RXTXPort:getOutputBufferSize() called and returning " + OutputBuffer );
+		if (debug) System.out.println(
+			"RXTXPort:getOutputBufferSize(" + OutputBuffer + ")"
+		);
 		return(OutputBuffer);
 	}
 
-	/* =================== cleaned messages to here */
+	/**
+	*	=================== cleaned messages to here
+	**/
 
 	/**
-	*  Line status methods
-	*/
+	*	Line status methods
+	**/
 	/**
-	*  @return true if DTR is set
-	*/
+	*	@return true if DTR is set
+	**/
 	public native boolean isDTR();
+	
 	/** 
-	*  @param state
-	*/
+	*	@param state
+	**/
 	public native void setDTR( boolean state );
+	
 	/** 
-	*  @param state
-	*/
+	*	@param state
+	**/
 	public native void setRTS( boolean state );
 	private native void setDSR( boolean state );
+	
 	/** 
-	*  @return boolean true if CTS is set
-	*/
+	*	@return boolean true if CTS is set
+	**/
 	public native boolean isCTS();
 	/** 
-	*  @return boolean true if DSR is set
-	*/
+	*	@return boolean true if DSR is set
+	**/
 	public native boolean isDSR();
 	/** 
-	*  @return boolean true if CD is set
-	*/
+	*	@return boolean true if CD is set
+	**/
 	public native boolean isCD();
 	/** 
-	*  @return boolean true if RI is set
-	*/
+	*	@return boolean true if RI is set
+	**/
 	public native boolean isRI();
 	/** 
-	*  @return boolean true if RTS is set
-	*/
+	*	@return boolean true if RTS is set
+	**/
 	public native boolean isRTS();
 
 
 	/**
-	*  Write to the port
-	*  @param duration
-	*/
+	*	Write to the port
+	*	@param duration
+	**/
 	public native void sendBreak( int duration );
-	protected native void writeByte( int b, boolean i ) throws IOException;
-	protected native void writeArray( byte b[], int off, int len, boolean i )
-		throws IOException;
-	protected native boolean nativeDrain( boolean i ) throws IOException;
+	
+	protected native void writeByte(
+		int b,
+		boolean i
+	) throws IOException;
+	
+	protected native void writeArray(
+		byte b[],
+		int off,
+		int len,
+		boolean i
+	) throws IOException;
+	
+	protected native boolean nativeDrain(
+		boolean i
+	) throws IOException;
 
 	/** RXTXPort read methods */
 	protected native int nativeavailable() throws IOException;
 	protected native int readByte() throws IOException;
-	protected native int readArray( byte b[], int off, int len )
-		throws IOException;
-	protected native int readTerminatedArray( byte b[], int off, int len, byte t[] )
-		throws IOException;
+	
+	protected native int readArray(
+		byte b[],
+		int off,
+		int len
+	) throws IOException;
+		
+	protected native int readTerminatedArray(
+		byte b[],
+		int off,
+		int len,
+		byte t[]
+	) throws IOException;
 
 
 	/** Serial Port Event listener */
@@ -620,37 +784,43 @@ final public class RXTXPort extends Seri
 	native void eventLoop();
 
 	/** 
-	*  @return boolean  true if monitor thread is interrupted
-	*/
+	*	@return boolean  true if monitor thread is interrupted
+	**/
 	boolean monThreadisInterrupted=true;
-	private native void interruptEventLoop( );
+	
+	private native void interruptEventLoop();
+	
 	public boolean checkMonitorThread()
 	{
-		if (debug)
-			z.reportln( "RXTXPort:checkMonitorThread()");
+		if (debug) System.out.println("RXTXPort:checkMonitorThread()");
 		if(monThread != null)
 		{
-			if ( debug )
-				z.reportln( 
-					"monThreadisInterrupted = " +
-					monThreadisInterrupted );
+			if (debug) System.out.println( 
+				" monThreadisInterrupted = " + monThreadisInterrupted
+			);
+			
 			return monThreadisInterrupted;
 		}
-		if ( debug )
-			z.reportln(  "monThread is null " );
+		
+		if ( debug ) System.out.println(
+			"RXTXPort:checkMonitorThread(null):Exit"
+		);
+			
 		return(true);
 	}
 
 	/** 
-	*  @param event
-	*  @param state
-	*  @return boolean true if the port is closing
-	*/
+	*	@param event
+	*	@param state
+	*	@return boolean true if the port is closing
+	**/
 	public boolean sendEvent( int event, boolean state )
 	{
 		if (debug_events)
-			z.report( "RXTXPort:sendEvent(");
-		/* Let the native side know its time to die */
+			z.report("RXTXPort:sendEvent(");
+		/**
+		*	Let the native side know its time to die
+		**/
 
 		if ( fd == 0 || SPEventListener == null || monThread == null)
 		{
@@ -661,63 +831,63 @@ final public class RXTXPort extends Seri
 		{
 			case SerialPortEvent.DATA_AVAILABLE:
 				if( debug_events )
-					z.reportln( "DATA_AVAILABLE " +
+					System.out.println(" DATA_AVAILABLE " +
 						monThread.Data + ")" );
 				break;
 			case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
 				if( debug_events )
-					z.reportln( 
-						"OUTPUT_BUFFER_EMPTY " +
+					System.out.println( 
+						" OUTPUT_BUFFER_EMPTY " +
 						monThread.Output + ")" );
 				break;
 			case SerialPortEvent.CTS:
 				if( debug_events )
-					z.reportln( "CTS " +
+					System.out.println(" CTS " +
 						monThread.CTS + ")" );
 				break;
 			case SerialPortEvent.DSR:
 				if( debug_events )
-					z.reportln( "DSR " +
+					System.out.println(" DSR " +
 						monThread.Output + ")" );
 				break;
 			case SerialPortEvent.RI:
 				if( debug_events )
-					z.reportln( "RI " +
+					System.out.println(" RI " +
 						monThread.RI + ")" );
 				break;
 			case SerialPortEvent.CD:
 				if( debug_events )
-					z.reportln( "CD " +
+					System.out.println(" CD " +
 						monThread.CD + ")" );
 				break;
 			case SerialPortEvent.OE:
 				if( debug_events )
-					z.reportln( "OE " +
+					System.out.println(" OE " +
 						monThread.OE + ")" );
 				break;
 			case SerialPortEvent.PE:
 				if( debug_events )
-					z.reportln( "PE " +
+					System.out.println(" PE " +
 						monThread.PE + ")" );
 				break;
 			case SerialPortEvent.FE:
 				if( debug_events )
-					z.reportln( "FE " +
+					System.out.println(" FE " +
 						monThread.FE + ")" );
 				break;
 			case SerialPortEvent.BI:
 				if( debug_events )
-					z.reportln( "BI " +
+					System.out.println(" BI " +
 						monThread.BI + ")" );
 				break;
 			default:
 				if( debug_events )
-					z.reportln( "XXXXXXXXXXXXXX " +
+					System.out.println(" XXXXXXXXXXXXXX (" +
 						event + ")" );
 				break;
 		}
 		if( debug_events && debug_verbose )
-			z.reportln(  "	checking flags " );
+			System.out.println(  "	checking flags " );
 
 		switch( event )
 		{
@@ -752,19 +922,19 @@ final public class RXTXPort extends Seri
 				if( monThread.BI ) break;
 				return(false);
 			default:
-				System.err.println( "unknown event: " + event);
+				System.err.println(" unknown event: " + event);
 				return(false);
 		}
 		if( debug_events && debug_verbose )
-			z.reportln(  "	getting event" );
+			System.out.println(  " getting event" );
 		SerialPortEvent e = new SerialPortEvent(this, event, !state,
 			state );
 		if( debug_events && debug_verbose )
-			z.reportln(  "	sending event" );
+			System.out.println(  " sending event" );
 		if(monThreadisInterrupted) 
 		{
 			if( debug_events )
-				z.reportln(  "	sendEvent return" );
+				System.out.println(  " sendEvent return" );
 			return(true);
 		}
 		if( SPEventListener != null )
@@ -773,7 +943,7 @@ final public class RXTXPort extends Seri
 		}
 
 		if( debug_events && debug_verbose )
-			z.reportln(  "	sendEvent return" );
+			System.out.println(  " sendEvent return" );
 
 		if (fd == 0 ||  SPEventListener == null || monThread == null) 
 		{
@@ -786,22 +956,22 @@ final public class RXTXPort extends Seri
 	}
 
 	/**
-	*  Add an event listener
-	*  @param lsnr SerialPortEventListener
-	*  @throws TooManyListenersException
-	*/
+	*	Add an event listener
+	*	@param lsnr SerialPortEventListener
+	*	@throws TooManyListenersException
+	**/
 
 	boolean MonitorThreadLock = true;
 
 	public void addEventListener(
 		SerialPortEventListener lsnr ) throws TooManyListenersException
 	{
-		/*  Don't let and notification requests happen until the
+		/*	Don't let and notification requests happen until the
 		    Eventloop is ready
-		*/
+		**/
 
 		if (debug)
-			z.reportln( "RXTXPort:addEventListener()");
+			System.out.println("RXTXPort:addEventListener()");
 		if( SPEventListener != null )
 		{
 			throw new TooManyListenersException();
@@ -816,54 +986,66 @@ final public class RXTXPort extends Seri
 			MonitorThreadAlive=true;
 		}
 		if (debug)
-			z.reportln( "RXTXPort:Interrupt=false");
+			System.out.println("RXTXPort:addEventListener:Exit");
 	}
+	
 	/**
-	*  Remove the serial port event listener
-	*/
+	*	Remove the serial port event listener
+	**/
 	public void removeEventListener()
 	{
 		if (debug)
-			z.reportln( "RXTXPort:removeEventListener() called");
+			System.out.println("RXTXPort:removeEventListener()");
+		
 		waitForTheNativeCodeSilly();
 		//if( monThread != null && monThread.isAlive() )
+		
 		if( monThreadisInterrupted == true )
 		{
-			z.reportln( "	RXTXPort:removeEventListener() already interrupted");
+			System.out.println(" already interrupted");
 			monThread = null;
 			SPEventListener = null;
 			return;
 		}
 		else if( monThread != null && monThread.isAlive() )
 		{
-			if (debug)
-				z.reportln( "	RXTXPort:Interrupt=true");
+			if (debug) System.out.println(" Interrupt=true");
 			monThreadisInterrupted=true;
-			/*
-			   Notify all threads in this PID that something is up
-			   They will call back to see if its their thread
-			   using isInterrupted().
-			*/
-			if (debug)
-				z.reportln( "	RXTXPort:calling interruptEventLoop");
-			interruptEventLoop( );
 			
-			if (debug)
-				z.reportln( "	RXTXPort:calling monThread.join()");
+			/**
+			*	Notify all threads in this PID that something is up
+			*	They will call back to see if its their thread
+			*	using isInterrupted().
+			**/
+			
+			if (debug) System.out.println(" RXTXPort:removeEventListener - interruptEventLoop");
+			/** 
+			* JCE - On FreeBSD 10.1-p9 this causes a Java Core Dump if port is closed before init sleep has completed
+			**/
+			interruptEventLoop();
+			
+			if (debug) System.out.println(" RXTXPort:removeEventListener - monThread.join()");
+			
 			try {
 
 				// wait a reasonable moment for the death of the monitor thread
 				monThread.join(3000);
-			} catch (InterruptedException ex) {
+				if (debug) System.out.println(" RXTXPort:removeEventListener - Post monThread.join()");	
+			} 
+			catch (InterruptedException ex) 
+			{
 				// somebody called interrupt() on us (ie wants us to abort)
 				// we dont propagate InterruptedExceptions so lets re-set the flag 
+				if (debug) System.out.println(" RXTXPort:removeEventListener - InterruptedException");	
 				Thread.currentThread().interrupt();
 				return;
  			}
+ 			
+			if (debug) System.out.println(" RXTXPort:removeEventListener - Waited!");	
 				
 			if ( debug && monThread.isAlive() )
 			{
-				z.reportln( "	MonThread is still alive!");
+				System.out.println(" MonThread is still alive!");
 
 			}
 			
@@ -873,7 +1055,7 @@ final public class RXTXPort extends Seri
 		MonitorThreadLock = false;
 		MonitorThreadAlive=false;
 		monThreadisInterrupted=true;
-		z.reportln( "RXTXPort:removeEventListener() returning");
+		if (debug) System.out.println("RXTXPort:removeEventListener:Exit");
 	}
 	/**
 	 *	Give the native code a chance to start listening to the hardware
@@ -894,15 +1076,15 @@ final public class RXTXPort extends Seri
 		}
 	}
 	/**
-	*  @param enable
-	*/
+	*	@param enable
+	**/
 	private native void nativeSetEventFlag( int fd, int event,
 						boolean flag );
 	public void notifyOnDataAvailable( boolean enable )
 	{
 		if (debug)
-			z.reportln( "RXTXPort:notifyOnDataAvailable( " +
-				enable+" )");
+			System.out.println("RXTXPort:notifyOnDataAvailable(" +
+				enable+")");
 		
 		waitForTheNativeCodeSilly();
 
@@ -911,155 +1093,172 @@ final public class RXTXPort extends Seri
 					enable );
 		monThread.Data = enable;
 		MonitorThreadLock = false;
+		if (debug)
+			System.out.println("RXTXPort:notifyOnDataAvailable:Exit");
+		
 	}
 
 	/**
-	*  @param enable
-	*/
+	*	@param enable
+	**/
 	public void notifyOnOutputEmpty( boolean enable )
 	{
 		if (debug)
-			z.reportln( "RXTXPort:notifyOnOutputEmpty( " +
-				enable+" )");
+			System.out.println("RXTXPort:notifyOnOutputEmpty(" +
+				enable+")");
 		waitForTheNativeCodeSilly();
 		MonitorThreadLock = true;
 		nativeSetEventFlag( fd, SerialPortEvent.OUTPUT_BUFFER_EMPTY,
 					enable );
 		monThread.Output = enable;
 		MonitorThreadLock = false;
+		if (debug)
+			System.out.println("RXTXPort:notifyOnOutputEmpty:Exit");
+
 	}
 
 	/**
-	*  @param enable
-	*/
+	*	@param enable
+	**/
 	public void notifyOnCTS( boolean enable )
 	{
-		if (debug)
-			z.reportln( "RXTXPort:notifyOnCTS( " +
-				enable+" )");
+		if (debug) System.out.println("RXTXPort:notifyOnCTS(" + enable+")");
 		waitForTheNativeCodeSilly();
 		MonitorThreadLock = true;
 		nativeSetEventFlag( fd, SerialPortEvent.CTS, enable );
 		monThread.CTS = enable;
 		MonitorThreadLock = false;
+		if (debug) System.out.println("RXTXPort:notifyOnCTS:Exit");
 	}
 	/**
-	*  @param enable
-	*/
+	*	@param enable
+	**/
 	public void notifyOnDSR( boolean enable )
 	{
-		if (debug)
-			z.reportln( "RXTXPort:notifyOnDSR( " +
-				enable+" )");
+		if (debug) System.out.println("RXTXPort:notifyOnDSR(" + enable+")");
 		waitForTheNativeCodeSilly();
 		MonitorThreadLock = true;
 		nativeSetEventFlag( fd, SerialPortEvent.DSR, enable );
 		monThread.DSR = enable;
 		MonitorThreadLock = false;
+		if (debug) System.out.println("RXTXPort:notifyOnDSR:Exit");
 	}
 	/**
-	*  @param enable
-	*/
+	*	@param enable
+	**/
 	public void notifyOnRingIndicator( boolean enable )
 	{
-		if (debug)
-			z.reportln( "RXTXPort:notifyOnRingIndicator( " +
-				enable+" )");
+		if (debug) System.out.println("RXTXPort:notifyOnRingIndicator(" +
+			enable+")");
+				
 		waitForTheNativeCodeSilly();
 		MonitorThreadLock = true;
 		nativeSetEventFlag( fd, SerialPortEvent.RI, enable );
 		monThread.RI = enable;
 		MonitorThreadLock = false;
+		if (debug) System.out.println("RXTXPort:notifyOnRingIndicator:Exit");
 	}
 	/**
-	*  @param enable
-	*/
+	*	@param enable
+	**/
 	public void notifyOnCarrierDetect( boolean enable )
 	{
 		if (debug)
-			z.reportln( "RXTXPort:notifyOnCarrierDetect( " +
-				enable+" )");
+			System.out.println("RXTXPort:notifyOnCarrierDetect(" +
+				enable+")");
 		waitForTheNativeCodeSilly();
 		MonitorThreadLock = true;
 		nativeSetEventFlag( fd, SerialPortEvent.CD, enable );
 		monThread.CD = enable;
 		MonitorThreadLock = false;
+		if (debug)
+			System.out.println("RXTXPort:notifyOnCarrierDetect:Exit");
 	}
 	/**
-	*  @param enable
-	*/
+	*	@param enable
+	**/
 	public void notifyOnOverrunError( boolean enable )
 	{
 		if (debug)
-			z.reportln( "RXTXPort:notifyOnOverrunError( " +
-				enable+" )");
+			System.out.println("RXTXPort:notifyOnOverrunError(" +
+				enable+")");
 		waitForTheNativeCodeSilly();
 		MonitorThreadLock = true;
 		nativeSetEventFlag( fd, SerialPortEvent.OE, enable );
 		monThread.OE = enable;
 		MonitorThreadLock = false;
+		if (debug)
+			System.out.println("RXTXPort:notifyOnOverrunError:Exit");
 	}
+	
 	/**
-	*  @param enable
-	*/
+	*	@param enable
+	**/
 	public void notifyOnParityError( boolean enable )
 	{
 		if (debug)
-			z.reportln( "RXTXPort:notifyOnParityError( " +
-				enable+" )");
+			System.out.println("RXTXPort:notifyOnParityError(" +
+				enable+")");
 		waitForTheNativeCodeSilly();
 		MonitorThreadLock = true;
 		nativeSetEventFlag( fd, SerialPortEvent.PE, enable );
 		monThread.PE = enable;
 		MonitorThreadLock = false;
+		if (debug)
+			System.out.println("RXTXPort:notifyOnParityError:Exit");
 	}
 	/**
-	*  @param enable
-	*/
+	*	@param enable
+	**/
 	public void notifyOnFramingError( boolean enable )
 	{
-		if (debug)
-			z.reportln( "RXTXPort:notifyOnFramingError( " +
-				enable+" )");
+		if (debug) System.out.println("RXTXPort:notifyOnFramingError(" +
+			enable+")");
 		waitForTheNativeCodeSilly();
 		MonitorThreadLock = true;
 		nativeSetEventFlag( fd, SerialPortEvent.FE, enable );
 		monThread.FE = enable;
 		MonitorThreadLock = false;
+		if (debug) System.out.println("RXTXPort:notifyOnFramingError:Exit");
 	}
 	/**
-	*  @param enable
-	*/
+	*	@param enable
+	**/
 	public void notifyOnBreakInterrupt( boolean enable )
 	{
 		if (debug)
-			z.reportln( "RXTXPort:notifyOnBreakInterrupt( " +
-				enable+" )");
+			System.out.println("RXTXPort:notifyOnBreakInterrupt(" +
+				enable+")");
 		waitForTheNativeCodeSilly();
 		MonitorThreadLock = true;
 		nativeSetEventFlag( fd, SerialPortEvent.BI, enable );
 		monThread.BI = enable;
 		MonitorThreadLock = false;
+		System.out.println("RXTXPort:notifyOnBreakInterrupt:Exit");
 	}
 
 	/** Close the port */
 	private native void nativeClose( String name );
 	/**
-	*/
+	**/
 	boolean closeLock = false;
 	public void close()
 	{
-		synchronized (this) {
-			if (debug)
-				z.reportln( "RXTXPort:close( " + this.name + " )"); 
-
+		if (debug) System.out.println("RXTXPort:close(" + this.name + ")");
+		
+		synchronized (this) 
+		{
+		
 			while( IOLocked > 0 )
 			{
-				if( debug )
-					z.reportln("IO is locked " + IOLocked);
-				try {
+				if (debug) System.out.println("IO is locked " + IOLocked);
+				
+				try 
+				{
 					this.wait(500);
-				} catch( InterruptedException ie ) {
+				}
+				catch( InterruptedException ie )
+				{
 					// somebody called interrupt() on us
 					// we obbey and return without without closing the socket
 					Thread.currentThread().interrupt();
@@ -1075,55 +1274,62 @@ final public class RXTXPort extends Seri
 
 		if ( fd <= 0 )
 		{
-			z.reportln(  "RXTXPort:close detected bad File Descriptor" );
+			System.out.println(  "RXTXPort:close detected bad File Descriptor" );
 			return;
 		}
+		
 		setDTR(false);
 		setDSR(false);
+		
 		if (debug)
-			z.reportln( "RXTXPort:close( " + this.name + " ) setting monThreadisInterrupted"); 
+			System.out.println("RXTXPort:close(" + this.name + ") setting monThreadisInterrupted"); 
+			
 		if ( ! monThreadisInterrupted )
 		{
 			removeEventListener();
 		}
+		
 		if (debug)
-			z.reportln( "RXTXPort:close( " + this.name + " ) calling nativeClose"); 
+			System.out.println("RXTXPort:close(" + this.name + ") calling nativeClose"); 
 		nativeClose( this.name );
+		
 		if (debug)
-			z.reportln( "RXTXPort:close( " + this.name + " ) calling super.close"); 
+			System.out.println("RXTXPort:close(" + this.name + ") calling super.close"); 
 		super.close();
+		
 		fd = 0;
 		closeLock = false;
 		if (debug)
-			z.reportln( "RXTXPort:close( " + this.name + " ) leaving"); 
+			System.out.println("RXTXPort:close(" + this.name + "):Exit"); 
 	}
 
 
 	/** Finalize the port */
 	protected void finalize()
 	{
-		if (debug)
-			z.reportln( "RXTXPort:finalize()");
+		if (debug) System.out.println("RXTXPort:finalize()");
 		if( fd > 0 )
 		{
 			if (debug)
-				z.reportln( "RXTXPort:calling close()");
+				System.out.println("RXTXPort:calling close()");
 			close();
 		}
 		z.finalize();
+		
+		if (debug) System.out.println("RXTXPort:finalize()");
 	}
 
 	/** Inner class for SerialOutputStream */
 	class SerialOutputStream extends OutputStream
 	{
 	/**
-	*  @param b
-	*  @throws IOException
-	*/
+	*	@param b
+	*	@throws IOException
+	**/
 		public void write( int b ) throws IOException
 		{
 			if (debug_write)
-				z.reportln( "RXTXPort:SerialOutputStream:write(int)");
+				System.out.println("RXTXPort:SerialOutputStream:write("+ b +")");
 			if( speed == 0 ) return;
 			if ( monThreadisInterrupted == true )
 			{
@@ -1140,7 +1346,7 @@ final public class RXTXPort extends Seri
 				}
 				writeByte( b, monThreadisInterrupted );
 				if (debug_write)
-					z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )");
+					System.out.println("RXTXPort:SerialOutputStream:write(" + b + "):Exit");
 			} finally {
 				synchronized (IOLockedMutex) {
 					IOLocked--;
@@ -1148,15 +1354,16 @@ final public class RXTXPort extends Seri
 			}
 		}
 	/**
-	*  @param b[]
-	*  @throws IOException
-	*/
+	*	@param b[]
+	*	@throws IOException
+	**/
 		public void write( byte b[] ) throws IOException
 		{
 			if (debug_write)
 			{
-				z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + b.length + ") "/* + new String(b)*/ );
+				System.out.println("RXTXPort:SerialOutputStream:write(" + b.length + ")" /* + new String(b)*/ );
 			}
+			
 			if( speed == 0 ) return;
 			if ( monThreadisInterrupted == true )
 			{
@@ -1170,7 +1377,7 @@ final public class RXTXPort extends Seri
 				waitForTheNativeCodeSilly();
 				writeArray( b, 0, b.length, monThreadisInterrupted );
 				if (debug_write)
-					z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length  +")");
+					System.out.println("RXTXPort:SerialOutputStream:write(" +b.length  +"):Exit");
 			} finally {
 				synchronized(IOLockedMutex) {
 					IOLocked--;
@@ -1179,14 +1386,19 @@ final public class RXTXPort extends Seri
 			
 		}
 	/**
-	*  @param b[]
-	*  @param off
-	*  @param len
-	*  @throws IOException
-	*/
+	*	@param b[]
+	*	@param off
+	*	@param len
+	*	@throws IOException
+	**/
 		public void write( byte b[], int off, int len )
 			throws IOException
 		{
+			if (debug_write)
+			{
+				System.out.println("RXTXPort:SerialOutputStream:write(o:" + off + " l:" + len + ") " /*+  new String(send) */ );
+			}
+			
 			if( speed == 0 ) return;
 			if( off + len  > b.length )
 			{
@@ -1197,10 +1409,7 @@ final public class RXTXPort extends Seri
 	 
 			byte send[] = new byte[len];
 			System.arraycopy( b, off, send, 0, len );
-			if (debug_write)
-			{
-				z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+  new String(send) */ );
-			}
+			
 			if ( fd == 0 ) throw new IOException();
 			if ( monThreadisInterrupted == true )
 			{
@@ -1214,7 +1423,7 @@ final public class RXTXPort extends Seri
 				waitForTheNativeCodeSilly();
 				writeArray( send, 0, len, monThreadisInterrupted );
 				if( debug_write )
-					z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") "  /*+ new String(send)*/ );
+					System.out.println("Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") "  /*+ new String(send)*/ );
 			} finally {
 				synchronized (IOLockedMutex) {
 					IOLocked--;
@@ -1222,17 +1431,17 @@ final public class RXTXPort extends Seri
 			}
 		}
 	/**
-	*/
+	**/
 		public void flush() throws IOException
 		{
 			if (debug)
-				z.reportln( "RXTXPort:SerialOutputStream:flush() enter");
+				System.out.println("RXTXPort:SerialOutputStream:flush()");
 			if( speed == 0 ) return;
 			if ( fd == 0 ) throw new IOException();
 			if ( monThreadisInterrupted == true )
 			{
 			if (debug)
-				z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted");
+				System.out.println("RXTXPort:SerialOutputStream:flush():Exit - Interrupted");
 				return;
 			}
 			synchronized(IOLockedMutex) {
@@ -1244,17 +1453,19 @@ final public class RXTXPort extends Seri
 				/* 
 				   this is probably good on all OS's but for now
 				   just sendEvent from java on Sol
-				*/
+				**/
 				if ( nativeDrain( monThreadisInterrupted ) )
 					sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true );
 				if (debug)
-					z.reportln( "RXTXPort:SerialOutputStream:flush() leave");
+					System.out.println("RXTXPort:SerialOutputStream:flush():EndTry");
 			}
 			finally
 			{
 				synchronized (IOLockedMutex) {
 					IOLocked--;
 				}
+				if (debug)
+					System.out.println("RXTXPort:SerialOutputStream:flush():Exit");
 			}
 		}
 	}
@@ -1263,42 +1474,42 @@ final public class RXTXPort extends Seri
 	class SerialInputStream extends InputStream
 	{
 	/**
-	*  @return int the int read
-	*  @throws IOException
-	*  @see java.io.InputStream
+	*	@return int the int read
+	*	@throws IOException
+	*	@see java.io.InputStream
 *
 *timeout threshold       Behavior
 *------------------------------------------------------------------------
 *0       0       blocks until 1 byte is available timeout > 0,
-*                threshold = 0, blocks until timeout occurs, returns -1
-*                on timeout
+*	              threshold = 0, blocks until timeout occurs, returns -1
+*	              on timeout
 *>0      >0      blocks until timeout, returns - 1 on timeout, magnitude
-*                of threshold doesn't play a role.
+*	              of threshold doesn't play a role.
 *0       >0      Blocks until 1 byte, magnitude of  threshold doesn't
-*                play a role
-	*/
+*	              play a role
+	**/
 		public synchronized int read() throws IOException
 		{
 			if (debug_read)
-				z.reportln( "RXTXPort:SerialInputStream:read() called");
+				System.out.println("RXTXPort:SerialInputStream:read()");
 			if ( fd == 0 ) throw new IOException();
 			if ( monThreadisInterrupted )
 			{
-				z.reportln( "+++++++++ read() monThreadisInterrupted" );
+				System.out.println("+++++++++ read() monThreadisInterrupted" );
 			}
 			synchronized (IOLockedMutex) {
 				IOLocked++;
 			}
 			try {
 				if (debug_read_results)
-					z.reportln(  "RXTXPort:SerialInputStream:read() L" );
+					System.out.println(  "RXTXPort:SerialInputStream:read() L" );
 				waitForTheNativeCodeSilly();
 				if (debug_read_results)
-					z.reportln(  "RXTXPort:SerialInputStream:read() N" );
+					System.out.println(  "RXTXPort:SerialInputStream:read() N" );
 				int result = readByte();
 				if (debug_read_results)
-					//z.reportln(  "RXTXPort:SerialInputStream:read() returns byte = " + result );
-					z.reportln(  "RXTXPort:SerialInputStream:read() returns" );
+					//System.out.println(  "RXTXPort:SerialInputStream:read() returns byte = " + result );
+					System.out.println(  "RXTXPort:SerialInputStream:read() returns" );
 				return( result );
 			}				
 			finally
@@ -1309,9 +1520,9 @@ final public class RXTXPort extends Seri
 			}
 		}
 	/**
-	*  @param b[]
-	*  @return int  number of bytes read
-	*  @throws IOException
+	*	@param b[]
+	*	@return int  number of bytes read
+	*	@throws IOException
 *
 *timeout threshold       Behavior
 *------------------------------------------------------------------------
@@ -1320,12 +1531,12 @@ final public class RXTXPort extends Seri
 *>0      >0      blocks until timeout or reads threshold bytes,
                  returns 0 on timeout
 *0       >0      blocks until reads threshold bytes
-	*/
+	**/
 		public synchronized int read( byte b[] ) throws IOException
 		{
 			int result;
 			if (debug_read)
-				z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + ") called");
+				System.out.println("RXTXPort:SerialInputStream:read(" + b.length + ") called");
 			if ( monThreadisInterrupted == true )
 			{
 				return(0);
@@ -1338,7 +1549,7 @@ final public class RXTXPort extends Seri
 				waitForTheNativeCodeSilly();
 				result = read( b, 0, b.length);
 				if (debug_read_results)
-					z.reportln(  "RXTXPort:SerialInputStream:read() returned " + result + " bytes" );
+					System.out.println(  "RXTXPort:SerialInputStream:read() returned " + result + " bytes" );
 				return( result );
 			}
 			finally
@@ -1353,11 +1564,11 @@ read(byte b[], int, int)
 Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputStream.html#read(byte[], int, int)
 */
 	/**
-	*  @param b[]
-	*  @param off
-	*  @param len
-	*  @return int  number of bytes read
-	*  @throws IOException
+	*	@param b[]
+	*	@param off
+	*	@param len
+	*	@return int  number of bytes read
+	*	@throws IOException
 *
 *timeout threshold       Behavior
 *------------------------------------------------------------------------
@@ -1367,12 +1578,12 @@ Documentation is at http://java.sun.com/
                  returns 0 on timeout
 *0       >0      blocks until either threshold # of bytes or len bytes,
                  whichever was lower.
-	*/
+	**/
 		public synchronized int read( byte b[], int off, int len )
 			throws IOException
 		{
 			if (debug_read)
-				z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") called" /*+ new String(b) */ );
+				System.out.println("RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") called" /*+ new String(b) */ );
 			int result;
 			/*
 			 * Some sanity checks
@@ -1380,24 +1591,24 @@ Documentation is at http://java.sun.com/
 			if ( fd == 0 )
 			{
 				if (debug_read)
-					z.reportln( "RXTXPort:SerialInputStream:read() fd == 0");
-				z.reportln("+++++++ IOException()\n");
+					System.out.println("RXTXPort:SerialInputStream:read() fd == 0");
+				System.out.println("+++++++ IOException()\n");
 				throw new IOException();
 			}
 
 			if( b==null )
 			{
-				z.reportln("+++++++ NullPointerException()\n");
+				System.out.println("+++++++ NullPointerException()\n");
 				if (debug_read)
-					z.reportln( "RXTXPort:SerialInputStream:read() b == 0");
+					System.out.println("RXTXPort:SerialInputStream:read() b == 0");
 				throw new NullPointerException();
 			}
 
 			if( (off < 0) || (len < 0) || (off+len > b.length))
 			{
-				z.reportln("+++++++ IndexOutOfBoundsException()\n");
+				System.out.println("+++++++ IndexOutOfBoundsException()\n");
 				if (debug_read)
-					z.reportln( "RXTXPort:SerialInputStream:read() off < 0 ..");
+					System.out.println("RXTXPort:SerialInputStream:read() off < 0 ..");
 				throw new IndexOutOfBoundsException();
 			}
 
@@ -1407,7 +1618,7 @@ Documentation is at http://java.sun.com/
 			if( len==0 )
 			{
 				if (debug_read)
-					z.reportln( "RXTXPort:SerialInputStream:read() off < 0 ..");
+					System.out.println("RXTXPort:SerialInputStream:read() off < 0 ..");
 				return 0;
 			}
 			/*
@@ -1442,7 +1653,7 @@ Documentation is at http://java.sun.com/
 			if ( monThreadisInterrupted == true )
 			{
 				if (debug_read)
-					z.reportln( "RXTXPort:SerialInputStream:read() Interrupted");
+					System.out.println("RXTXPort:SerialInputStream:read() Interrupted");
 				return(0);
 			}
 			synchronized (IOLockedMutex) {
@@ -1453,7 +1664,7 @@ Documentation is at http://java.sun.com/
 				waitForTheNativeCodeSilly();
 				result = readArray( b, off, Minimum);
 				if (debug_read_results)
-					z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes"  /*+ new String(b) */);
+					System.out.println("RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes"  /*+ new String(b) */);
 				return( result );
 			}
 			finally
@@ -1465,12 +1676,12 @@ Documentation is at http://java.sun.com/
 		}
 
 	/**
-	*  @param b[]
-	*  @param off
-	*  @param len
-	*  @param t[]
-	*  @return int  number of bytes read
-	*  @throws IOException
+	*	@param b[]
+	*	@param off
+	*	@param len
+	*	@param t[]
+	*	@return int  number of bytes read
+	*	@throws IOException
 
 	   We are trying to catch the terminator in the native code
 	   Right now it is assumed that t[] is an array of 2 bytes.
@@ -1479,13 +1690,13 @@ Documentation is at http://java.sun.com/
 	   array will contain the terminator.  Otherwise read behavior should
 	   be the same as read( b[], off, len ).  Timeouts have not been well
 	   tested.
-	*/
+	**/
 
 		public synchronized int read( byte b[], int off, int len, byte t[] )
 			throws IOException
 		{
 			if (debug_read)
-				z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") called" /*+ new String(b) */ );
+				System.out.println("RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") called" /*+ new String(b) */ );
 			int result;
 			/*
 			 * Some sanity checks
@@ -1493,24 +1704,24 @@ Documentation is at http://java.sun.com/
 			if ( fd == 0 )
 			{
 				if (debug_read)
-					z.reportln( "RXTXPort:SerialInputStream:read() fd == 0");
-				z.reportln("+++++++ IOException()\n");
+					System.out.println("RXTXPort:SerialInputStream:read() fd == 0");
+				System.out.println("+++++++ IOException()\n");
 				throw new IOException();
 			}
 
 			if( b==null )
 			{
-				z.reportln("+++++++ NullPointerException()\n");
+				System.out.println("+++++++ NullPointerException()\n");
 				if (debug_read)
-					z.reportln( "RXTXPort:SerialInputStream:read() b == 0");
+					System.out.println("RXTXPort:SerialInputStream:read() b == 0");
 				throw new NullPointerException();
 			}
 
 			if( (off < 0) || (len < 0) || (off+len > b.length))
 			{
-				z.reportln("+++++++ IndexOutOfBoundsException()\n");
+				System.out.println("+++++++ IndexOutOfBoundsException()\n");
 				if (debug_read)
-					z.reportln( "RXTXPort:SerialInputStream:read() off < 0 ..");
+					System.out.println("RXTXPort:SerialInputStream:read() off < 0 ..");
 				throw new IndexOutOfBoundsException();
 			}
 
@@ -1520,7 +1731,7 @@ Documentation is at http://java.sun.com/
 			if( len==0 )
 			{
 				if (debug_read)
-					z.reportln( "RXTXPort:SerialInputStream:read() off < 0 ..");
+					System.out.println("RXTXPort:SerialInputStream:read() off < 0 ..");
 				return 0;
 			}
 			/*
@@ -1555,7 +1766,7 @@ Documentation is at http://java.sun.com/
 			if ( monThreadisInterrupted == true )
 			{
 				if (debug_read)
-					z.reportln( "RXTXPort:SerialInputStream:read() Interrupted");
+					System.out.println("RXTXPort:SerialInputStream:read() Interrupted");
 				return(0);
 			}
 			synchronized (IOLockedMutex) {
@@ -1566,7 +1777,7 @@ Documentation is at http://java.sun.com/
 				waitForTheNativeCodeSilly();
 				result = readTerminatedArray( b, off, Minimum, t );
 				if (debug_read_results)
-					z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes"  /*+ new String(b) */);
+					System.out.println("RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes"  /*+ new String(b) */);
 				return( result );
 			}
 			finally
@@ -1577,9 +1788,9 @@ Documentation is at http://java.sun.com/
 			}
 		}
 	/**
-	*  @return int bytes available
-	*  @throws IOException
-	*/
+	*	@return int bytes available
+	*	@throws IOException
+	**/
 		public synchronized int available() throws IOException
 		{
 			if ( monThreadisInterrupted == true )
@@ -1587,7 +1798,7 @@ Documentation is at http://java.sun.com/
 				return(0);
 			}
 			if ( debug_verbose )
-				z.reportln( "RXTXPort:available() called" );
+				System.out.println("RXTXPort:available() called" );
 			synchronized (IOLockedMutex) {
 				IOLocked++;
 			}
@@ -1595,7 +1806,7 @@ Documentation is at http://java.sun.com/
 			{
 				int r = nativeavailable();
 				if ( debug_verbose )
-					z.reportln( "RXTXPort:available() returning " +
+					System.out.println("RXTXPort:available() returning " +
 						r );
 				return r;
 			}
@@ -1608,7 +1819,7 @@ Documentation is at http://java.sun.com/
 		}
 	}
 	/**
-	*/
+	**/
 	class MonitorThread extends Thread
 	{
 	/** Note: these have to be separate boolean flags because the
@@ -1628,30 +1839,30 @@ Documentation is at http://java.sun.com/
 		MonitorThread() 
 		{
 			if (debug)
-				z.reportln( "RXTXPort:MontitorThread:MonitorThread()"); 
+				System.out.println("RXTXPort:MontitorThread:MonitorThread()"); 
 		}
 	/**
-	*  run the thread and call the event loop.
-	*/
+	*	run the thread and call the event loop.
+	**/
 		public void run()
 		{
 			if (debug)
-				z.reportln( "RXTXPort:MontitorThread:run()"); 
+				System.out.println("RXTXPort:MontitorThread:run()"); 
 			monThreadisInterrupted=false;
 			eventLoop();
 			if (debug)
-				z.reportln( "eventLoop() returned"); 
+				System.out.println("eventLoop() returned"); 
 		}
 		protected void finalize() throws Throwable 
 		{ 
 			if (debug)
-				z.reportln( "RXTXPort:MonitorThread exiting"); 
+				System.out.println("RXTXPort:MonitorThread exiting"); 
 		}
 	}
 	/**
-	*  A dummy method added so RXTX compiles on Kaffee
-	*  @deprecated deprecated but used in Kaffe 
-	*/
+	*	A dummy method added so RXTX compiles on Kaffee
+	*	@deprecated deprecated but used in Kaffe 
+	**/
 	public void setRcvFifoTrigger(int trigger){};  
 
 /*------------------------  END OF CommAPI -----------------------------*/
@@ -1724,542 +1935,542 @@ Documentation is at http://java.sun.com/
 		throws UnsupportedCommOperationException;
 
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  This is only accurate up to 38600 baud currently.
+	*	This is only accurate up to 38600 baud currently.
 	*
-	*  @param  port the name of the port thats been preopened
-	*  @return BaudRate on success
-	*  @throws UnsupportedCommOperationException;
-	*  This will not behave as expected with custom speeds
+	*	@param  port the name of the port thats been preopened
+	*	@return BaudRate on success
+	*	@throws UnsupportedCommOperationException;
+	*	This will not behave as expected with custom speeds
 	*
-	*/
+	**/
 	public static int staticGetBaudRate( String port )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln( 
-				"RXTXPort:staticGetBaudRate( " + port + " )");
+			System.out.println( 
+				"RXTXPort:staticGetBaudRate(" + port + ")");
 		return(nativeStaticGetBaudRate( port ));
 	}
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  @param  port the name of the port thats been preopened
-	*  @return DataBits on success
-	*  @throws UnsupportedCommOperationException;
+	*	@param  port the name of the port thats been preopened
+	*	@return DataBits on success
+	*	@throws UnsupportedCommOperationException;
 	*
-	*/
+	**/
 	public static int staticGetDataBits( String port )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln( 
-				"RXTXPort:staticGetDataBits( " + port + " )");
+			System.out.println( 
+				"RXTXPort:staticGetDataBits(" + port + ")");
 		return(nativeStaticGetDataBits( port ) );
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  @param  port the name of the port thats been preopened
-	*  @return Parity on success
-	*  @throws UnsupportedCommOperationException;
+	*	@param  port the name of the port thats been preopened
+	*	@return Parity on success
+	*	@throws UnsupportedCommOperationException;
 	*
-	*/
+	**/
 	public static int staticGetParity( String port )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln( 
-				"RXTXPort:staticGetParity( " + port + " )");
+			System.out.println( 
+				"RXTXPort:staticGetParity(" + port + ")");
 		return( nativeStaticGetParity( port ) );
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  @param  port the name of the port thats been preopened
-	*  @return StopBits on success
-	*  @throws UnsupportedCommOperationException;
+	*	@param  port the name of the port thats been preopened
+	*	@return StopBits on success
+	*	@throws UnsupportedCommOperationException;
 	*
-	*/
+	**/
 	public static int staticGetStopBits( String port )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln( 
-				"RXTXPort:staticGetStopBits( " + port + " )");
+			System.out.println( 
+				"RXTXPort:staticGetStopBits(" + port + ")");
 			return(nativeStaticGetStopBits( port ) );
 	}
 
 	/** 
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  Set the SerialPort parameters
-	*  1.5 stop bits requires 5 databits
-	*  @param  f filename
-	*  @param  b baudrate
-	*  @param  d databits
-	*  @param  s stopbits
-	*  @param  p parity
+	*	Set the SerialPort parameters
+	*	1.5 stop bits requires 5 databits
+	*	@param  f filename
+	*	@param  b baudrate
+	*	@param  d databits
+	*	@param  s stopbits
+	*	@param  p parity
 	*
-	*  @throws UnsupportedCommOperationException
-	*  @see gnu.io.UnsupportedCommOperationException
-	*/
+	*	@throws UnsupportedCommOperationException
+	*	@see gnu.io.UnsupportedCommOperationException
+	**/
 
 	public static void staticSetSerialPortParams( String f, int b, int d,
 		int s, int p )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln( 
-				"RXTXPort:staticSetSerialPortParams( " +
+			System.out.println( 
+				"RXTXPort:staticSetSerialPortParams(" +
 				f + " " + b + " " + d + " " + s + " " + p );
 		nativeStaticSetSerialPortParams( f, b, d, s, p );
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  Open the port and set DSR.  remove lockfile and do not close
-	*  This is so some software can appear to set the DSR before 'opening'
-	*  the port a second time later on.
+	*	Open the port and set DSR.  remove lockfile and do not close
+	*	This is so some software can appear to set the DSR before 'opening'
+	*	the port a second time later on.
 	*
-	*  @return true on success
-	*  @throws UnsupportedCommOperationException;
+	*	@return true on success
+	*	@throws UnsupportedCommOperationException;
 	*
-	*/
+	**/
 
 	public static boolean staticSetDSR( String port, boolean flag )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:staticSetDSR( " + port +
+			System.out.println(  "RXTXPort:staticSetDSR(" + port +
 						" " + flag );
 		return( nativeStaticSetDSR( port, flag ) );
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  Open the port and set DTR.  remove lockfile and do not close
-	*  This is so some software can appear to set the DTR before 'opening'
-	*  the port a second time later on.
+	*	Open the port and set DTR.  remove lockfile and do not close
+	*	This is so some software can appear to set the DTR before 'opening'
+	*	the port a second time later on.
 	*
-	*  @return true on success
-	*  @throws UnsupportedCommOperationException;
+	*	@return true on success
+	*	@throws UnsupportedCommOperationException;
 	*
-	*/
+	**/
 
 	public static boolean staticSetDTR( String port, boolean flag )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:staticSetDTR( " + port +
+			System.out.println(  "RXTXPort:staticSetDTR(" + port +
 						" " + flag );
 		return( nativeStaticSetDTR( port, flag ) );
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  Open the port and set RTS.  remove lockfile and do not close
-	*  This is so some software can appear to set the RTS before 'opening'
-	*  the port a second time later on.
+	*	Open the port and set RTS.  remove lockfile and do not close
+	*	This is so some software can appear to set the RTS before 'opening'
+	*	the port a second time later on.
 	*
-	*  @return none
-	*  @throws UnsupportedCommOperationException;
+	*	@return none
+	*	@throws UnsupportedCommOperationException;
 	*
-	*/
+	**/
 
 	public static boolean staticSetRTS( String port, boolean flag )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:staticSetRTS( " + port +
+			System.out.println(  "RXTXPort:staticSetRTS(" + port +
 						" " + flag );
 		return( nativeStaticSetRTS( port, flag ) );
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  find the fd and return RTS without using a Java open() call
+	*	find the fd and return RTS without using a Java open() call
 	*
-	*  @param port
-	*  @return true if asserted
-	*  @throws UnsupportedCommOperationException;
+	*	@param port
+	*	@return true if asserted
+	*	@throws UnsupportedCommOperationException;
 	*
-	*/
+	**/
 
 	public static boolean staticIsRTS( String port )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:staticIsRTS( " + port + " )" );
+			System.out.println(  "RXTXPort:staticIsRTS(" + port + ")" );
 		return( nativeStaticIsRTS( port ) );
 	}
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  find the fd and return CD without using a Java open() call
+	*	find the fd and return CD without using a Java open() call
 	*
-	*  @param port
-	*  @return true if asserted
-	*  @throws UnsupportedCommOperationException;
+	*	@param port
+	*	@return true if asserted
+	*	@throws UnsupportedCommOperationException;
 	*
-	*/
+	**/
 
 	public static boolean staticIsCD( String port )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln( "RXTXPort:staticIsCD( " + port + " )" );
+			System.out.println("RXTXPort:staticIsCD(" + port + ")" );
 		return( nativeStaticIsCD( port ) );
 	}
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  find the fd and return CTS without using a Java open() call
+	*	find the fd and return CTS without using a Java open() call
 	*
-	*  @param port
-	*  @return true if asserted
-	*  @throws UnsupportedCommOperationException;
+	*	@param port
+	*	@return true if asserted
+	*	@throws UnsupportedCommOperationException;
 	*
-	*/
+	**/
 
 	public static boolean staticIsCTS( String port )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:staticIsCTS( " + port + " )" );
+			System.out.println(  "RXTXPort:staticIsCTS(" + port + ")" );
 		return( nativeStaticIsCTS( port ) );
 	}
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  find the fd and return DSR without using a Java open() call
+	*	find the fd and return DSR without using a Java open() call
 	*
-	*  @param port
-	*  @return true if asserted
-	*  @throws UnsupportedCommOperationException;
+	*	@param port
+	*	@return true if asserted
+	*	@throws UnsupportedCommOperationException;
 	*
-	*/
+	**/
 
 	public static boolean staticIsDSR( String port )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:staticIsDSR( " + port + " )" );
+			System.out.println(  "RXTXPort:staticIsDSR(" + port + ")" );
 		return( nativeStaticIsDSR( port ) );
 	}
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  find the fd and return DTR without using a Java open() call
+	*	find the fd and return DTR without using a Java open() call
 	*
-	*  @param port
-	*  @return true if asserted
-	*  @throws UnsupportedCommOperationException;
+	*	@param port
+	*	@return true if asserted
+	*	@throws UnsupportedCommOperationException;
 	*
-	*/
+	**/
 
 	public static boolean staticIsDTR( String port )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:staticIsDTR( " + port + " )" );
+			System.out.println(  "RXTXPort:staticIsDTR(" + port + ")" );
 		return( nativeStaticIsDTR( port ) );
 	}
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
 	*
-	*  find the fd and return RI without using a Java open() call
+	*	find the fd and return RI without using a Java open() call
 	*
-	*  @param port
-	*  @return true if asserted
-	*  @throws UnsupportedCommOperationException;
+	*	@param port
+	*	@return true if asserted
+	*	@throws UnsupportedCommOperationException;
 	*
-	*/
+	**/
 
 	public static boolean staticIsRI( String port )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:staticIsRI( " + port + " )" );
+			System.out.println(  "RXTXPort:staticIsRI(" + port + ")" );
 		return( nativeStaticIsRI( port ) );
 	}
 
 
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
-	*  @return int the Parity Error Character
-	*  @throws UnsupportedCommOperationException;
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
+	*	@return int the Parity Error Character
+	*	@throws UnsupportedCommOperationException;
 	*
-	*  Anyone know how to do this in Unix?
-	*/
+	*	Anyone know how to do this in Unix?
+	**/
 
 	public byte getParityErrorChar( )
 		throws UnsupportedCommOperationException
 	{
 		byte ret;
 		if ( debug )
-			z.reportln(  "getParityErrorChar()" );
+			System.out.println(  "getParityErrorChar()" );
 		ret = nativeGetParityErrorChar();
 		if ( debug )
-			z.reportln(  "getParityErrorChar() returns " +
+			System.out.println(  "getParityErrorChar() returns " +
 						ret );
 		return( ret );
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
-	*  @param b Parity Error Character
-	*  @return boolean true on success
-	*  @throws UnsupportedCommOperationException;
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
+	*	@param b Parity Error Character
+	*	@return boolean true on success
+	*	@throws UnsupportedCommOperationException;
 	*
-	*  Anyone know how to do this in Unix?
-	*/
+	*	Anyone know how to do this in Unix?
+	**/
 
 	public boolean setParityErrorChar( byte b )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "setParityErrorChar(" + b + ")" );
+			System.out.println(  "setParityErrorChar(" + b + ")" );
 		return( nativeSetParityErrorChar( b ) );
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
-	*  @return int the End of Input Character
-	*  @throws UnsupportedCommOperationException;
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
+	*	@return int the End of Input Character
+	*	@throws UnsupportedCommOperationException;
 	*
-	*  Anyone know how to do this in Unix?
-	*/
+	*	Anyone know how to do this in Unix?
+	**/
 
 	public byte getEndOfInputChar( )
 		throws UnsupportedCommOperationException
 	{
 		byte ret;
 		if ( debug )
-			z.reportln(  "getEndOfInputChar()" );
+			System.out.println(  "getEndOfInputChar()" );
 		ret = nativeGetEndOfInputChar();
 		if ( debug )
-			z.reportln(  "getEndOfInputChar() returns " +
+			System.out.println(  "getEndOfInputChar() returns " +
 						ret );
 		return( ret );
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
-	*  @param b End Of Input Character
-	*  @return boolean true on success
-	*  @throws UnsupportedCommOperationException;
-	*/
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
+	*	@param b End Of Input Character
+	*	@return boolean true on success
+	*	@throws UnsupportedCommOperationException;
+	**/
 
 	public boolean setEndOfInputChar( byte b )
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "setEndOfInputChar(" + b + ")" );
+			System.out.println(  "setEndOfInputChar(" + b + ")" );
 		return( nativeSetEndOfInputChar( b ) );
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
-	*  @param type String representation of the UART type which mayb
-	*  be "none", "8250", "16450", "16550", "16550A", "16650", "16550V2"
-	*  or "16750".
-	*  @param test boolean flag to determin if the UART should be tested.
-	*  @return boolean true on success
-	*  @throws UnsupportedCommOperationException;
-	*/
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
+	*	@param type String representation of the UART type which mayb
+	*	be "none", "8250", "16450", "16550", "16550A", "16650", "16550V2"
+	*	or "16750".
+	*	@param test boolean flag to determin if the UART should be tested.
+	*	@return boolean true on success
+	*	@throws UnsupportedCommOperationException;
+	**/
 	public boolean setUARTType(String type, boolean test)
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:setUARTType()");
+			System.out.println(  "RXTXPort:setUARTType()");
 		return nativeSetUartType(type, test);
 	}
 	/**
-	*  Extension to CommAPI
-	*  This is an extension to CommAPI.  It may not be supported on
-	*  all operating systems.
-	*  @return type String representation of the UART type which mayb
-	*  be "none", "8250", "16450", "16550", "16550A", "16650", "16550V2"
-	*  or "16750".
-	*  @throws UnsupportedCommOperationException;
-	*/
+	*	Extension to CommAPI
+	*	This is an extension to CommAPI.  It may not be supported on
+	*	all operating systems.
+	*	@return type String representation of the UART type which mayb
+	*	be "none", "8250", "16450", "16550", "16550A", "16650", "16550V2"
+	*	or "16750".
+	*	@throws UnsupportedCommOperationException;
+	**/
 	public String getUARTType() throws UnsupportedCommOperationException
 	{
 		return nativeGetUartType();
 	}
 
 	/**
-	*  Extension to CommAPI.  Set Baud Base to 38600 on Linux and W32
-	*  before using.
-	*  @param BaudBase The clock frequency divided by 16.  Default
-	*  BaudBase is 115200.
-	*  @return true on success
-	*  @throws UnsupportedCommOperationException, IOException
-	*/
+	*	Extension to CommAPI.  Set Baud Base to 38600 on Linux and W32
+	*	before using.
+	*	@param BaudBase The clock frequency divided by 16.  Default
+	*	BaudBase is 115200.
+	*	@return true on success
+	*	@throws UnsupportedCommOperationException, IOException
+	**/
 
 	public boolean setBaudBase(int BaudBase)
 		throws UnsupportedCommOperationException,
 		IOException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:setBaudBase()");
+			System.out.println(  "RXTXPort:setBaudBase()");
 		return nativeSetBaudBase(BaudBase);
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  @return BaudBase
-	*  @throws UnsupportedCommOperationException, IOException
-	*/
+	*	Extension to CommAPI
+	*	@return BaudBase
+	*	@throws UnsupportedCommOperationException, IOException
+	**/
 
 	public int getBaudBase() throws UnsupportedCommOperationException,
 		IOException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:getBaudBase()");
+			System.out.println(  "RXTXPort:getBaudBase()");
 		return nativeGetBaudBase();
 	}
 
 	/**
-	*  Extension to CommAPI.  Set Baud Base to 38600 on Linux and W32
-	*  before using.
-	*  @param Divisor
-	*  @throws UnsupportedCommOperationException, IOException
-	*/
+	*	Extension to CommAPI.  Set Baud Base to 38600 on Linux and W32
+	*	before using.
+	*	@param Divisor
+	*	@throws UnsupportedCommOperationException, IOException
+	**/
 
 	public boolean setDivisor(int Divisor)
 		throws UnsupportedCommOperationException, IOException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:setDivisor()");
+			System.out.println(  "RXTXPort:setDivisor()");
 		return nativeSetDivisor(Divisor);
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  @return Divisor;
-	*  @throws UnsupportedCommOperationException, IOException
-	*/
+	*	Extension to CommAPI
+	*	@return Divisor;
+	*	@throws UnsupportedCommOperationException, IOException
+	**/
 
 	public int getDivisor() throws UnsupportedCommOperationException,
 		IOException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:getDivisor()");
+			System.out.println(  "RXTXPort:getDivisor()");
 		return nativeGetDivisor();
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  returns boolean true on success
-	*  @throws UnsupportedCommOperationException
-	*/
+	*	Extension to CommAPI
+	*	returns boolean true on success
+	*	@throws UnsupportedCommOperationException
+	**/
 
 	public boolean setLowLatency() throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:setLowLatency()");
+			System.out.println(  "RXTXPort:setLowLatency()");
 		return nativeSetLowLatency();
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  returns boolean true on success
-	*  @throws UnsupportedCommOperationException
-	*/
+	*	Extension to CommAPI
+	*	returns boolean true on success
+	*	@throws UnsupportedCommOperationException
+	**/
 
 	public boolean getLowLatency() throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:getLowLatency()");
+			System.out.println(  "RXTXPort:getLowLatency()");
 		return nativeGetLowLatency();
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  returns boolean true on success
-	*  @throws UnsupportedCommOperationException
-	*/
+	*	Extension to CommAPI
+	*	returns boolean true on success
+	*	@throws UnsupportedCommOperationException
+	**/
 
 	public boolean setCallOutHangup(boolean NoHup)
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:setCallOutHangup()");
+			System.out.println(  "RXTXPort:setCallOutHangup()");
 		return nativeSetCallOutHangup(NoHup);
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  returns boolean true on success
-	*  @throws UnsupportedCommOperationException
-	*/
+	*	Extension to CommAPI
+	*	returns boolean true on success
+	*	@throws UnsupportedCommOperationException
+	**/
 
 	public boolean getCallOutHangup()
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:getCallOutHangup()");
+			System.out.println(  "RXTXPort:getCallOutHangup()");
 		return nativeGetCallOutHangup();
 	}
 
 	/**
-	*  Extension to CommAPI
-	*  returns boolean true on success
-	*  @throws UnsupportedCommOperationException
-	*/
+	*	Extension to CommAPI
+	*	returns boolean true on success
+	*	@throws UnsupportedCommOperationException
+	**/
 
 	public boolean clearCommInput()
 		throws UnsupportedCommOperationException
 	{
 		if ( debug )
-			z.reportln(  "RXTXPort:clearCommInput()");
+			System.out.println(  "RXTXPort:clearCommInput()");
 		return nativeClearCommInput();
 	}