java-simple-serial-connector-2.6.0/0000755000175000017500000000000012152352643017077 5ustar showardshowardjava-simple-serial-connector-2.6.0/README.txt0000644000175000017500000001632512152352643020604 0ustar showardshowardjSSC-2.6.0 Release version (01.06.2013) This version contains native libs for Windows(x86, x86-64), Linux(x86, x86-64, ARM soft & hard float), Solaris(x86, x86-64), Mac OS X(x86, x86-64, PPC, PPC64). All native libs contains in the jssc.jar file and you don't need manage native libs manually. In this build: Note: Linux x86 and x86-64 was builded on Ubuntu 10.04 and don't depends GLIBC-2.15 unlike jSSC-2.5.0 Additions: * Added os.name - "Darwin" and os.arch - "universal" support. It can be useful for MacOS X developers. * Added ttyO to Linux RegExp for listing OMAP serial devices. * Added JSSC_IGNPAR and JSSC_PARMRK properties for enabling IGNPAR and PARMRK flags in _nix termios structure. With Best Regards, Sokolov Alexey aka scream3r. ============= Previous Builds ============== /////////////////////////////////////////// //jSSC-2.5.0 Release version (27.04.2013)// /////////////////////////////////////////// In this build: Fixes: * Important! Fixed bug with garbage reading on Linux, MacOSX, Solaris, cause of incorrect using of VMIN and VTIME. Now "read" methods works correctly and are blocking like in Windows * Important! Fixed error with garbage reading in Windows using jSSC after another application used serial port. To prevent this effect COMMTIMEOUTS structure zeroing added to setParams() method * Important! The port handle now stored in variable of type "long" instead of "int", to prevent potential problems with type conversions on Win64 * Fixed MacOS X 10.8 bug with native lib loading (*.dylib -> *.jnilib) * Fixed Linux error with exclusive access to serial port (TIOCEXCL). TIOCNXCL added to closePort() method for clearing exclusive access * Fixed Windows native lib port name concatenation error * Fixed native lib extraction path if user home is read only, in this situation lib will be extracted to tmp folder * Null port name fix. If try to invoke method openPort() for SerialPort(null) object, exception TYPE_NULL_NOT_PERMITTED will be thrown * Enabled TIOCEXCL support in Solaris Additions: * Added ARM Soft & Hard float support (Tested of Raspberry Pi with Oracle JDK(6-7-8)) * Added ttyACM, ttyAMA, rfcomm to Linux RegExp and tty.usbmodem to MacOS X RegExp * Added precompiled RegExp's for Linux, Solaris, MacOS X for more faster port listing * Added private common for Linux, Solaris, MacOS X method getUnixBasedPortNames() for listing serial ports * Rewrited comparator for sorting port names. Now it's a common comparator for Windows, Linux, Solaris and MacOS X * Added some syntax sugar to SerialPortList class, for changing search path, RegExp and comparator * Added timeouts for read operations and SerialPortTimeoutException class for catching timeout exceptions * Added JSSC_NO_TIOCEXCL JVM property for disable using of exclusive access to serial port * Added termios(_nix) and DCB(Windows) structure cheking on port opening, it helps separate real serial devices from others * Added "ERR_" constants into SerialNativeInterface * Added new exception TYPE_INCORRECT_SERIAL_PORT * Added new exception TYPE_PERMISSION_DENIED. It can be very useful for _nix based system if user have no permissions for using serial device And other little modifications... /////////////////////////////////////////// //jSSC-0.9.0 Release version (21.12.2011)// /////////////////////////////////////////// In this build: * Added Solaris support (x86, x86-64) * Added Mac OS X support 10.5 and higher(x86, x86-64, PPC, PPC64) * Fixed some bugs in Linux native part * Changed openPort() method Important Note: openPort() method has been changed, now if port busy SerialPortException with type: TYPE_PORT_BUSY will be thrown, and if port not found SerialPortException with type: TYPE_PORT_NOT_FOUND will be thrown. It's possible to know that port is busy (TYPE_PORT_BUSY) by using TIOCEXCL directive in *nix native library, but using of this directive make some troubles in Solaris OS, that's why TIOCEXCL not used in Solaris (!) Be careful with it. Also Solaris and Mac OS X versions of jSSC not support following events: ERR, TXEMPTY, BREAK. Solaris version not support non standard baudrates Mac OS X version not support parity: MARK, SPACE. * Included javadoc and source codes ///////////////////////////////////////// //jSSC-0.8 Release version (28.11.2011)// ///////////////////////////////////////// In this build: * Implemented events BREAK and ERR (RXFLAG not supported in Linux) * Added method sendBreak(int duration) - send Break signal for setted time * Fixed bugs in Linux events listener * Fixed bug with long port closing operation in Linux ///////////////////////////// //jSSC-0.8-tb4 (21.11.2011)// ///////////////////////////// In this build was fixed a bug in getPortNames() method under Linux. Not implemented yet list: * Events: BREAK, ERR and RXFLAG ///////////////////////////// //jSSC-0.8-tb3 (09.09.2011)// ///////////////////////////// In this build was implemented: * purgePort() And was fixed some Linux and Windows lib bugs. New in this build: * getInputBufferBytesCount() - get count of bytes in input buffer (if error has occured -1 will be returned) * getOutputBufferBytesCount() - get count of bytes in output buffer (if error has occured -1 will be returned) * setFlowControlMode() - setting flow control (available: FLOWCONTROL_NONE, FLOWCONTROL_RTSCTS_IN, FLOWCONTROL_RTSCTS_OUT, FLOWCONTROL_XONXOFF_IN, FLOWCONTROL_XONXOFF_OUT) * getFlowControlMode() - getting setted flow control mode Some "syntactic sugar" for more usability: * writeByte() - write single byte * writeString() - write string * writeInt() - write int value (for example 0xFF) * writeIntArray - write int array (for example new int[]{0xFF, 0x00, 0xFF}) * readString(int byteCount) - read string * readHexString(int byteCount) - read Hex string with a space separator (for example "FF 00 FF") * readHexString(int byteCount, String separator) - read Hex string with setted separator (for example if separator : "FF:00:FF") * readHexStringArray(int byteCount) - read Hex string array (for example {FF, 00, FF}) * readIntArray(int byteCount) - read int array (values in int array are in range from 0 to 255 for example if byte == -1 value in this array it will be 255) The following methods read all bytes in input buffer, if buffer is empty methods will return null * readBytes() * readString() * readHexString() * readHexString() * readHexStringArray() * readIntArray() ============================================ Not implemented yet list: * Events: BREAK, ERR and RXFLAG /////////////////////////////// // jSSC-0.8-tb2 (14.07.2011) // /////////////////////////////// In this build was implemented: * getPortNames() * Parity: MARK and SPACE And was fixed some Linux lib bugs. Not implemented yet list: * purgePort() * Events: BREAK, ERR and RXFLAG /////////////////////////////// // jSSC-0.8-tb1 (11.07.2011) // /////////////////////////////// Not implemented yet list: * getPortNames() * Parity: MARK and SPACE * purgePort() * Events: BREAK, ERR and RXFLAG java-simple-serial-connector-2.6.0/src/0000755000175000017500000000000012152352643017666 5ustar showardshowardjava-simple-serial-connector-2.6.0/src/java/0000755000175000017500000000000012152352643020607 5ustar showardshowardjava-simple-serial-connector-2.6.0/src/java/libs/0000755000175000017500000000000012152352643021540 5ustar showardshowardjava-simple-serial-connector-2.6.0/src/java/libs/solaris/0000755000175000017500000000000012152352643023214 5ustar showardshowardjava-simple-serial-connector-2.6.0/src/java/libs/solaris/libjSSC-2.6_x86_64.so0000644000175000017500000004225012152352643026374 0ustar showardshowardELF>@(=@8@oXX 4455  xx`Pdd  3 @4 O 0 `X `(```oo ` `Xo``>5;( !0!H%%(&H&h&&H'@'pH))*X+ 8,Ph,px,//$zPLRxe   4,=1AAB B(B0B82PdU|` 34 G1AAB B(B0@$R1P$$A `$$h$$<p$WAA0$d$WAA0,%zAAB B(B04`%`AAB B(B0B8@$&AAB A0$'/AAB $D'y/AAN ,l0(AAB B(0(" (4(~AAB B(B0B8V @+$$8+AAB W@ON !$&'()*+,-.0245789:=>?@BDGHIJLM  "#%/136;<ACEFK#+ `"C |"Xaipx 0/ 2 .yG4_|4x  p)Rx444,/ 764U[ j443  2484V\ c p%3 )$ 74 p44+ -^@4!dj "=444 $U44 P0~_t4z *W4   +`&DP4ow +z %4x 0"4 *L - @0 *4 @*W4<Adist/libjSSC-2.6_x86_64.socrti.sCCrti.s__ex_deregister_at_exit__cplus_fini_at_exitjssc.cppCCrtn.scrtn.stcflushselect__1cG__CrunJzero_ints6FpvL_v_cfsetospeedJava_jssc_SerialNativeInterface_sendBreak__1c2k6Fpv_v_Java_jssc_SerialNativeInterface_getSerialPortNamesJava_jssc_SerialNativeInterface_getFlowControlMode.XA$BAABvh$eREiK.EV_DSR.XA$BAABvh$eREiK.EV_RINGtcgetattr___errnonanosleep__SUNW_ABI2_cpp_personalityJava_jssc_SerialNativeInterface_purgePort.XA$BAABvh$eREiK.EV_RLSD.XA$BAABvh$eREiK.INTERRUPT_OVERRUN.XA$BAABvh$eREiK.events_edata.XA$BAABvh$eREiK.PURGE_RXCLEARclose_ex_deregister.XA$BAABvh$eREiK.PARAMS_FLAG_IGNPAR__1c2n6FL_pv_.XA$BAABvh$eREiK.INTERRUPT_FRAME_init__1cH__CimplKcplus_fini6F_v_Java_jssc_SerialNativeInterface_getLinesStatus.XA$BAABvh$eREiK.FLOWCONTROL_XONXOFF_OUT.XA$BAABvh$eREiK.INTERRUPT_TXfcntlatexit__1cQgetDataBitsByNum6Fi_i_Java_jssc_SerialNativeInterface_closePort_end.XA$BAABvh$eREiK.PURGE_RXABORT_PROCEDURE_LINKAGE_TABLE_.XA$BAABvh$eREiK.EV_TXEMPTY.XA$BAABvh$eREiK.FLOWCONTROL_RTSCTS_OUTJava_jssc_SerialNativeInterface_setFlowControlMode_finiwriteJava_jssc_SerialNativeInterface_openPort.XA$BAABvh$eREiK.PARAMS_FLAG_PARMRK.XA$BAABvh$eREiK.FLOWCONTROL_RTSCTS_IN.XA$BAABvh$eREiK.INTERRUPT_PARITY__1cQgetBaudRateByNum6Fi_I_.XA$BAABvh$eREiK.EV_CTSJava_jssc_SerialNativeInterface_waitEvents.XA$BAABvh$eREiK.EV_RXCHARJava_jssc_SerialNativeInterface_setDTRioctl.XA$BAABvh$eREiK.INTERRUPT_BREAK__1cH__CimplKcplus_init6F_v_tcsetattr_ex_registerJava_jssc_SerialNativeInterface_readBytes__1cG__CrunMex_rethrow_q6F_v_cfsetispeed.XA$BAABvh$eREiK.PURGE_TXCLEAR_memsetJava_jssc_SerialNativeInterface_writeBytesJava_jssc_SerialNativeInterface_setParams.XA$BAABvh$eREiK.FLOWCONTROL_XONXOFF_IN_DYNAMIC__1cOgetLinesStatus6Fl_i__etextJava_jssc_SerialNativeInterface_setEventsMaskJava_jssc_SerialNativeInterface_getBuffersBytesCount__1cSgetInterruptsCount6Flpi_v_Java_jssc_SerialNativeInterface_getEventsMaskread.XA$BAABvh$eREiK.PURGE_TXABORTJava_jssc_SerialNativeInterface_setRTS.XA$BAABvh$eREiK.FLOWCONTROL_NONEopen__1c2N6FL_pv_J.48*H+MPS<GBN1KO:%#2/;97"'>&I06TER-5 , 5 654565|"5`"06`"86P6@63H665 68666655(5L0585@5 H54P5X5`5:h5 p5;x557555*5M5=55H5 5 % % h% h%h%h%h%h%h%hp%h`%h P%h @%h 0%h %h %h%h%h%h%h%zh%rhUH HHH]UH HH]SUATAUAVAWHHLLHH3҉L$ IH3AH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$(D$P#D$#D$ @D$D$DD$D$HD$D$@D$D$LD$ D$PD$$L-pLt$83DIcADuHL$, ANuHL$0 ANDfDuL$(ANDfDu L$ANy u L$ANg=u L$ ANS=u L$ANB=u L$AN1=u L$AN =u L$ AN= uL$$ANAH HH3LL IHMH33ALHHH3IAApAIcH HHhA_A^A]A\][ÐfDH3ÐSUATH HHHL$Hfo3ffAH~H HH3LHT$ HcH3tD$ tL$tL$tL$@tL$L LD$IHH33ҹAIH A\][UHSATAUAVAWPDL%QIHH:tIIH-@H8t I$IH H:tIH-@H8t I$HA_A^A]A\[UHSATAUAVAWPHA_A^A]A\[  [I  x!!.!>!N!^!n!~!!!!!!!!!"".">"N"r8Sanotate anotate 55|"5`"666606`"anotate""=ऀ$Up%3%p)R)$* *@*Wऀ*Wऀ +zऀ+` -ؤ-ऀ.y0/ऀ0"Ȥ@0P0~ؤ22ؤ"#@+V++,,I--t00l222233anotate @63iropt: Sun Compiler Common 12.3 SunOS_i386 2011/11/16ir2hf: Sun Compiler Common 12.3 SunOS_i386 2011/11/16ube: Sun Compiler Common 12.3 SunOS_i386 2011/11/16as: Sun Compiler Common 12.3 SunOS_i386 2011/11/16ipo: Sun Compiler Common 12.3 SunOS_i386 2011/11/16ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2280.SUNW_cap.dynamic.eh_frame_hdr.eh_frame.hash.SUNW_ldynsym.dynsym.dynstr.SUNW_dynsymsort.SUNW_reloc.rela.plt.text.init.fini.rodata.got.ex_shared.exception_ranges.data.bssf.picdata.bss.lbss.lrodata.ldata.annotate.comment.shstrtaboXX  xx`p"pH,|2oX X  @ 0 0 PH"O PoahmB r `w`"`"P}33@4@4!p4p45555pP6P6660 7 7 7 7 7 7 7 7 7 7o 7:M %<java-simple-serial-connector-2.6.0/src/java/libs/solaris/libjSSC-2.6_x86.so0000644000175000017500000003306012152352643026062 0ustar showardshowardELF414 (o++++440  (* + p  `t```d`o'o ,0`o``>+OO "#%'()*+,./0135678:;=>@BCEFGHIKLMN  !$&-249<?ADJ (@* @d* U^fmuP+%  % `) ND+l8+T+i , +,$*+@' `X+h+  (*  p) 1 8>,C`: m9 \ (+#  d+,+ 28j a4+y@J 'F \+,+ ` a 06 +R o<+ `!  y (`+G qz+L+  `# &3 't+K  y$+a p+H+0+0@+Ql+dist/libjSSC-2.6_x86.socrti.sCCrti.s__ex_deregister_at_exit__cplus_fini_at_exitjssc.cppCCrtn.scrtn.stcflushcfsetospeedselect.XA$BAAB_g$eREPK.FLOWCONTROL_XONXOFF_INJava_jssc_SerialNativeInterface_sendBreak__1c2k6Fpv_v_Java_jssc_SerialNativeInterface_getFlowControlModeJava_jssc_SerialNativeInterface_getSerialPortNames.XA$BAAB_g$eREPK.INTERRUPT_TX.XA$BAAB_g$eREPK.INTERRUPT_PARITY.XA$BAAB_g$eREPK.FLOWCONTROL_RTSCTS_OUTnanosleeptcgetattr___errnoJava_jssc_SerialNativeInterface_purgePort__div64_edata.XA$BAAB_g$eREPK.eventsclose_GLOBAL_OFFSET_TABLE___1cSgetInterruptsCount6Fxpi_v_.XA$BAAB_g$eREPK.FLOWCONTROL_RTSCTS_IN.XA$BAAB_g$eREPK.PURGE_RXCLEAR_ex_deregister__1cG__CrunVdo_exit_code_in_range6Fpv1_v__init__1cH__CimplKcplus_fini6F_v_Java_jssc_SerialNativeInterface_getLinesStatusatexitfcntl_endJava_jssc_SerialNativeInterface_closePort__1cQgetDataBitsByNum6Fi_i__PROCEDURE_LINKAGE_TABLE_.XA$BAAB_g$eREPK.EV_RLSD__1cG__CrunJzero_ints6FpvI_v_Java_jssc_SerialNativeInterface_setFlowControlMode.XA$BAAB_g$eREPK.PURGE_TXABORT_finiwriteJava_jssc_SerialNativeInterface_openPort.XA$BAAB_g$eREPK.EV_CTS__1cQgetBaudRateByNum6Fi_I_Java_jssc_SerialNativeInterface_waitEvents__1c2N6FI_pv_.XA$BAAB_g$eREPK.FLOWCONTROL_NONE.XA$BAAB_g$eREPK.EV_RINGJava_jssc_SerialNativeInterface_setDTRioctl.XA$BAAB_g$eREPK.EV_TXEMPTY__1cH__CimplKcplus_init6F_v_.XA$BAAB_g$eREPK.INTERRUPT_OVERRUNtcsetattr_ex_registerJava_jssc_SerialNativeInterface_readBytescfsetispeed__1cG__CrunMex_rethrow_q6F_v_Java_jssc_SerialNativeInterface_writeBytes.XA$BAAB_g$eREPK.PURGE_TXCLEARJava_jssc_SerialNativeInterface_setParams_DYNAMIC_etext.XA$BAAB_g$eREPK.FLOWCONTROL_XONXOFF_OUTJava_jssc_SerialNativeInterface_setEventsMaskJava_jssc_SerialNativeInterface_getBuffersBytesCount__1cOgetLinesStatus6Fx_i_.XA$BAAB_g$eREPK.PARAMS_FLAG_IGNPARJava_jssc_SerialNativeInterface_getEventsMask.XA$BAAB_g$eREPK.EV_RXCHARreadJava_jssc_SerialNativeInterface_setRTSopen.XA$BAAB_g$eREPK.PARAMS_FLAG_PARMRK__1c2n6FI_pv_.XA$BAAB_g$eREPK.INTERRUPT_BREAK.XA$BAAB_g$eREPK.EV_DSR.XA$BAAB_g$eREPK.INTERRUPT_FRAME.XA$BAAB_g$eREPK.PURGE_RXABORTF+24*E)IMP9C@J.K5%#0;N,8U3=VTH 7D/ WRL(, ,, ,$,@,D,H,L,T,X,,0,64,(,3,,P,,+H++J+$+ +1+++9+8++5+++(+-++,F,  hhhhh h($h0(h8p,h@`0hHP4hP@8hX0<h` @hhDhpHhxLhPhThXhUSVW[e؉]MjuQEhPiЋ uO^8P8t(F8 t j$E܃j$PuVu8}uh tVjjV PjV uEuU2PƋ׃_^[Ëe؋] uUEu372u (Ku nu  =u =u =u =,u =Xu =u =u =` u =u t=%u f=KuX=uJ=u<=u.=u =u=DÐUEu3(uu 0DÐUSVW,[îeЉ]Eu Ec2u ERKu EAnu E0=u E=u E =u E=,u E=Xu E=u E =u E =` u E =u E =%u E u=Ku Ee=u EU=u EE=u E5=u E%=u E=DE܋Eu3(uu 0D j$Eԃj$PEE؃uPuEEEjPEP}hf@W EPhstWEM QjjVPL ƃ_^[ÐUSVW,[îeԉ] j$wE؃j$PvuuVt}؋WM%tVuu܋ut}؉W }؉Wуu tM؉ M؉WuhTVSEE uE,_^[Ëeԋ] uUSVW[~e܉] j$GEj$PFuuEu/UB I tt3_^[Ëe܋] u$,USVW[u}jh{tW|4Mb+ЉU~Mb+i+E j1EMji@BPp"uW jhztW'3_^[ÐDfDUS[EPhtuE[ÐDUÐUSVWl[ÎM\QPjMPj QE3uEP}hf@WQ EPhstuW< EPhtW*M`rEȉűBr EЉuԋ ER#UE#E@EẺEEЉEEȉEEԉEdEE؉EuU3fDE uEBuEBuEBfDu EBq u EBau EBNuEB>uEB.uEBuEB uEB jVEPjjWVL WSuVU El_^[ÐfU3ÐUSV [,fo$3ffA~EjP EPhtuE t $tL$tL$@tL$ Ẽ QjjVPL ƍe^[UWVS[yES[fhсQ[ÐS[Bhс [Ëhс:t+QQYt-8tQRYс:t'QYt-8tQRY[^_UWVS[á[^_  [I  r"2BRbrx+,8,d*@*\,(*,,U\anotate anotateP LH, ,d*$,@*(,,,0,4,@,P,anotatexj(@J$9$$i$`:$ $ $a$` a$ y$`!$`#$# $ %$%$&3$' 'F$`)$p)$@ !0! #&###4'E' )")3))*xken h r!l!o#i###/%)%%%&&''){)anotate anotate H,(*iropt: Sun Compiler Common 12.3 SunOS_i386 2011/11/16ir2hf: Sun Compiler Common 12.3 SunOS_i386 2011/11/16ube: Sun Compiler Common 12.3 SunOS_i386 2011/11/16as: Sun Compiler Common 12.3 SunOS_i386 2011/11/16ipo: Sun Compiler Common 12.3 SunOS_i386 2011/11/16ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2280.SUNW_cap.dynamic.hash.SUNW_ldynsym.dynsym.dynstr.SUNW_dynsymsort.SUNW_reloc.rel.plt.text.init.fini.rodata.lrodata.got.ex_shared.cpp_finidata.exception_ranges.data.bssf.picdata.ldata.bss.lbss.annotate.comment.shstrtabo 0ott ( 0" p 8oddI ,,U B Y\\P^xd(*(*j++p + +x++++l,,8P,P, \,\,T,,0,,,,,,,,,,o,d/M 0java-simple-serial-connector-2.6.0/src/java/libs/linux/0000755000175000017500000000000012152352643022677 5ustar showardshowardjava-simple-serial-connector-2.6.0/src/java/libs/linux/libjSSC-2.6_x86_64.so0000755000175000017500000003420012152352643026056 0ustar showardshowardELF>0@1@8@** -- -  .. . $$Ptd'''QtdRtd-- - GNU1&dt9SV$%1&-(. +'# !),%*/0"$   "PD0@( @("%&(*+-/>tT}4Y0Z*$˹qXHl$0H\$(Ld$8Ll$@Lt$HL|$PHXÐAAwƃ@AD$fHI 1LL¾THL$L$APAH0A@twAL$LL$ L$xXLL$xCL1TL$>L$x&LN @A $AD$|@L1&fA $AD$NfDHx8A $AD$fD @A $AD$@D$B@D$ @H\$Ld$HLl$Lt$L|$Hl$HHHI׈L$1LH HI1\LcAI <"HHǺ<1HHD_|$1ҾD1D1HHLLHPLH\$Hl$ Ld$(Ll$0Lt$8L|$@HHkDIHx80 TD1H@au IP I@␐UHSHH HtH HHHuH[ÐHH[I 0;p 8Ph@ @p` @(PzPRxn  $<xTlxphD pMI0FMN@FoV0CoV0C40MI C4TBIB B(CA0A8CDH[0DAHAD x]0C4XBCBB B(FA0CE8GL$@MV0ID AE\QF$tYN`M$MXPF1@JX  H'oP0  / x o oof o. .>N^n~0 GCC: (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.ctors.dtors.jcr.dynamic.got.got.plt.data.bss.comment $"`oPP( 0008of f bEo PTx^ hcpn00tH'H'z`'`' ''8(8(- -- -. .. ./ // /0 00 000%0java-simple-serial-connector-2.6.0/src/java/libs/linux/libjSSC-2.6_armsf.so0000644000175000017500000002443712152352643026240 0ustar showardshowardELF(4$4 (p\!\!\!!!!!$$QtdGNU_ ]KjE%61k*%8&2!.3'(-" )%*1+/#7 6, 504$  #B0P8P @ #&+,./02574>tT}4YvT<0Z*$˹qX=XyLIZAY|ƓCEOY_SUL;YbzhO{W.$%oX  w + }|=I1"t@   \ P` |H L(    |@ g8  ( 8` 0 N0 x|4l    S\ @  'H  _ 4x __gmon_start___init_fini__cxa_finalize_Jv_RegisterClasseslibstdc++.so.6Java_jssc_SerialNativeInterface_openPortopen_Znwjmemsettcgetattrfcntl_ZdlPv__errno_locationioctl__aeabi_unwind_cpp_pr0_Z16getBaudRateByNumi_Z16getDataBitsByNumi__aeabi_idivJava_jssc_SerialNativeInterface_setParamscfsetispeedcfsetospeedtcsetattrJava_jssc_SerialNativeInterface_purgePorttcflushJava_jssc_SerialNativeInterface_closePortcloseJava_jssc_SerialNativeInterface_setEventsMaskJava_jssc_SerialNativeInterface_getEventsMaskJava_jssc_SerialNativeInterface_setRTSJava_jssc_SerialNativeInterface_setDTRJava_jssc_SerialNativeInterface_writeByteswriteJava_jssc_SerialNativeInterface_readBytes_ZnajselectreadJava_jssc_SerialNativeInterface_getBuffersBytesCountJava_jssc_SerialNativeInterface_setFlowControlModeJava_jssc_SerialNativeInterface_getFlowControlModeJava_jssc_SerialNativeInterface_sendBreaknanosleep_Z14getLinesStatusx_Z18getInterruptsCountxPiJava_jssc_SerialNativeInterface_waitEventsJava_jssc_SerialNativeInterface_getSerialPortNamesJava_jssc_SerialNativeInterface_getLinesStatuslibm.so.6libgcc_s.so.1libc.so.6_edata__bss_start__bss_start____bss_end____end___endGLIBCXX_3.4GCC_3.5GLIBC_2.4? t)` U&y nii xlpt    $ ( ,7048<@D(HLPTX!\`dh@-Q@/-DƏ ʌDƏ ʌ<Ə ʌ4Ə ʌ,Ə ʌ$Ə ʌƏ ʌƏ ʌ Ə ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌ0 0 R@-@/p@-D000S800 0 0S(0 0 0 @/Xȓx, 4@-0S$00  0S/@/tdtO- @œ/q `0WVP# << l rP`p [!  + V0 “/O/0S S S`p `pM T P/1P/#1P/Pڼ1P/1P/1P;/KP/ږP /(ږ P /K P/K P) /X1PT/9L1PH/ P@/<1P4/nP/ږP/P/P /KP /0P /P! /2P KP/P/0P/0P/0P/0P/ P/ P|///@B%& g5 =-  `   @P00// O- M0 P8P"!P P&}@`0al0`00l0`00l0`0 0al0`0TTTT@-0  Q  p3@/@- @p3@/ T//@-M@@ 0S000  0Ѝ@/TT@-M@@ 0S000  0Ѝ@/TTA-pP 0`“/0“/@ cP 0Ü/0dsA/O-Mp`f ?P@_T &0' R0 0 "0# R0-0"-! `P@p0@S 0 . 0f  P``V0   倰0“/@ 0@Ü/ ЍO/&-'P0`p 0" !-P! @-0M0 00pP“/`@ H 8` 0LÜ/Ѝ@/TTp@-<P`< @PP  0!;V 0  PpP3p@/! :0;08@-<P< @|P  0R    8@/@-@TP* oP$T2d3cAC`jp`@KT Y@/<`6?Fcc;f30A2d3cAC'T(TMb- M > Ѝ/Tp@-`PP:@P !D ,P $0000000 0 00 p@/]TO-xTMP@/0 œ/P "(pP "  `,    0$  @  , 00 40 8< P, 0 @ #SO 5S@ SL D @00“/` 0LÜ/ 0Pœ/ U $01 S#  S  SD  SD S  S D S S D TЍO/ D H D  D DD$DTT/@-Mp0 `@“/Pv 00 0 000@0000 0LÜ/Ѝ@/@-@/ 0  [Id@ &x Ppllx?V`n o    0o@ oo o xGCC: (Debian 4.6.3-14) 4.6.3A/aeabi%4T  ,.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.rel.plt.init.text.fini.rodata.ARM.exidx.eh_frame.init_array.fini_array.jcr.dynamic.got.data.bss.comment.ARM.attributes $"|o( 08o pEo@ @ `T  0]   f a @lr x!!Tp\!\! !!!!!!"|xx#||#0|#p#0#   $a$djava-simple-serial-connector-2.6.0/src/java/libs/linux/libjSSC-2.6_armhf.so0000644000175000017500000002421712152352643026221 0ustar showardshowardELF(4 $4 (p \!\!\!\\h!hh$$QtdGNU<܈:XI\q@0G%8&2!.3'(-" )%*1+/#7 6, 504$  #B0P8P @ #&+,./02574>tT}4YvT<0Z*$˹qX=XyLIZAY|ƓCEOY_SUL;YbzhO{W.$%oX  dw + }|=I1"X< l  \ (\   0(   @|  g $ 8\ , N$ x4xl ` D  SX  ' _ t __gmon_start___init_fini__cxa_finalize_Jv_RegisterClasseslibstdc++.so.6Java_jssc_SerialNativeInterface_openPortopen_Znwjmemsettcgetattrfcntl_ZdlPv__errno_locationioctl__aeabi_unwind_cpp_pr0_Z16getBaudRateByNumi_Z16getDataBitsByNumi__aeabi_idivJava_jssc_SerialNativeInterface_setParamscfsetispeedcfsetospeedtcsetattrJava_jssc_SerialNativeInterface_purgePorttcflushJava_jssc_SerialNativeInterface_closePortcloseJava_jssc_SerialNativeInterface_setEventsMaskJava_jssc_SerialNativeInterface_getEventsMaskJava_jssc_SerialNativeInterface_setRTSJava_jssc_SerialNativeInterface_setDTRJava_jssc_SerialNativeInterface_writeByteswriteJava_jssc_SerialNativeInterface_readBytes_ZnajselectreadJava_jssc_SerialNativeInterface_getBuffersBytesCountJava_jssc_SerialNativeInterface_setFlowControlModeJava_jssc_SerialNativeInterface_getFlowControlModeJava_jssc_SerialNativeInterface_sendBreaknanosleep_Z14getLinesStatusx_Z18getInterruptsCountxPiJava_jssc_SerialNativeInterface_waitEventsJava_jssc_SerialNativeInterface_getSerialPortNamesJava_jssc_SerialNativeInterface_getLinesStatuslibm.so.6libgcc_s.so.1libc.so.6_edata__bss_start__bss_start____bss_end____end___endGLIBCXX_3.4GCC_3.5GLIBC_2.4? t)` U&y nii \`آܢtx|     7(Ģ!Ȣ̢ТԢ@-P-崔Ə ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌƏ ʌ|Ə ʌtƏ ʌlƏ ʌdƏ ʌ\Ə ʌTƏ ʌLƏ ʌDƏ ʌ<Ə ʌ4Ə ʌ,Ə ʌ$Ə ʌƏ ʌƏ ʌ Ə ʌƏ ʌƏ ʌ0 00S/tpH @- @0 0R0 0S $00 0 ГDx0@-(0 0R 0S3/tO-œ @>px/??$$Ptd%%%QtdRtd.>>  GNUg c4=8%0%+.', !& "#*$(/ -) "B0P8 @  $%'()+-/>tT}4Y0Z*$˹qX=LIZAY|ƓCEOY_SUL;YbziO{.$%oX  + -B]"p S % ?0  v   U@'    id@kp   5 xpv ul@3A # bd@L  C 0 c _    p __gmon_start___init_fini__cxa_finalize_Jv_RegisterClasses_Z16getBaudRateByNumi_Z16getDataBitsByNumiJava_jssc_SerialNativeInterface_setEventsMaskJava_jssc_SerialNativeInterface_getEventsMaskJava_jssc_SerialNativeInterface_getSerialPortNames_Z14getLinesStatusxioctlJava_jssc_SerialNativeInterface_getLinesStatusJava_jssc_SerialNativeInterface_getBuffersBytesCountJava_jssc_SerialNativeInterface_setDTRJava_jssc_SerialNativeInterface_setRTS_Z18getInterruptsCountxPi_Znwj_ZdlPvJava_jssc_SerialNativeInterface_waitEventsJava_jssc_SerialNativeInterface_sendBreaknanosleepJava_jssc_SerialNativeInterface_getFlowControlModetcgetattrJava_jssc_SerialNativeInterface_setFlowControlModetcsetattrJava_jssc_SerialNativeInterface_readBytes_ZnajselectreadJava_jssc_SerialNativeInterface_writeByteswriteJava_jssc_SerialNativeInterface_closePortcloseJava_jssc_SerialNativeInterface_purgePorttcflushJava_jssc_SerialNativeInterface_setParamscfsetispeedcfsetospeedJava_jssc_SerialNativeInterface_openPortopenfcntl__errno_location__gxx_personality_v0libstdc++.so.6libm.so.6libgcc_s.so.1libc.so.6_edata__bss_start_endCXXABI_1.3GLIBCXX_3.4GLIBC_2.1.3GLIBC_2.010ӯkzt)Xsi ii \@???`@@@@ @@@@@ @ $@/(@ ,@ 0@ 4@8@<@@@!D@H@L@P@T@X@US[03t>|X[ hhhhh h($h0(h8p,h@`0hHP4hP@8hX0<h` @hhDhpHhxLhPhThXh\h`hdhUVSz1pu]th$t )9s tt9rƃp[^]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tEt$D$$Au4$E]u}]Í1ߍt&UW1VSU"ETUP$PDžL@TЉƃPT1`PHT1։d`d)Ɖ``1``)ƃuDhӥL\\`HE+\@H` 1󫋍`DL hL$D$D$ D$<$k\HPD$T$ $~)\\cLH}!hu|$4$U@ƋL$|$ t$$D$@@<$/[^_]Ív'U8uuM]}} M܉|$4$D$E|$4$M܉ $‰D$EU܉D$ME|$4$D$ L$U9U]u}] U]Y& uuD$ T4$4$]u] USUMЃ t1uuu$Ѓ[]øvD$ $[]ÐUWVSLEU(oEE,UˋUEʉ$eEԋE$$<E1t$EЉ$lu8}Uԉ4$T$_GEԉ4$D$0}&FU E̅҉F'࿉F %Ff qf%E0tE0tFFF%}$F}$}$}$t&E$&UЉt$D$$9ueEЍ}|$D$T${xG}E}EUЉ|$D$T$;y &14$L[^_]Ít&U w݃@Ff$<E1UĹEԉljD$TUԋEЉT$$EԋPH0}UԅBND$4$jD$4$xvEԋUD$TD$$Tx@Eԉ$ @FFrfFbfUԉ$1E1$ @F E^t&E^'UWVS N ^ n ~ .>N^\@GCC: (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.rel.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.ctors.dtors.jcr.dynamic.got.got.plt.data.bss.comment $"88\o( pp0pp8o  `Eox x `T  (]   f 0a lpp(r%%x%%%%|&|&>.>.?/?/?/ ?/h\@\0d@d00d0%0java-simple-serial-connector-2.6.0/src/java/libs/windows/0000755000175000017500000000000012152352643023232 5ustar showardshowardjava-simple-serial-connector-2.6.0/src/java/libs/windows/jSSC-2.6_x86_64.dll0000644000175000017500000035700012152352643026057 0ustar showardshowardMZ@ !L!This program cannot be run in DOS mode. $PEd AQ." . jP   , @x0(t.text,.`P`.data^@`2@`.rdata@`@.pdata, @0@.xdata0  @0@.bssp`.edata@0@.idata @0.CRTX @@.tlsH0@`.relocx@@0BSH HHHH H t1HH [@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jjjjjjjjjjjܦjj j j jjjjjjj j"jj%j(j+j.j4j7j:j j=j@jBjEjIjLjOjRjUjXjZj]j`jcjejhjljojrjcjjujjxjzj}jjjjjjjߦjjjjjjjjj;j@j`j@ÿ?jpj4j4j4j4j4j4jpjjj jj@jjjjjjjjjjj@jjjjjjjjjjjjjpj`j3jjjjP!j`!jj0jjjjjjj3jjjjP!j`!jj0j jpjp jjpj@j j0jjj jPj!j!j!jpj!j!j!jj"j"j !jj0"j "jP!j`!j0!j@!j2-+] f[IHARDWARE\DEVICEMAP\SERIALCOMM\java/lang/String5wwww5wwwwwpwaww5wstd::bad_alloc__gnu_cxx::__concurrence_lock_error__gnu_cxx::__concurrence_unlock_errorstd::exceptionstd::bad_exceptioneh_globalsinit__unexpected_handler_sh__terminate_handler_shpure virtual method called deleted virtual method called terminate called recursively terminate called after throwing an instance of '' terminate called without an active exception what(): ՃЃЃЃЃՃՃՃՃЃՃЃՃЃՃЃՃՃЃЃЃЃЃЃЃЃՃՃՃՃՃЃ_GLOBAL_(anonymous namespace)$D$$$$$$$string literalstdr(rrrrیrrrrrautoXXXXXXXXXXzzzzzzzgzz#VzzzzzXUzܓ:|zzzzXzzzzzzzzzzNNNNNNNNNNNNNNNNNNNNNNNNNNNUҖNsNNNNNNN-Nؓlistcldtptqu#ͦե}eM/Ӧu::JArray[]vtable for VTT for construction vtable for -in-typeinfo for typeinfo name for typeinfo fn for non-virtual thunk to virtual thunk to covariant return thunk to java Class for guard variable for reference temporary # for hidden alias for transaction clone for non-transaction clone for _Sat _Accum_Fract, operatoroperator adgsix : new ulllullfalsetrue%ldjava resource decltype (...this{parm#global constructors keyed to global destructors keyed to {lambda()#{unnamed type# [clone Xz=MѬ]m}!GGG! zz}y:--]!4/ restrict volatile const&&complex imaginary ::* __vector(dtdt&Dtt{default arg#}:: (signed charboolbooleancharbytedoublelong doublefloat__float128unsigned charintunsigned intunsignedlongunsigned long__int128unsigned __int128shortunsigned shortvoidwchar_tlong longunsigned long longdecimal32decimal64decimal128halfchar16_tchar32_tdecltype(nullptr)std::allocatorallocatorstd::basic_stringbasic_stringstd::stringstd::basic_string, std::allocator >std::istreamstd::basic_istream >basic_istreamstd::ostreamstd::basic_ostream >basic_ostreamstd::iostreamstd::basic_iostream >basic_iostreamaN&=aS=aa&anatalignof az()cm,co~dV/=dadelete[] de*dldelete ds.*.dv/eO^=eo^eq==ge>=gt>lS<<=le<=operator"" ls<<lt<mI-=mL*=mi-mlmm--nanew[]ne!=ngnt!nwnewoR|=oo||or|pL+=pl+pm->*pp++ps->?rM%=rS>>=rm%rs>>sizeof sztrthrowtwthrow Mingw-w64 runtime failure: Address %p has no image-section VirtualQuery failed for %d bytes at address %p VirtualProtect failed with code 0x%x Unknown pseudo relocation protocol version %d. Unknown pseudo relocation bit size %d. .pdatamsvcrt.dllfc_staticfc_keyuse_fc_keysjlj_onceNaNInf(null)(null)PRINTF_EXPONENT_DIGITS 0**/*/*l/**,/ /*..*0****************0*L0*,000*0**.******N1****.********l.*|--<-,,,-l,*A,,+.+**l+l,.**.*l,InfinityNaN0'3p2p23`3?aCoc?`(?yPD?}-<2ZGUD??$@@@@?_set_output_format_get_output_format?$@Y@@@@j@.AcAחAeA _BvH7BmB@0BļB4&k C7yAC؅W4vCNgmC=`XC@xDPKDMDؗҜ<3#I9=D2[%Cod( 7yACnF?O8M20HwZ^?`?@ @CCII_J`JJJNPPPQ Q{-0(|<P`[p`OP00opJPdp  $04@ȡС  `(`|4K8PKHPX`ͫpЫ=|@_`+0t HP lpñ . 0òв Z$`x,0< @L\~l@t@LPcp|ʸиظ н  пп-0S$`,48@BDPL$T0`h[p`Y|pv'0 zOPMP< @ w0a<pH7T@hatp2@lpKP$(@\L`T L`Pdtlx    f p           *0gp(,(P0HLP88ul<\htpH@@ZP`GP\`op{ 8@dHp8@<Y`P'0 oph p    ,  0!!!! !(!0!5!@!C!xP!S!p`!c!tp!!!!!!!!!!"""" "/"|0";"l@"f"p"H#P#($ 0$?$@$V$,`$$%%4 %H&(P& (p()X)q****,,,,---$-(/|0/0d0002`23T333?4@444:::::;;4;N;DP;l;4p;;20  20`pPB0`pP  0 ` p P  20`pPBBBbBB  0`pP ur 0 ` p P0`pPB0`pPB0`B0`  0 ` p P l 0 `pP0`pPR0`pB0`B0`pPb20`p"PP20 B 0 ` p P20B0`pPR0`pr0B0`20R0`pB0`pP2020B  pPP  pPPB20R02020PPBBPP20BBB0`R0PPBBBPBB0`pP0`B0`202020B20`pB0`20`pB0`pP20`pR0`pb0`pPb0`pP20`pb0`B0`pP  B0`pPR0`pB0`  B0`pPB0`pP  0 ` p P  B0`pPr 0 `pP2 0 `pP  20`pPb0`pP  20`pP20`p 8 0 `pP  r0`pPBR0BBB0`b0` 0 `pP   0`pPBB0`  r0`pP   0`PR0  20`pPB0`B0`pPB0`pP20B20`p20B20BB0`B0`pP20R0`pbB0`B0` 5  20`PB0`pP20  R0`pPr0`p  R0`pPR0`pR0`pb0`pPB0`B0`BB0`B2020B20B0`20BB0` eB0` p Pb20  r0`pPB0`pPb E  B0`pP U2 0 ` p P U  R 0`pP  20`pP20`p0`0`  0`pP0`  0 ` p P h  0 ` p PR0`pR 0 `pP0`0`pPr 0 `pP0`pP20B0` b 0 ` p PB0`BB0`2020`p20B0`pP20 B 0 ` p PB0`pP  B0`pP20`p"0`R0`p0`pPBB0`AQ(lP$`#p0ppP@Es1[7a jSSC-2.6_x86_64.dllJava_jssc_SerialNativeInterface_closePortJava_jssc_SerialNativeInterface_getBuffersBytesCountJava_jssc_SerialNativeInterface_getEventsMaskJava_jssc_SerialNativeInterface_getFlowControlModeJava_jssc_SerialNativeInterface_getLinesStatusJava_jssc_SerialNativeInterface_getSerialPortNamesJava_jssc_SerialNativeInterface_openPortJava_jssc_SerialNativeInterface_purgePortJava_jssc_SerialNativeInterface_readBytesJava_jssc_SerialNativeInterface_sendBreakJava_jssc_SerialNativeInterface_setDTRJava_jssc_SerialNativeInterface_setEventsMaskJava_jssc_SerialNativeInterface_setFlowControlModeJava_jssc_SerialNativeInterface_setParamsJava_jssc_SerialNativeInterface_setRTSJava_jssc_SerialNativeInterface_waitEventsJava_jssc_SerialNativeInterface_writeBytesd<t|4THddt$<Tjv 4F`p 4J^x",:Hdv(0:DLT^fnv($<Tjv 4F`p 4J^x",:Hdv(0:DLT^fnv(QRegEnumValueA`RegOpenKeyExAAddAtomARClearCommBreakSClearCommErrorUCloseHandleCreateEventACreateFileACreateMutexACreateSemaphoreADeleteCriticalSectionEnterCriticalSection"EscapeCommFunction7FindAtomAxGetAtomNameAGetCommMaskGetCommModemStatusGetCommStateGetCurrentProcessGetCurrentProcessIdGetCurrentThreadIdGetLastError#GetModuleHandleAHGetOverlappedResultUGetProcAddressGetSystemTimeAsFileTimeGetTickCountInitializeCriticalSectionIsDBCSLeadByteExILeaveCriticalSectionOLoadLibraryWwMultiByteToWideCharPurgeCommQueryPerformanceCounterReadFileReleaseMutexReleaseSemaphoreRtlAddFunctionTableRtlCaptureContextRtlLookupFunctionEntry RtlVirtualUnwindSetCommBreakSetCommMaskSetCommStateSetCommTimeoutsiSetLastErrorSetUnhandledExceptionFilterSleepTerminateProcessTlsAllocTlsFreeTlsGetValueTlsSetValueUnhandledExceptionFilterVirtualProtectVirtualQueryWaitCommEventWaitForSingleObject WideCharToMultiByteWriteFilei_writeN__dllonexitS__iob_func[__mb_cur_maxx_amsg_exit_errno_initterm_lock(_onexit_unlockabortatoicallocfputcfputsfreefwritegetenvlocaleconvmallocmemcmpmemcpymemsetreallocsetlocalesignal sprintf)strchr*strcmp,strcpy/strerror2strlen5strncmplwcslenADVAPI32.dllKERNEL32.dll(msvcrt.dll<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<msvcrt.dlljjpjA0jD0jj0 j0 @ 0@P`pР 0`pС@P`pТ 0@P`pУ(8`pФ(@P`xȥإ (8@PXhpȦЦ(0@HX`pxЧا 08HP`hxȨب (8@PXhpȩЩ(0@HX`pxЪتP`pxЫ 0@PȪЪ 08@PX`pxȫЫث (08@HPhpxȬЬج HPX`ȭЭح HPX`hpx 080java-simple-serial-connector-2.6.0/src/java/libs/windows/jSSC-2.6_x86.dll0000644000175000017500000020200012152352643025533 0ustar showardshowardMZ@ !L!This program cannot be run in DOS mode. $PEL Q# L`hN `p xq.text`P`.data@0.rdata @`@.eh_fram@0@.bssJ`.edata`@0@.idatap@0.CRT@0.tls @0.reloc  @0BSht4h9wtЋh9v$Th$F[Í',\$ \$4t$$t$0|$(|$8tD|$\$4$ uhD$RD$\$ t$$|$(, $̹ht^hht|$D$4$Ѓ ʣ%|$D$4$1 {농t&1{'_ 1`&'D$ D$hD$h$-Ð&D$ D$hD$h$Ð ht8U$hHRt#D$h$;t $hÐU]ÐUWVSL]E\\.\ED$UT$$ Eԍu1эQ}эD )čD$EЉljUԉT$<$ D$D$@D$D$ D$D$EЉ$eƋUԉT$UT$$ t_$ù1\$4$"u+$ẺUOE̋Uȍe[^_]vڍvtte[^_]UWVS,t$H\$`D$dD$$ Ź1l$4$|toD$PED$TED$XED$\EM က|$E ЃȀE وM fEfEEEl$4$u1,$H,[^_],$Xù1\$4$Ɖ$볍vD$0D$D$($轶vD$($襶RD$0D$D$($艶v,D$D$D$8$it D$,D$(|$0tD$$:D$fD$(|$0tD$$D$fUWVSSL$$|$ wAԍY tЉ\$ [A܉$vS\$ CD$$CD$(ChZht@ClZht>CC++CCCUNGC\8h $ $MhZhqlZhfS/@t0J0Z4ԼӼvZ0$趉$&5wZސhÐhÐhÐ(hÐhfhf(h $Ðfh $Ðfh $Ðfh $ÐS\$ t0$pSԼҼwwC܉$ vWUXD$4((hD$8,hD$PD$_uoFs $&AK $!D$HAC yY+tS :EF1=PD>ƅ>MT$8+T$ L$q9h @T Ch=uƅ D$D$,$T$ 1ɊT$롋\$4\$PD$PD$,ÉL$L$TD$XD$\D$4t$4FD$$l$0؉CwXCuK|$$<l$$$HL$(ω޹PT$,D$0CD$$ul$0T$JT$ iL$4D$X|$$Gt$$NT$,\|$ N担D$PD$PL$L$TD$XD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$D$ 1L$럃,[^_]VS$Ëv^,tYtT=p(ƃ(<=t'P)ƃ)$[^Ð؃$[^ƃ D$D$$ 1뫍vƃ D$D$$T$L$ 1L$T$$ Ë1эD ,v_t1ۀ {CCD$C $uCs[^É$lS[^É$XVC1[^VSS\$PƸ1 x9st Y[^ÐC1Y[^ÍvCs1Y[^S\$ Kt1[C$RxD$D$C $ [ÐUWVS׋t$0)̉L$|$$ u71ۍ7 C t<Au)ى C u[^_]117ƍvUWVS,1}ҍBEBE܍B?8)č\$ hD$-D$NjuMt az/D< UD \$D$$ EU-D$$t̉$QfE $ƋUUع vtA@Iu$pRftBU$x9tG4$bE$GPE$#R؍e[^_]뻐U$/1M Mt4$E말%8rh%`rh%Trh%hrh%Drh%@rh%rh%Lrh%|rh%drh%Xrh%\rh%lrh%trh%xrh%rh%prh%Prh%|qh%xqh%qh%qh%qh%qh%qh%rh%rh%qh%qh%qh%qh%qh%qh%0rh%,rh%qh%qh%qh%qh% rh%qh%(rh%qh%$rh% rh%qh%rh%qh%qh%qh%rh%rh%qh%rh%rh%qh%qh%qh%qh%qh%qh%qh%qh%qht&'D$tv1ÐShl$W[Ðh}lShkl$W[ÐhQl$ehD$hD$h$OkhÐhÐZht $ h$2hCÐU1D$ hCÐXhh h            }hhlibgcj-13.dll_Jv_RegisterClasses[IHARDWARE\DEVICEMAP\SERIALCOMM\java/lang/String%h &hD&h%h%h%h%h%h%h%h<&h%h%hstd::bad_alloc__gnu_cxx::__concurrence_lock_error__gnu_cxx::__concurrence_unlock_errorstd::exceptionstd::bad_exceptioneh_globalsinit__unexpected_handler_sh__terminate_handler_shpure virtual method called deleted virtual method called terminate called recursively terminate called after throwing an instance of '' terminate called without an active exception what(): \DhDhDhDhDh\Dh\Dh\Dh\DhPDhPDhDhPDhPDhPDhPDhPDhPDhPDhPDhPDhPDh\DhTDhTDhTDhTDhTDhTDhDhPDhPDhPDhPDhPDh\DhPDhTDhDhDh\DhDhTDhTDhDh\Dh\DhPDhPDhDhDhDhDhDhPDhDhDhPDhDh\Dh\DhPDhPDhPDh\Dh\Dh\DhPDhPDhPDhDh_GLOBAL_(anonymous namespace)pJhXJhXJhXJhXJhJhpJhfJhfJhXJhXJhXJhXJhXJhXJhXJhXJhXJhXJhXJhXJhXJhpJhXJhXJhXJhXJhXJhXJhXJhXJhXJhXJhXJhXJhpJhXJhXJhXJhXJhXJhXJhXJhXJhXJhpJhfJhXJhXJhXJhXJhXJhXJhXJhXJhXJhXJhXJhXJhpJhXJhXJhXJhXJhpJhXJhXJhXJhXJhpJhstring literalstdNhJMhMhJMhJMhJMhJMhMhJMhNhJMhJMhJMhJMhxMhautoQhQhQhQhQhQhQhQhQhQhlQhlQhlQhlQhlQhlQhlQhQhlQh+RhRhlQhTRhRhlQhlQhlQhlQhlQhRhQhWShShlQhShSh(Th_ThlQhlQhlQhlQhQhlQhlQhlQhlQhlQhlQhThThThThThThThThThThlQhThThThThlQhlQhlQhThThvQhThThThThThhVhlQhlQhlQhlQhlQhlQhlQhlQhlQhlQhlQhlQhlQh6QhlQhlQhlQhlQhlQhlQhlQhlQhlQhlQhlQhlQhRVhlQhlQhVh$WhVhlQhUhSUhlQhlQhlQhlQhUhlQhUhlQhlQhUh6QhlQhThlistcldtptqueh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dheh dheh dhteh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dh dhdhBfh dh dhfh dh dhghgh dh dh dh dh dh dh dh dhghpgh dhGgh dh dh dh dh dh dh dh dh dh dh dh dhgh dh dh dh dhfh dh dh dh dh dh dh dh dh dh dh dh dh dhfhdhdhdhdhdhdhdhchchdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhdhch::JArray[]vtable for VTT for construction vtable for -in-typeinfo for typeinfo name for typeinfo fn for non-virtual thunk to virtual thunk to covariant return thunk to java Class for guard variable for reference temporary # for hidden alias for transaction clone for non-transaction clone for _Sat _Accum_Fract, operatoroperator adgsix : new ulllullfalsetrue%ldjava resource decltype (...this{parm#global constructors keyed to global destructors keyed to {lambda()#{unnamed type# [clone \thththruhwh?xhxh}h}hmh nhznhnhZohoh:phphqhqhqhjrhrhJshshshshihihihihih|h|hihihn{h{hthyh, std::allocator >std::istreamstd::basic_istream >basic_istreamstd::ostreamstd::basic_ostream >basic_ostreamstd::iostreamstd::basic_iostream >basic_iostreamthhaththh bhhh sh hFh ih h1>h oLh \h1h dh h2haN&=aS=aa&anatalignof az()cm,co~dV/=dadelete[] de*dldelete ds.*.dv/eO^=eo^eq==ge>=gt>lS<<=le<=operator"" ls<<lt<mI-=mL*=mi-mlmm--nanew[]ne!=ngnt!nwnewoR|=oo||or|pL+=pl+pm->*pp++ps->?rM%=rS>>=rm%rs>>sizeof sztrthrowtwthrow hhhhhhhhhhhhhhhhhhhhhhhh h h hhhhhhh!h#h&h)h,h.h1h4h7hh(h:h=hh2h?hBhFhIhhLh Xh[h^hahchfhihlhohrhth hwhzh}hhhhhrhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhMingw runtime failure: VirtualQuery failed for %d bytes at address %p Unknown pseudo relocation protocol version %d. Unknown pseudo relocation bit size %d. fc_staticfc_keyuse_fc_keysjlj_oncegcc-shmem-tdm2h hHh@hhhhHhhhHhhhHh@hhHhhhHhhhhhhhN10__cxxabiv115__forced_unwindEN10__cxxabiv117__class_type_infoEN10__cxxabiv119__foreign_exceptionEN10__cxxabiv120__si_class_type_infoEN9__gnu_cxx24__concurrence_lock_errorEN9__gnu_cxx26__concurrence_unlock_errorESt13bad_exceptionSt9bad_allocSt9exceptionSt9type_infohx9h9hAhh1h1h@h@hp2h 1h1h 2h1hh9h9hAhh@0hL0h@h@hp2h 1hd0h`/h0hhhhHhh hhPhhp9h9h9hh>? ?%?/?5?>?0B012222 3r3333333344t4|44444444!5&515X5`5h5555%636V6a6j6u666667 707L7V7y77777778 888889 9j9r9z99999999D:L:\::::::;4;D;L;\;q;;;;; .>C>R>h>p>>>>>>?"?T?\?l?????@T00j0000F1S1b1v111111122+22222393{3333L4569~9}:r=>P80024=5B5}5555 66D6I6X677J7O788h:>?`L000=4u449::;;q;;;;Q.>>>>?a?~???p@A0^000!1>11122q22225&588:;";<<6=R=??H40R0001>1 222L4j4555:688j9999B:<<r>?H?^?@3 44"4U46678:: ;-;;;Y>>? 112223335-56<4122222f33444445!5+505=5R5j5p55555555 6&6T6u66666667727B7X7c7777888E8[8f8888889 9!9+9A9S9f::::::;;h;x;;;;;;<<"">=>Z>f>r>001000 1/1>1W1j1y11112232J2]222222%383K333333$4;4N444445?9::::::::::::::::;;;;&;.;6;>;F;N;V;^;f;n;v;~;;;;;;;;;;;;;;;;;<<<<&<.<6<> 0X0\0`0d0h0l0p0t0x0|0000 2$2(2,2024282<2@2D2H2L2P2T2X2\2`2d2h2l2p2t2x2|222222222222222222222222222222222333 33333 3$3(3,3034383\3`3d3h3l3p3t3x3|333333333333333333333333333333333444 44444 4$4(4,4044484<4@4D4H4L4P4T4X4\4`4d4h4l4p44444444444444444444444444444555 55555 5$5(5,5054585<5@5D5H5L5P5T5X5\5`5d5h5l5p5t5x5|555555555555555555555555555555555666 66666 6$6(6,6064686<6@6D6H6L6P6T6X6\6`6d6h6l6p6t6x6|6666666666666666666666666666777 77777 7$7(7,7074787<7@7D7H7L7P7T7X7\7`7d7h7l7p7t7x7|777777777777777777777777777777777888 88888 8$8(8,8084888<8@8D8H8L8P8T8X8\8`8d8h8l8p8t8x8|888888888888888888888888888888888999 99999 9$9@;D;H;L;P;T;X;\;`;d;h;l;p;t;x;|;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<<< <<<<< <$<(<,<0<4<8<<<@>>>???$?0?8?D?L?X?`?l?t????????????0H0P0\0d00000000000000111$1,181@1L1T1`1h13 3 3(303<3D3L3X3`3h3t3|33333333 5$50545@5D5P5T5`5d5p5t555555555555555556666 6$60646@6D6P6T6`6d6p6t666666666666666667777 7$70747@7D7P7T7`7d7p7t777777777777777778888 8$80848@8D8P8T8`8d8p8t888888889999999999999999999999::: :;;;;;;;;;;;<<<$<(<,<0|HxHHPH;/Ap8x8p`x`tmH8!|cTc|c|N |<@|!a|3x`tjx8pHU/@p`pH``pT~T>p8x8p`x`tmH 8!|cTc|c|N |!Aa!Q|3x|+x8|}x|3xC}N!]x|yxxX}N!$x|zxcExH]x%x|{x8x}N!8!!|`&TcAa|N ``|x!Aa!Aa!q8|B`|C|3x|ox|3x|+xH/|yxA08@;pT xB|BH0xd|ZH``8@~x;pW`{eB9;|B0xd}8:|Z: :@:`:::`x888x|.|x|.Hq|Pcxx||"H9|`/@ |P|/A|./~x}{x|x|.I|I|LxN!O~x8|}x'x}{xx| | xN!#xH A8x}C8!x!Aa|!AaN ``|8`H!q|+x|3xH 88H|~xH xxHm/@>/y"xpxBXx|Ix^AH{{ @ yjA dy`A `I>yjAa ``x8x;H/A;xH 8!x|N ``|8`H|+x!qH 88H|~xH xH i8@/@48@t @8@~x`A`BxiA`B8!|Cx|N ```|/!Aa!Q|3x@|< 8#x`t{H /A/;@@H<@bp`BM||6p| P| /}:Kx@  <@`BB@|P||H<`B@||8`H 8C|}xH xH Q< #x8`tzH =8/@```88!|x!Aa|N |<@|c`tj!q8pH ar8!|N ```N ```8`N ``|a8!Q8|||xtpC}N!<@8p|{xx`fH =<@8tx`tsH )\xdx8p88}N!8!cxa|N |!Aa!!/|3x}Cx}9Kx}USx;W^AA/;A|AH/2;2AlA /;A\``;HL/K;KA@/n@H/;A(A/@H/,;,A /X@H```/K;KAAD/ `; `AA/@|H/;A/%@dH```8;`cAA8`@(H`<?`cA\<?`c@H@;nH8;H0;XH(;H ;%H;c```/;AHA$/;A8;H0```/;A/;@``8`H|H88H|~xHcxxHm/@4/A,xxH/AXxxH/AD/A</x ykP}kx~@ ykBykX~H0```8+Aak~```^>{akykpxBy)xykxBU>~^A a {A`/yk8ykp10~@(ak0~`HP```/@ab^`H$/A/A/@ ``cx8xH/@/@48cxAx8x`x`TH/A``<@cx8p`tjH/A/@ p`pH ```pT~T>p/@`pH```T~T>p8cx8p;`x`tmH)/@```;xH 8!x!Aa|N ``|B!Aa!<|~x8(|;;`:C;|0| | xN!^88 |exx`| | xN!<@8pp|zx`fxH <@8ttx`tsH<@x8x`tjHx<_;xxxx|/AAP/AA$/A/@H```/Ad/ @Hh```/A,A/A /@hH/A / @THL``H<H4!H,H$pHt```A|8x;^| | xN!^88|}xxxx| | xN!>exxxDxIp|I|LxN!8|/ @8!Cx!A|aN ``|a!A9 })|~x|+x8@8;t``|.8BB^8x| | xN!<@8p|}xc`tjHApx@A 8txIA 8xx@A 8|xIA 8^xxx88| | xN!8!xa|N |B}h=k|)}N |B}h=k|}N |B}h=k|}N |B}h=k|}N |B}h=k|Y}N |B}h=k|1}N |B}h=k|Q}N |B}h=k|Q}N |B}h=k|9}N |B}h=k|)}N |B}h=k|}N |B}h=k|}N |B}h=k|q}N |B}h=k|Y}N |B}h=k|Y}N |B}h=k|a}N |B}h=k|}N |B}h=k|}N   [IzPRxA 4$(A~$\A~,`L AA~,  AA~,  AA~, A~LD 8Ll A~,A~,  AA~,`0(A~$$`4A~,LA~4|4 A~L A$ A~,`A~__PPPPPPPPPPPPPPPPPP0`0`0 `0(`00`08`0@`0H`0P`0X`0``0h`0p`0x`0`0`0`0`0`Y(+ P-@,H, C)0s 00' Rzp!` 0&\` P@ (5<CJR]civ !"#$%&'()*+, %+'(,!)"#*$& __mh_dylib_headerdyld_stub_binding_helper__dyld_func_lookup_events__ZZ42Java_jssc_SerialNativeInterface_waitEventsE4C.64_Java_jssc_SerialNativeInterface_closePort_Java_jssc_SerialNativeInterface_getBuffersBytesCount_Java_jssc_SerialNativeInterface_getEventsMask_Java_jssc_SerialNativeInterface_getFlowControlMode_Java_jssc_SerialNativeInterface_getLinesStatus_Java_jssc_SerialNativeInterface_getSerialPortNames_Java_jssc_SerialNativeInterface_openPort_Java_jssc_SerialNativeInterface_purgePort_Java_jssc_SerialNativeInterface_readBytes_Java_jssc_SerialNativeInterface_sendBreak_Java_jssc_SerialNativeInterface_setDTR_Java_jssc_SerialNativeInterface_setEventsMask_Java_jssc_SerialNativeInterface_setFlowControlMode_Java_jssc_SerialNativeInterface_setParams_Java_jssc_SerialNativeInterface_setRTS_Java_jssc_SerialNativeInterface_waitEvents_Java_jssc_SerialNativeInterface_writeBytes__Z14getLinesStatusx__Z16getBaudRateByNumi__Z16getDataBitsByNumi__Z18getInterruptsCountxPi__ZdlPv__Znam__Znwm___error___gxx_personality_v0_cfsetispeed_cfsetospeed_close_fcntl_ioctl_memset_nanosleep_open_read_select$1050_tcflush_tcgetattr_tcsetattr_writejava-simple-serial-connector-2.6.0/src/java/libs/mac_os_x/libjSSC-2.6_ppc.jnilib0000644000175000017500000003414412152352643027165 0ustar showardshoward  h__TEXT __text__TEXT__picsymbolstub1__TEXT@ __const__TEXT@__cstring__TEXT__eh_frame__TEXT` H__DATA  __data__DATA  __dyld__DATA  __la_symbol_ptr__DATA H __nl_symbol_ptr__DATA T T$8__LINKEDIT00d 0libjSSC-2.6_ppc.jnilib;q@>-ߥ8\0.3t P2%00 4/usr/lib/libstdc++.6.dylib 4/usr/lib/libgcc_s.1.dylib 4o/usr/lib/libSystem.B.dylib|B}|}cx=L}| x=HN }cxK|B}h|=kk}iN ``||+x|+x8|3x|{x!``C(| | xN!<|zx`H/|~x|}pA8`,Ha8,8||xH1xxH/A;;HL``/@< x`t H``88xH8TexHxHHXH;;/A@H;;/A(H;;/ A;;`[cxxEx,| | xN!8!`xx|N `|bx8`/M A/8`M A@/28`2M A/8`M 8`N /K8`KM /n@H/8`M A/@H/,8`,M /X@H```/K8`KM AD/ `8` `M A/@|H/8`M /%@dH```8|Cx`M A8`@,HT<|Cx`M <`@N 8`nN 8`N 8`XN 8`N 8`%N |CxN ```/8AHA$/8A88H0```/8A/8@``|xN ``|p!A p8A@H8```p8@$p@,p@$`8`H8|3xH/@8`8!P|N |< |3x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| | xN!<@88a8|yx`fxH<@8. * * If you use jSSC in public project you can inform me about this by e-mail, * of course if you want it. * * e-mail: scream3r.org@gmail.com * web-site: http://scream3r.org | http://code.google.com/p/java-simple-serial-connector/ */ package jssc; /** * * @author scream3r */ public class SerialPortTimeoutException extends Exception { private String portName; private String methodName; private int timeoutValue; public SerialPortTimeoutException(String portName, String methodName, int timeoutValue) { super("Port name - " + portName + "; Method name - " + methodName + "; Serial port operation timeout (" + timeoutValue + " ms)."); this.portName = portName; this.methodName = methodName; this.timeoutValue = timeoutValue; } /** * Getting port name during operation with which the exception was called */ public String getPortName(){ return portName; } /** * Getting method name during execution of which the exception was called */ public String getMethodName(){ return methodName; } /** * Getting timeout value in millisecond */ public int getTimeoutValue(){ return timeoutValue; } } java-simple-serial-connector-2.6.0/src/java/jssc/SerialPortEvent.java0000644000175000017500000001173312152352643025507 0ustar showardshoward/* jSSC (Java Simple Serial Connector) - serial port communication library. * © Alexey Sokolov (scream3r), 2010-2013. * * This file is part of jSSC. * * jSSC is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * jSSC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with jSSC. If not, see . * * If you use jSSC in public project you can inform me about this by e-mail, * of course if you want it. * * e-mail: scream3r.org@gmail.com * web-site: http://scream3r.org | http://code.google.com/p/java-simple-serial-connector/ */ package jssc; /** * * @author scream3r */ public class SerialPortEvent { private String portName; private int eventType; private int eventValue; public static final int RXCHAR = 1; public static final int RXFLAG = 2; public static final int TXEMPTY = 4; public static final int CTS = 8; public static final int DSR = 16; public static final int RLSD = 32; public static final int BREAK = 64; public static final int ERR = 128; public static final int RING = 256; public SerialPortEvent(String portName, int eventType, int eventValue){ this.portName = portName; this.eventType = eventType; this.eventValue = eventValue; } /** * Getting port name which sent the event */ public String getPortName() { return portName; } /** * Getting event type */ public int getEventType() { return eventType; } /** * Getting event value *

*
Event values depending on their types:
*
RXCHAR - bytes count in input buffer
*
RXFLAG - bytes count in input buffer (Not supported in Linux)
*
TXEMPTY - bytes count in output buffer
*
CTS - state of CTS line (0 - OFF, 1 - ON)
*
DSR - state of DSR line (0 - OFF, 1 - ON)
*
RLSD - state of RLSD line (0 - OFF, 1 - ON)
*
BREAK - 0
*
RING - state of RING line (0 - OFF, 1 - ON)
*
ERR - mask of errors
*/ public int getEventValue() { return eventValue; } /** * Method returns true if event of type "RXCHAR" is received and otherwise false */ public boolean isRXCHAR() { if(eventType == RXCHAR){ return true; } else { return false; } } /** * Method returns true if event of type "RXFLAG" is received and otherwise false */ public boolean isRXFLAG() { if(eventType == RXFLAG){ return true; } else { return false; } } /** * Method returns true if event of type "TXEMPTY" is received and otherwise false */ public boolean isTXEMPTY() { if(eventType == TXEMPTY){ return true; } else { return false; } } /** * Method returns true if event of type "CTS" is received and otherwise false */ public boolean isCTS() { if(eventType == CTS){ return true; } else { return false; } } /** * Method returns true if event of type "DSR" is received and otherwise false */ public boolean isDSR() { if(eventType == DSR){ return true; } else { return false; } } /** * Method returns true if event of type "RLSD" is received and otherwise false */ public boolean isRLSD() { if(eventType == RLSD){ return true; } else { return false; } } /** * Method returns true if event of type "BREAK" is received and otherwise false */ public boolean isBREAK() { if(eventType == BREAK){ return true; } else { return false; } } /** * Method returns true if event of type "ERR" is received and otherwise false */ public boolean isERR() { if(eventType == ERR){ return true; } else { return false; } } /** * Method returns true if event of type "RING" is received and otherwise false */ public boolean isRING() { if(eventType == RING){ return true; } else { return false; } } } java-simple-serial-connector-2.6.0/src/java/jssc/SerialNativeInterface.java0000644000175000017500000003447312152352643026636 0ustar showardshoward/* jSSC (Java Simple Serial Connector) - serial port communication library. * © Alexey Sokolov (scream3r), 2010-2013. * * This file is part of jSSC. * * jSSC is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * jSSC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with jSSC. If not, see . * * If you use jSSC in public project you can inform me about this by e-mail, * of course if you want it. * * e-mail: scream3r.org@gmail.com * web-site: http://scream3r.org | http://code.google.com/p/java-simple-serial-connector/ */ package jssc; import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.InputStreamReader; /** * * @author scream3r */ public class SerialNativeInterface { private static final String libVersion = "2.6"; //jSSC-2.6.0 Release from 01.06.2013 private static final String libMinorSuffix = "0"; //since 0.9.0 public static final int OS_LINUX = 0; public static final int OS_WINDOWS = 1; public static final int OS_SOLARIS = 2;//since 0.9.0 public static final int OS_MAC_OS_X = 3;//since 0.9.0 private static int osType = -1; /** * @since 2.3.0 */ public static final long ERR_PORT_BUSY = -1; /** * @since 2.3.0 */ public static final long ERR_PORT_NOT_FOUND = -2; /** * @since 2.3.0 */ public static final long ERR_PERMISSION_DENIED = -3; /** * @since 2.3.0 */ public static final long ERR_INCORRECT_SERIAL_PORT = -4; /** * @since 2.6.0 */ public static final String PROPERTY_JSSC_NO_TIOCEXCL = "JSSC_NO_TIOCEXCL"; /** * @since 2.6.0 */ public static final String PROPERTY_JSSC_IGNPAR = "JSSC_IGNPAR"; /** * @since 2.6.0 */ public static final String PROPERTY_JSSC_PARMRK = "JSSC_PARMRK"; static { String libFolderPath; String libName; String osName = System.getProperty("os.name"); String architecture = System.getProperty("os.arch"); String userHome = System.getProperty("user.home"); String fileSeparator = System.getProperty("file.separator"); String tmpFolder = System.getProperty("java.io.tmpdir"); //since 2.3.0 -> String libRootFolder = new File(userHome).canWrite() ? userHome : tmpFolder; //<- since 2.3.0 String javaLibPath = System.getProperty("java.library.path");//since 2.1.0 if(osName.equals("Linux")){ osName = "linux"; osType = OS_LINUX; } else if(osName.startsWith("Win")){ osName = "windows"; osType = OS_WINDOWS; }//since 0.9.0 -> else if(osName.equals("SunOS")){ osName = "solaris"; osType = OS_SOLARIS; } else if(osName.equals("Mac OS X") || osName.equals("Darwin")){//os.name "Darwin" since 2.6.0 osName = "mac_os_x"; osType = OS_MAC_OS_X; }//<- since 0.9.0 if(architecture.equals("i386") || architecture.equals("i686")){ architecture = "x86"; } else if(architecture.equals("amd64") || architecture.equals("universal")){//os.arch "universal" since 2.6.0 architecture = "x86_64"; } else if(architecture.equals("arm")) {//since 2.1.0 String floatStr = "sf"; if(javaLibPath.toLowerCase().contains("gnueabihf") || javaLibPath.toLowerCase().contains("armhf")){ floatStr = "hf"; } else { try { Process readelfProcess = Runtime.getRuntime().exec("readelf -A /proc/self/exe"); BufferedReader reader = new BufferedReader(new InputStreamReader(readelfProcess.getInputStream())); String buffer = ""; while((buffer = reader.readLine()) != null && !buffer.isEmpty()){ if(buffer.toLowerCase().contains("Tag_ABI_VFP_args".toLowerCase())){ floatStr = "hf"; break; } } reader.close(); } catch (Exception ex) { //Do nothing } } architecture = "arm" + floatStr; } libFolderPath = libRootFolder + fileSeparator + ".jssc" + fileSeparator + osName; libName = "jSSC-" + libVersion + "_" + architecture; libName = System.mapLibraryName(libName); if(libName.endsWith(".dylib")){//Since 2.1.0 MacOSX 10.8 fix libName = libName.replace(".dylib", ".jnilib"); } boolean loadLib = false; if(isLibFolderExist(libFolderPath)){ if(isLibFileExist(libFolderPath + fileSeparator + libName)){ loadLib = true; } else { if(extractLib((libFolderPath + fileSeparator + libName), osName, libName)){ loadLib = true; } } } else { if(new File(libFolderPath).mkdirs()){ if(extractLib((libFolderPath + fileSeparator + libName), osName, libName)){ loadLib = true; } } } if(loadLib){ System.load(libFolderPath + fileSeparator + libName); } } /** * Is library folder exists * * @param libFolderPath * * @since 0.8 */ private static boolean isLibFolderExist(String libFolderPath) { boolean returnValue = false; File folder = new File(libFolderPath); if(folder.exists() && folder.isDirectory()){ returnValue = true; } return returnValue; } /** * Is library file exists * * @param libFilePath * * @since 0.8 */ private static boolean isLibFileExist(String libFilePath) { boolean returnValue = false; File folder = new File(libFilePath); if(folder.exists() && folder.isFile()){ returnValue = true; } return returnValue; } /** * Extract lib to lib folder * * @param libFilePath * @param osName * @param libName * * @since 0.8 */ private static boolean extractLib(String libFilePath, String osName, String libName) { boolean returnValue = false; File libFile = new File(libFilePath); InputStream input = null; FileOutputStream output = null; input = SerialNativeInterface.class.getResourceAsStream("/libs/" + osName + "/" + libName); if(input != null){ int read; byte[] buffer = new byte[4096]; try { output = new FileOutputStream(libFilePath); while((read = input.read(buffer)) != -1){ output.write(buffer, 0, read); } output.close(); input.close(); returnValue = true; } catch (Exception ex) { try { output.close(); if(libFile.exists()){ libFile.delete(); } } catch (Exception ex_out) { //Do nothing } try { input.close(); } catch (Exception ex_in) { //Do nothing } } } return returnValue; } /** * Get OS type (OS_LINUX || OS_WINDOWS || OS_SOLARIS) * * @since 0.8 */ public static int getOsType() { return osType; } /** * Get jSSC version. The version of library is Base Version + Minor Suffix * * @since 0.8 */ public static String getLibraryVersion() { return libVersion + "." + libMinorSuffix; } /** * Get jSSC Base Version * * @since 0.9.0 */ public static String getLibraryBaseVersion() { return libVersion; } /** * Get jSSC minor suffix. For example in version 0.8.1 - 1 is a minor suffix * * @since 0.9.0 */ public static String getLibraryMinorSuffix() { return libMinorSuffix; } /** * Open port * * @param portName name of port for opening * @param useTIOCEXCL enable/disable using of TIOCEXCL. Take effect only on *nix based systems * * @return handle of opened port or -1 if opening of the port was unsuccessful */ public native long openPort(String portName, boolean useTIOCEXCL); /** * Setting the parameters of opened port * * @param handle handle of opened port * @param baudRate data transfer rate * @param dataBits number of data bits * @param stopBits number of stop bits * @param parity parity * @param setRTS initial state of RTS line (ON/OFF) * @param setDTR initial state of DTR line (ON/OFF) * @param flags additional Native settings. Take effect only on *nix based systems * * @return If the operation is successfully completed, the method returns true, otherwise false */ public native boolean setParams(long handle, int baudRate, int dataBits, int stopBits, int parity, boolean setRTS, boolean setDTR, int flags); /** * Purge of input and output buffer * * @param handle handle of opened port * @param flags flags specifying required actions for purgePort method * * @return If the operation is successfully completed, the method returns true, otherwise false */ public native boolean purgePort(long handle, int flags); /** * Close port * * @param handle handle of opened port * * @return If the operation is successfully completed, the method returns true, otherwise false */ public native boolean closePort(long handle); /** * Set events mask * * @param handle handle of opened port * @param mask events mask * * @return If the operation is successfully completed, the method returns true, otherwise false */ public native boolean setEventsMask(long handle, int mask); /** * Get events mask * * @param handle handle of opened port * * @return Method returns event mask as a variable of int type */ public native int getEventsMask(long handle); /** * Wait events * * @param handle handle of opened port * * @return Method returns two-dimensional array containing event types and their values * (events[i][0] - event type, events[i][1] - event value). */ public native int[][] waitEvents(long handle); /** * Change RTS line state * * @param handle handle of opened port * @param value true - ON, false - OFF * * @return If the operation is successfully completed, the method returns true, otherwise false */ public native boolean setRTS(long handle, boolean value); /** * Change DTR line state * * @param handle handle of opened port * @param value true - ON, false - OFF * * @return If the operation is successfully completed, the method returns true, otherwise false */ public native boolean setDTR(long handle, boolean value); /** * Read data from port * * @param handle handle of opened port * @param byteCount count of bytes required to read * * @return Method returns the array of read bytes */ public native byte[] readBytes(long handle, int byteCount); /** * Write data to port * * @param handle handle of opened port * @param buffer array of bytes to write * * @return If the operation is successfully completed, the method returns true, otherwise false */ public native boolean writeBytes(long handle, byte[] buffer); /** * Get bytes count in buffers of port * * @param handle handle of opened port * * @return Method returns the array that contains info about bytes count in buffers: *
element 0 - input buffer
*
element 1 - output buffer
* * @since 0.8 */ public native int[] getBuffersBytesCount(long handle); /** * Set flow control mode * * @param handle handle of opened port * @param mask mask of flow control mode * * @return If the operation is successfully completed, the method returns true, otherwise false * * @since 0.8 */ public native boolean setFlowControlMode(long handle, int mask); /** * Get flow control mode * * @param handle handle of opened port * * @return Mask of setted flow control mode * * @since 0.8 */ public native int getFlowControlMode(long handle); /** * Get serial port names like an array of String * * @return unsorted array of String with port names */ public native String[] getSerialPortNames(); /** * Getting lines states * * @param handle handle of opened port * * @return Method returns the array containing information about lines in following order: *
element 0 - CTS line state
*
element 1 - DSR line state
*
element 2 - RING line state
*
element 3 - RLSD line state
*/ public native int[] getLinesStatus(long handle); /** * Send Break singnal for setted duration * * @param handle handle of opened port * @param duration duration of Break signal * @return If the operation is successfully completed, the method returns true, otherwise false * * @since 0.8 */ public native boolean sendBreak(long handle, int duration); } java-simple-serial-connector-2.6.0/src/java/jssc/SerialPortList.java0000644000175000017500000003164212152352643025342 0ustar showardshoward/* jSSC (Java Simple Serial Connector) - serial port communication library. * © Alexey Sokolov (scream3r), 2010-2013. * * This file is part of jSSC. * * jSSC is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * jSSC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with jSSC. If not, see . * * If you use jSSC in public project you can inform me about this by e-mail, * of course if you want it. * * e-mail: scream3r.org@gmail.com * web-site: http://scream3r.org | http://code.google.com/p/java-simple-serial-connector/ */ package jssc; import java.io.File; import java.util.Comparator; import java.util.TreeSet; import java.util.regex.Pattern; /** * * @author scream3r */ public class SerialPortList { private static SerialNativeInterface serialInterface; private static final Pattern PORTNAMES_REGEXP; private static final String PORTNAMES_PATH; static { serialInterface = new SerialNativeInterface(); switch (SerialNativeInterface.getOsType()) { case SerialNativeInterface.OS_LINUX: { PORTNAMES_REGEXP = Pattern.compile("(ttyS|ttyUSB|ttyACM|ttyAMA|rfcomm|ttyO)[0-9]{1,3}"); PORTNAMES_PATH = "/dev/"; break; } case SerialNativeInterface.OS_SOLARIS: { PORTNAMES_REGEXP = Pattern.compile("[0-9]*|[a-z]*"); PORTNAMES_PATH = "/dev/term/"; break; } case SerialNativeInterface.OS_MAC_OS_X: { PORTNAMES_REGEXP = Pattern.compile("tty.(serial|usbserial|usbmodem).*"); PORTNAMES_PATH = "/dev/"; break; } case SerialNativeInterface.OS_WINDOWS: { PORTNAMES_REGEXP = Pattern.compile(""); PORTNAMES_PATH = ""; break; } default: { PORTNAMES_REGEXP = null; PORTNAMES_PATH = null; break; } } } //since 2.1.0 -> Fully rewrited port name comparator private static final Comparator PORTNAMES_COMPARATOR = new Comparator() { @Override public int compare(String valueA, String valueB) { if(valueA.equalsIgnoreCase(valueB)){ return valueA.compareTo(valueB); } int minLength = Math.min(valueA.length(), valueB.length()); int shiftA = 0; int shiftB = 0; for(int i = 0; i < minLength; i++){ char charA = valueA.charAt(i - shiftA); char charB = valueB.charAt(i - shiftB); if(charA != charB){ if(Character.isDigit(charA) && Character.isDigit(charB)){ int[] resultsA = getNumberAndLastIndex(valueA, i - shiftA); int[] resultsB = getNumberAndLastIndex(valueB, i - shiftB); if(resultsA[0] != resultsB[0]){ return resultsA[0] - resultsB[0]; } if(valueA.length() < valueB.length()){ i = resultsA[1]; shiftB = resultsA[1] - resultsB[1]; } else { i = resultsB[1]; shiftA = resultsB[1] - resultsA[1]; } } else { if(Character.toLowerCase(charA) - Character.toLowerCase(charB) != 0){ return Character.toLowerCase(charA) - Character.toLowerCase(charB); } } } } return valueA.compareToIgnoreCase(valueB); } /** * Evaluate port index/number from startIndex to the number end. For example: * for port name serial-123-FF you should invoke this method with startIndex = 7 * * @return If port index/number correctly evaluated it value will be returned
* returnArray[0] = index/number
* returnArray[1] = stopIndex
* * If incorrect:
* returnArray[0] = -1
* returnArray[1] = startIndex
* * For this name serial-123-FF result is: * returnArray[0] = 123
* returnArray[1] = 10
*/ private int[] getNumberAndLastIndex(String str, int startIndex) { String numberValue = ""; int[] returnValues = {-1, startIndex}; for(int i = startIndex; i < str.length(); i++){ returnValues[1] = i; char c = str.charAt(i); if(Character.isDigit(c)){ numberValue += c; } else { break; } } try { returnValues[0] = Integer.valueOf(numberValue); } catch (Exception ex) { //Do nothing } return returnValues; } }; //<-since 2.1.0 /** * Get sorted array of serial ports in the system using default settings:
* * Search path
* Windows - ""(always ignored)
* Linux - "/dev/"
* Solaris - "/dev/term/"
* MacOSX - "/dev/"
* * RegExp
* Windows - ""
* Linux - "(ttyS|ttyUSB|ttyACM|ttyAMA|rfcomm)[0-9]{1,3}"
* Solaris - "[0-9]*|[a-z]*"
* MacOSX - "tty.(serial|usbserial|usbmodem).*"
* * @return String array. If there is no ports in the system String[] * with zero length will be returned (since jSSC-0.8 in previous versions null will be returned) */ public static String[] getPortNames() { return getPortNames(PORTNAMES_PATH, PORTNAMES_REGEXP, PORTNAMES_COMPARATOR); } /** * Get sorted array of serial ports in the system located on searchPath * * @param searchPath Path for searching serial ports (not null)
* The default search paths:
* Linux, MacOSX: /dev/
* Solaris: /dev/term/
* Windows: this parameter ingored * * @return String array. If there is no ports in the system String[] * * @since 2.3.0 */ public static String[] getPortNames(String searchPath) { return getPortNames(searchPath, PORTNAMES_REGEXP, PORTNAMES_COMPARATOR); } /** * Get sorted array of serial ports in the system matched pattern * * @param pattern RegExp pattern for matching port names (not null) * * @return String array. If there is no ports in the system String[] * * @since 2.3.0 */ public static String[] getPortNames(Pattern pattern) { return getPortNames(PORTNAMES_PATH, pattern, PORTNAMES_COMPARATOR); } /** * Get sorted array of serial ports in the system matched pattern * * @param comparator Comparator for sotring port names (not null) * * @return String array. If there is no ports in the system String[] * * @since 2.3.0 */ public static String[] getPortNames(Comparator comparator) { return getPortNames(PORTNAMES_PATH, PORTNAMES_REGEXP, comparator); } /** * Get sorted array of serial ports in the system located on searchPath, matched pattern * * @param searchPath Path for searching serial ports (not null)
* The default search paths:
* Linux, MacOSX: /dev/
* Solaris: /dev/term/
* Windows: this parameter ingored * @param pattern RegExp pattern for matching port names (not null) * * @return String array. If there is no ports in the system String[] * * @since 2.3.0 */ public static String[] getPortNames(String searchPath, Pattern pattern) { return getPortNames(searchPath, pattern, PORTNAMES_COMPARATOR); } /** * Get sorted array of serial ports in the system located on searchPath and sorted by comparator * * @param searchPath Path for searching serial ports (not null)
* The default search paths:
* Linux, MacOSX: /dev/
* Solaris: /dev/term/
* Windows: this parameter ingored * @param comparator Comparator for sotring port names (not null) * * @return String array. If there is no ports in the system String[] * * @since 2.3.0 */ public static String[] getPortNames(String searchPath, Comparator comparator) { return getPortNames(searchPath, PORTNAMES_REGEXP, comparator); } /** * Get sorted array of serial ports in the system matched pattern and sorted by comparator * * @param pattern RegExp pattern for matching port names (not null) * @param comparator Comparator for sotring port names (not null) * * @return String array. If there is no ports in the system String[] * * @since 2.3.0 */ public static String[] getPortNames(Pattern pattern, Comparator comparator) { return getPortNames(PORTNAMES_PATH, pattern, comparator); } /** * Get sorted array of serial ports in the system located on searchPath, matched pattern and sorted by comparator * * @param searchPath Path for searching serial ports (not null)
* The default search paths:
* Linux, MacOSX: /dev/
* Solaris: /dev/term/
* Windows: this parameter ingored * @param pattern RegExp pattern for matching port names (not null) * @param comparator Comparator for sotring port names (not null) * * @return String array. If there is no ports in the system String[] * * @since 2.3.0 */ public static String[] getPortNames(String searchPath, Pattern pattern, Comparator comparator) { if(searchPath == null || pattern == null || comparator == null){ return new String[]{}; } if(SerialNativeInterface.getOsType() == SerialNativeInterface.OS_WINDOWS){ return getWindowsPortNames(pattern, comparator); } return getUnixBasedPortNames(searchPath, pattern, comparator); } /** * Get serial port names in Windows * * @since 2.3.0 */ private static String[] getWindowsPortNames(Pattern pattern, Comparator comparator) { String[] portNames = serialInterface.getSerialPortNames(); if(portNames == null){ return new String[]{}; } TreeSet ports = new TreeSet(comparator); for(String portName : portNames){ if(pattern.matcher(portName).find()){ ports.add(portName); } } return ports.toArray(new String[ports.size()]); } /** * Universal method for getting port names of _nix based systems */ private static String[] getUnixBasedPortNames(String searchPath, Pattern pattern, Comparator comparator) { searchPath = (searchPath.equals("") ? searchPath : (searchPath.endsWith("/") ? searchPath : searchPath + "/")); String[] returnArray = new String[]{}; File dir = new File(searchPath); if(dir.exists() && dir.isDirectory()){ File[] files = dir.listFiles(); if(files.length > 0){ TreeSet portsTree = new TreeSet(comparator); for(File file : files){ String fileName = file.getName(); if(!file.isDirectory() && !file.isFile() && pattern.matcher(fileName).find()){ String portName = searchPath + fileName; long portHandle = serialInterface.openPort(portName, false);//Open port without TIOCEXCL if(portHandle < 0 && portHandle != SerialNativeInterface.ERR_PORT_BUSY){ continue; } else if(portHandle != SerialNativeInterface.ERR_PORT_BUSY) { serialInterface.closePort(portHandle); } portsTree.add(portName); } } returnArray = portsTree.toArray(returnArray); } } return returnArray; } } java-simple-serial-connector-2.6.0/src/java/jssc/SerialPortEventListener.java0000644000175000017500000000226212152352643027212 0ustar showardshoward/* jSSC (Java Simple Serial Connector) - serial port communication library. * © Alexey Sokolov (scream3r), 2010-2013. * * This file is part of jSSC. * * jSSC is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * jSSC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with jSSC. If not, see . * * If you use jSSC in public project you can inform me about this by e-mail, * of course if you want it. * * e-mail: scream3r.org@gmail.com * web-site: http://scream3r.org | http://code.google.com/p/java-simple-serial-connector/ */ package jssc; /** * * @author scream3r */ public interface SerialPortEventListener { public abstract void serialEvent(SerialPortEvent serialPortEvent); } java-simple-serial-connector-2.6.0/src/java/jssc/SerialPort.java0000644000175000017500000013251012152352643024502 0ustar showardshoward/* jSSC (Java Simple Serial Connector) - serial port communication library. * © Alexey Sokolov (scream3r), 2010-2013. * * This file is part of jSSC. * * jSSC is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * jSSC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with jSSC. If not, see . * * If you use jSSC in public project you can inform me about this by e-mail, * of course if you want it. * * e-mail: scream3r.org@gmail.com * web-site: http://scream3r.org | http://code.google.com/p/java-simple-serial-connector/ */ package jssc; import java.lang.reflect.Method; /** * * @author scream3r */ public class SerialPort { private SerialNativeInterface serialInterface; private SerialPortEventListener eventListener; private long portHandle; private String portName; private boolean portOpened = false; private boolean maskAssigned = false; private boolean eventListenerAdded = false; //since 2.2.0 -> private Method methodErrorOccurred = null; //<- since 2.2.0 public static final int BAUDRATE_110 = 110; public static final int BAUDRATE_300 = 300; public static final int BAUDRATE_600 = 600; public static final int BAUDRATE_1200 = 1200; public static final int BAUDRATE_4800 = 4800; public static final int BAUDRATE_9600 = 9600; public static final int BAUDRATE_14400 = 14400; public static final int BAUDRATE_19200 = 19200; public static final int BAUDRATE_38400 = 38400; public static final int BAUDRATE_57600 = 57600; public static final int BAUDRATE_115200 = 115200; public static final int BAUDRATE_128000 = 128000; public static final int BAUDRATE_256000 = 256000; public static final int DATABITS_5 = 5; public static final int DATABITS_6 = 6; public static final int DATABITS_7 = 7; public static final int DATABITS_8 = 8; public static final int STOPBITS_1 = 1; public static final int STOPBITS_2 = 2; public static final int STOPBITS_1_5 = 3; public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; public static final int PURGE_RXABORT = 0x0002; public static final int PURGE_RXCLEAR = 0x0008; public static final int PURGE_TXABORT = 0x0001; public static final int PURGE_TXCLEAR = 0x0004; public static final int MASK_RXCHAR = 1; public static final int MASK_RXFLAG = 2; public static final int MASK_TXEMPTY = 4; public static final int MASK_CTS = 8; public static final int MASK_DSR = 16; public static final int MASK_RLSD = 32; public static final int MASK_BREAK = 64; public static final int MASK_ERR = 128; public static final int MASK_RING = 256; //since 0.8 -> public static final int FLOWCONTROL_NONE = 0; public static final int FLOWCONTROL_RTSCTS_IN = 1; public static final int FLOWCONTROL_RTSCTS_OUT = 2; public static final int FLOWCONTROL_XONXOFF_IN = 4; public static final int FLOWCONTROL_XONXOFF_OUT = 8; //<- since 0.8 //since 0.8 -> public static final int ERROR_FRAME = 0x0008; public static final int ERROR_OVERRUN = 0x0002; public static final int ERROR_PARITY = 0x0004; //<- since 0.8 //since 2.6.0 -> private static final int PARAMS_FLAG_IGNPAR = 1; private static final int PARAMS_FLAG_PARMRK = 2; //<- since 2.6.0 public SerialPort(String portName) { this.portName = portName; serialInterface = new SerialNativeInterface(); } /** * Getting port name under operation * * @return Method returns port name under operation as a String */ public String getPortName(){ return portName; } /** * Getting port state * * @return Method returns true if port is open, otherwise false */ public boolean isOpened() { return portOpened; } /** * Port opening *

* Note: If port busy TYPE_PORT_BUSY exception will be thrown. * If port not found TYPE_PORT_NOT_FOUND exception will be thrown. * * @return If the operation is successfully completed, the method returns true * * @throws SerialPortException */ public boolean openPort() throws SerialPortException { if(portOpened){ throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PORT_ALREADY_OPENED); } if(portName != null){ boolean useTIOCEXCL = (System.getProperty(SerialNativeInterface.PROPERTY_JSSC_NO_TIOCEXCL) == null && System.getProperty(SerialNativeInterface.PROPERTY_JSSC_NO_TIOCEXCL.toLowerCase()) == null); portHandle = serialInterface.openPort(portName, useTIOCEXCL);//since 2.3.0 -> (if JSSC_NO_TIOCEXCL defined, exclusive lock for serial port will be disabled) } else { throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_NULL_NOT_PERMITTED);//since 2.1.0 -> NULL port name fix } if(portHandle == SerialNativeInterface.ERR_PORT_BUSY){ throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PORT_BUSY); } else if(portHandle == SerialNativeInterface.ERR_PORT_NOT_FOUND){ throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PORT_NOT_FOUND); } else if(portHandle == SerialNativeInterface.ERR_PERMISSION_DENIED){ throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PERMISSION_DENIED); } else if(portHandle == SerialNativeInterface.ERR_INCORRECT_SERIAL_PORT){ throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_INCORRECT_SERIAL_PORT); } portOpened = true; return true; } /** * Setting the parameters of port. RTS and DTR lines are enabled by default * * @param baudRate data transfer rate * @param dataBits number of data bits * @param stopBits number of stop bits * @param parity parity * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException */ public boolean setParams(int baudRate, int dataBits, int stopBits, int parity) throws SerialPortException { return setParams(baudRate, dataBits, stopBits, parity, true, true); } /** * Setting the parameters of port * * @param baudRate data transfer rate * @param dataBits number of data bits * @param stopBits number of stop bits * @param parity parity * @param setRTS initial state of RTS line(ON/OFF) * @param setDTR initial state of DTR line(ON/OFF) * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException * * @since 0.8 */ public boolean setParams(int baudRate, int dataBits, int stopBits, int parity, boolean setRTS, boolean setDTR) throws SerialPortException { checkPortOpened("setParams()"); if(stopBits == 1){ stopBits = 0; } else if(stopBits == 3){ stopBits = 1; } int flags = 0; if(System.getProperty(SerialNativeInterface.PROPERTY_JSSC_IGNPAR) != null || System.getProperty(SerialNativeInterface.PROPERTY_JSSC_IGNPAR.toLowerCase()) != null){ flags |= PARAMS_FLAG_IGNPAR; } if(System.getProperty(SerialNativeInterface.PROPERTY_JSSC_PARMRK) != null || System.getProperty(SerialNativeInterface.PROPERTY_JSSC_PARMRK.toLowerCase()) != null){ flags |= PARAMS_FLAG_PARMRK; } return serialInterface.setParams(portHandle, baudRate, dataBits, stopBits, parity, setRTS, setDTR, flags); } /** * Purge of input and output buffer. Required flags shall be sent to the input. Variables with prefix * "PURGE_", for example "PURGE_RXCLEAR". Sent parameter "flags" is additive value, * so addition of flags is allowed. For example, if input or output buffer shall be purged, * parameter "PURGE_RXCLEAR | PURGE_TXCLEAR". *
Note: some devices or drivers may not support this function * * @return If the operation is successfully completed, the method returns true, otherwise false. * * @throws SerialPortException */ public boolean purgePort(int flags) throws SerialPortException { checkPortOpened("purgePort()"); return serialInterface.purgePort(portHandle, flags); } /** * Events mask for Linux OS * * @since 0.8 */ private int linuxMask; /** * Set events mask. Required flags shall be sent to the input. Variables with prefix * "MASK_", shall be used as flags, for example "MASK_RXCHAR". * Sent parameter "mask" is additive value, so addition of flags is allowed. * For example if messages about data receipt and CTS and DSR status changing * shall be received, it is required to set the mask - "MASK_RXCHAR | MASK_CTS | MASK_DSR" * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException */ public boolean setEventsMask(int mask) throws SerialPortException { checkPortOpened("setEventsMask()"); if(SerialNativeInterface.getOsType() == SerialNativeInterface.OS_LINUX || SerialNativeInterface.getOsType() == SerialNativeInterface.OS_SOLARIS || SerialNativeInterface.getOsType() == SerialNativeInterface.OS_MAC_OS_X){//since 0.9.0 linuxMask = mask; if(mask > 0){ maskAssigned = true; } else { maskAssigned = false; } return true; } boolean returnValue = serialInterface.setEventsMask(portHandle, mask); if(!returnValue){ throw new SerialPortException(portName, "setEventsMask()", SerialPortException.TYPE_CANT_SET_MASK); } if(mask > 0){ maskAssigned = true; } else { maskAssigned = false; } return returnValue; } /** * Getting events mask for the port * * @return Method returns events mask as int type variable. This variable is an additive value * * @throws SerialPortException */ public int getEventsMask() throws SerialPortException { checkPortOpened("getEventsMask()"); if(SerialNativeInterface.getOsType() == SerialNativeInterface.OS_LINUX || SerialNativeInterface.getOsType() == SerialNativeInterface.OS_SOLARIS || SerialNativeInterface.getOsType() == SerialNativeInterface.OS_MAC_OS_X){//since 0.9.0 return linuxMask; } return serialInterface.getEventsMask(portHandle); } /** * Getting events mask for the port is Linux OS (for internal use) * * @since 0.8 */ private int getLinuxMask() { return linuxMask; } /** * Change RTS line state. Set "true" for switching ON and "false" for switching OFF RTS line * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException */ public boolean setRTS(boolean enabled) throws SerialPortException { checkPortOpened("setRTS()"); return serialInterface.setRTS(portHandle, enabled); } /** * Change DTR line state. Set "true" for switching ON and "false" for switching OFF DTR line * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException */ public boolean setDTR(boolean enabled) throws SerialPortException { checkPortOpened("setDTR()"); return serialInterface.setDTR(portHandle, enabled); } /** * Write byte array to port * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException */ public boolean writeBytes(byte[] buffer) throws SerialPortException { checkPortOpened("writeBytes()"); return serialInterface.writeBytes(portHandle, buffer); } /** * Write single byte to port * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException * * @since 0.8 */ public boolean writeByte(byte singleByte) throws SerialPortException { checkPortOpened("writeByte()"); return writeBytes(new byte[]{singleByte}); } /** * Write String to port * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException * * @since 0.8 */ public boolean writeString(String string) throws SerialPortException { checkPortOpened("writeString()"); return writeBytes(string.getBytes()); } /** * Write int value (in range from 0 to 255 (0x00 - 0xFF)) to port * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException * * @since 0.8 */ public boolean writeInt(int singleInt) throws SerialPortException { checkPortOpened("writeInt()"); return writeBytes(new byte[]{(byte)singleInt}); } /** * Write int array (in range from 0 to 255 (0x00 - 0xFF)) to port * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException * * @since 0.8 */ public boolean writeIntArray(int[] buffer) throws SerialPortException { checkPortOpened("writeIntArray()"); byte[] byteArray = new byte[buffer.length]; for(int i = 0; i < buffer.length; i++){ byteArray[i] = (byte)buffer[i]; } return writeBytes(byteArray); } /** * Read byte array from port * * @param byteCount count of bytes for reading * * @return byte array with "byteCount" length * * @throws SerialPortException */ public byte[] readBytes(int byteCount) throws SerialPortException { checkPortOpened("readBytes()"); return serialInterface.readBytes(portHandle, byteCount); } /** * Read string from port * * @param byteCount count of bytes for reading * * @return byte array with "byteCount" length converted to String * * @throws SerialPortException * * @since 0.8 */ public String readString(int byteCount) throws SerialPortException { checkPortOpened("readString()"); return new String(readBytes(byteCount)); } /** * Read Hex string from port (example: FF 0A FF). Separator by default is a space * * @param byteCount count of bytes for reading * * @return byte array with "byteCount" length converted to Hexadecimal String * * @throws SerialPortException * * @since 0.8 */ public String readHexString(int byteCount) throws SerialPortException { checkPortOpened("readHexString()"); return readHexString(byteCount, " "); } /** * Read Hex string from port with setted separator (example if separator is "::": FF::0A::FF) * * @param byteCount count of bytes for reading * * @return byte array with "byteCount" length converted to Hexadecimal String * * @throws SerialPortException * * @since 0.8 */ public String readHexString(int byteCount, String separator) throws SerialPortException { checkPortOpened("readHexString()"); String[] strBuffer = readHexStringArray(byteCount); String returnString = ""; boolean insertSeparator = false; for(String value : strBuffer){ if(insertSeparator){ returnString += separator; } returnString += value; insertSeparator = true; } return returnString; } /** * Read Hex String array from port * * @param byteCount count of bytes for reading * * @return String array with "byteCount" length and Hexadecimal String values * * @throws SerialPortException * * @since 0.8 */ public String[] readHexStringArray(int byteCount) throws SerialPortException { checkPortOpened("readHexStringArray()"); int[] intBuffer = readIntArray(byteCount); String[] strBuffer = new String[intBuffer.length]; for(int i = 0; i < intBuffer.length; i++){ String value = Integer.toHexString(intBuffer[i]).toUpperCase(); if(value.length() == 1) { value = "0" + value; } strBuffer[i] = value; } return strBuffer; } /** * Read int array from port * * @param byteCount count of bytes for reading * * @return int array with values in range from 0 to 255 * * @throws SerialPortException * * @since 0.8 */ public int[] readIntArray(int byteCount) throws SerialPortException { checkPortOpened("readIntArray()"); byte[] buffer = readBytes(byteCount); int[] intBuffer = new int[buffer.length]; for(int i = 0; i < buffer.length; i++){ if(buffer[i] < 0){ intBuffer[i] = 256 + buffer[i]; } else { intBuffer[i] = buffer[i]; } } return intBuffer; } private void waitBytesWithTimeout(String methodName, int byteCount, int timeout) throws SerialPortException, SerialPortTimeoutException { checkPortOpened("waitBytesWithTimeout()"); boolean timeIsOut = true; long startTime = System.currentTimeMillis(); while((System.currentTimeMillis() - startTime) < timeout){ if(getInputBufferBytesCount() >= byteCount){ timeIsOut = false; break; } try { Thread.sleep(0, 100);//Need to sleep some time to prevent high CPU loading } catch (InterruptedException ex) { //Do nothing } } if(timeIsOut){ throw new SerialPortTimeoutException(portName, methodName, timeout); } } /** * Read byte array from port * * @param byteCount count of bytes for reading * @param timeout timeout in milliseconds * * @return byte array with "byteCount" length * * @throws SerialPortException * @throws SerialPortTimeoutException * * @since 2.0 */ public byte[] readBytes(int byteCount, int timeout) throws SerialPortException, SerialPortTimeoutException { checkPortOpened("readBytes()"); waitBytesWithTimeout("readBytes()", byteCount, timeout); return readBytes(byteCount); } /** * Read string from port * * @param byteCount count of bytes for reading * @param timeout timeout in milliseconds * * @return byte array with "byteCount" length converted to String * * @throws SerialPortException * @throws SerialPortTimeoutException * * @since 2.0 */ public String readString(int byteCount, int timeout) throws SerialPortException, SerialPortTimeoutException { checkPortOpened("readString()"); waitBytesWithTimeout("readString()", byteCount, timeout); return readString(byteCount); } /** * Read Hex string from port (example: FF 0A FF). Separator by default is a space * * @param byteCount count of bytes for reading * @param timeout timeout in milliseconds * * @return byte array with "byteCount" length converted to Hexadecimal String * * @throws SerialPortException * @throws SerialPortTimeoutException * * @since 2.0 */ public String readHexString(int byteCount, int timeout) throws SerialPortException, SerialPortTimeoutException { checkPortOpened("readHexString()"); waitBytesWithTimeout("readHexString()", byteCount, timeout); return readHexString(byteCount); } /** * Read Hex string from port with setted separator (example if separator is "::": FF::0A::FF) * * @param byteCount count of bytes for reading * @param timeout timeout in milliseconds * * @return byte array with "byteCount" length converted to Hexadecimal String * * @throws SerialPortException * @throws SerialPortTimeoutException * * @since 2.0 */ public String readHexString(int byteCount, String separator, int timeout) throws SerialPortException, SerialPortTimeoutException { checkPortOpened("readHexString()"); waitBytesWithTimeout("readHexString()", byteCount, timeout); return readHexString(byteCount, separator); } /** * Read Hex String array from port * * @param byteCount count of bytes for reading * @param timeout timeout in milliseconds * * @return String array with "byteCount" length and Hexadecimal String values * * @throws SerialPortException * @throws SerialPortTimeoutException * * @since 2.0 */ public String[] readHexStringArray(int byteCount, int timeout) throws SerialPortException, SerialPortTimeoutException { checkPortOpened("readHexStringArray()"); waitBytesWithTimeout("readHexStringArray()", byteCount, timeout); return readHexStringArray(byteCount); } /** * Read int array from port * * @param byteCount count of bytes for reading * @param timeout timeout in milliseconds * * @return int array with values in range from 0 to 255 * * @throws SerialPortException * @throws SerialPortTimeoutException * * @since 2.0 */ public int[] readIntArray(int byteCount, int timeout) throws SerialPortException, SerialPortTimeoutException { checkPortOpened("readIntArray()"); waitBytesWithTimeout("readIntArray()", byteCount, timeout); return readIntArray(byteCount); } /** * Read all available bytes from port like a byte array * * @return If input buffer is empty null will be returned, else byte array with all data from port * * @throws SerialPortException * * @since 0.8 */ public byte[] readBytes() throws SerialPortException { checkPortOpened("readBytes()"); int byteCount = getInputBufferBytesCount(); if(byteCount <= 0){ return null; } return readBytes(byteCount); } /** * Read all available bytes from port like a String * * @return If input buffer is empty null will be returned, else byte array with all data from port converted to String * * @throws SerialPortException * * @since 0.8 */ public String readString() throws SerialPortException { checkPortOpened("readString()"); int byteCount = getInputBufferBytesCount(); if(byteCount <= 0){ return null; } return readString(byteCount); } /** * Read all available bytes from port like a Hex String * * @return If input buffer is empty null will be returned, else byte array with all data from port converted to Hex String * * @throws SerialPortException * * @since 0.8 */ public String readHexString() throws SerialPortException { checkPortOpened("readHexString()"); int byteCount = getInputBufferBytesCount(); if(byteCount <= 0){ return null; } return readHexString(byteCount); } /** * Read all available bytes from port like a Hex String with setted separator * * @return If input buffer is empty null will be returned, else byte array with all data from port converted to Hex String * * @throws SerialPortException * * @since 0.8 */ public String readHexString(String separator) throws SerialPortException { checkPortOpened("readHexString()"); int byteCount = getInputBufferBytesCount(); if(byteCount <= 0){ return null; } return readHexString(byteCount, separator); } /** * Read all available bytes from port like a Hex String array * * @return If input buffer is empty null will be returned, else byte array with all data from port converted to Hex String array * * @throws SerialPortException * * @since 0.8 */ public String[] readHexStringArray() throws SerialPortException { checkPortOpened("readHexStringArray()"); int byteCount = getInputBufferBytesCount(); if(byteCount <= 0){ return null; } return readHexStringArray(byteCount); } /** * Read all available bytes from port like a int array (values in range from 0 to 255) * * @return If input buffer is empty null will be returned, else byte array with all data from port converted to int array * * @throws SerialPortException * * @since 0.8 */ public int[] readIntArray() throws SerialPortException { checkPortOpened("readIntArray()"); int byteCount = getInputBufferBytesCount(); if(byteCount <= 0){ return null; } return readIntArray(byteCount); } /** * Get count of bytes in input buffer * * @return Count of bytes in input buffer or -1 if error occured * * @throws SerialPortException * * @since 0.8 */ public int getInputBufferBytesCount() throws SerialPortException { checkPortOpened("getInputBufferBytesCount()"); return serialInterface.getBuffersBytesCount(portHandle)[0]; } /** * Get count of bytes in output buffer * * @return Count of bytes in output buffer or -1 if error occured * * @throws SerialPortException * * @since 0.8 */ public int getOutputBufferBytesCount() throws SerialPortException { checkPortOpened("getOutputBufferBytesCount()"); return serialInterface.getBuffersBytesCount(portHandle)[1]; } /** * Set flow control mode. For required mode use variables with prefix "FLOWCONTROL_". * Example of hardware flow control mode(RTS/CTS): setFlowControlMode(FLOWCONTROL_RTSCTS_IN | FLOWCONTROL_RTSCTS_OUT); * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException * * @since 0.8 */ public boolean setFlowControlMode(int mask) throws SerialPortException { checkPortOpened("setFlowControlMode()"); return serialInterface.setFlowControlMode(portHandle, mask); } /** * Get flow control mode * * @return Mask of setted flow control mode * * @throws SerialPortException * * @since 0.8 */ public int getFlowControlMode() throws SerialPortException { checkPortOpened("getFlowControlMode()"); return serialInterface.getFlowControlMode(portHandle); } /** * Send Break singnal for setted duration * * @param duration duration of Break signal * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException * * @since 0.8 */ public boolean sendBreak(int duration)throws SerialPortException { checkPortOpened("sendBreak()"); return serialInterface.sendBreak(portHandle, duration); } private int[][] waitEvents() { return serialInterface.waitEvents(portHandle); } /** * Check port opened (since jSSC-0.8 String "EMPTY" was replaced with "portName" variable) * * @param methodName method name * * @throws SerialPortException */ private void checkPortOpened(String methodName) throws SerialPortException { if(!portOpened){ throw new SerialPortException(portName, methodName, SerialPortException.TYPE_PORT_NOT_OPENED); } } /** * Getting lines status. Lines status is sent as 0 – OFF and 1 - ON * * @return Method returns the array containing information about lines in following order: *
element 0 - CTS line state
*
element 1 - DSR line state
*
element 2 - RING line state
*
element 3 - RLSD line state
* * @throws SerialPortException */ public int[] getLinesStatus() throws SerialPortException { checkPortOpened("getLinesStatus()"); return serialInterface.getLinesStatus(portHandle); } /** * Get state of CTS line * * @return If line is active, method returns true, otherwise false * * @throws SerialPortException */ public boolean isCTS() throws SerialPortException { checkPortOpened("isCTS()"); if(serialInterface.getLinesStatus(portHandle)[0] == 1){ return true; } else { return false; } } /** * Get state of DSR line * * @return If line is active, method returns true, otherwise false * * @throws SerialPortException */ public boolean isDSR() throws SerialPortException { checkPortOpened("isDSR()"); if(serialInterface.getLinesStatus(portHandle)[1] == 1){ return true; } else { return false; } } /** * Get state of RING line * * @return If line is active, method returns true, otherwise false * * @throws SerialPortException */ public boolean isRING() throws SerialPortException { checkPortOpened("isRING()"); if(serialInterface.getLinesStatus(portHandle)[2] == 1){ return true; } else { return false; } } /** * Get state of RLSD line * * @return If line is active, method returns true, otherwise false * * @throws SerialPortException */ public boolean isRLSD() throws SerialPortException { checkPortOpened("isRLSD()"); if(serialInterface.getLinesStatus(portHandle)[3] == 1){ return true; } else { return false; } } /** * Add event listener. Object of "SerialPortEventListener" type shall * be sent to the method. This object shall be properly described, as it will * be in charge for handling of occurred events. This method will independently * set the mask in "MASK_RXCHAR" state if it was not set beforehand * * @throws SerialPortException */ public void addEventListener(SerialPortEventListener listener) throws SerialPortException { addEventListener(listener, MASK_RXCHAR, false); } /** * Add event listener. Object of "SerialPortEventListener" type shall be sent * to the method. This object shall be properly described, as it will be in * charge for handling of occurred events. Also events mask shall be sent to * this method, to do it use variables with prefix "MASK_" for example "MASK_RXCHAR" * * @see #setEventsMask(int) setEventsMask(int mask) * * @throws SerialPortException */ public void addEventListener(SerialPortEventListener listener, int mask) throws SerialPortException { addEventListener(listener, mask, true); } /** * Internal method. Add event listener. Object of "SerialPortEventListener" type shall be sent * to the method. This object shall be properly described, as it will be in * charge for handling of occurred events. Also events mask shall be sent to * this method, to do it use variables with prefix "MASK_" for example "MASK_RXCHAR". If * overwriteMask == true and mask has been already assigned it value will be rewrited by mask * value, if overwriteMask == false and mask has been already assigned the new mask value will be ignored, * if there is no assigned mask to this serial port the mask value will be used for setting it up in spite of * overwriteMask value * * @see #setEventsMask(int) setEventsMask(int mask) * * @throws SerialPortException */ private void addEventListener(SerialPortEventListener listener, int mask, boolean overwriteMask) throws SerialPortException { checkPortOpened("addEventListener()"); if(!eventListenerAdded){ if((maskAssigned && overwriteMask) || !maskAssigned) { setEventsMask(mask); } eventListener = listener; eventThread = getNewEventThread(); eventThread.setName("EventThread " + portName); //since 2.2.0 -> try { Method method = eventListener.getClass().getMethod("errorOccurred", new Class[]{SerialPortException.class}); method.setAccessible(true); methodErrorOccurred = method; } catch (SecurityException ex) { //Do nothing } catch (NoSuchMethodException ex) { //Do nothing } //<- since 2.2.0 eventThread.start(); eventListenerAdded = true; } else { throw new SerialPortException(portName, "addEventListener()", SerialPortException.TYPE_LISTENER_ALREADY_ADDED); } } /** * Create new EventListener Thread depending on the type of operating system * * @since 0.8 */ private EventThread getNewEventThread() { if(SerialNativeInterface.getOsType() == SerialNativeInterface.OS_LINUX || SerialNativeInterface.getOsType() == SerialNativeInterface.OS_SOLARIS || SerialNativeInterface.getOsType() == SerialNativeInterface.OS_MAC_OS_X){//since 0.9.0 return new LinuxEventThread(); } return new EventThread(); } /** * Delete event listener. Mask is set to 0. So at the next addition of event * handler you shall set required event mask again * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException */ public boolean removeEventListener() throws SerialPortException { checkPortOpened("removeEventListener()"); if(!eventListenerAdded){ throw new SerialPortException(portName, "removeEventListener()", SerialPortException.TYPE_CANT_REMOVE_LISTENER); } eventThread.terminateThread(); setEventsMask(0); if(Thread.currentThread().getId() != eventThread.getId()){ if(eventThread.isAlive()){ try { eventThread.join(5000); } catch (InterruptedException ex) { throw new SerialPortException(portName, "removeEventListener()", SerialPortException.TYPE_LISTENER_THREAD_INTERRUPTED); } } } methodErrorOccurred = null; eventListenerAdded = false; return true; } /** * Close port. This method deletes event listener first, then closes the port * * @return If the operation is successfully completed, the method returns true, otherwise false * * @throws SerialPortException */ public boolean closePort() throws SerialPortException { checkPortOpened("closePort()"); if(eventListenerAdded){ removeEventListener(); } boolean returnValue = serialInterface.closePort(portHandle); if(returnValue){ maskAssigned = false; portOpened = false; } return returnValue; } private EventThread eventThread; private class EventThread extends Thread { private boolean threadTerminated = false; @Override public void run() { while(!threadTerminated){ int[][] eventArray = waitEvents(); for(int i = 0; i < eventArray.length; i++){ if(eventArray[i][0] > 0 && !threadTerminated){ eventListener.serialEvent(new SerialPortEvent(portName, eventArray[i][0], eventArray[i][1])); //FIXME /*if(methodErrorOccurred != null){ try { methodErrorOccurred.invoke(eventListener, new Object[]{new SerialPortException("port", "method", "exception")}); } catch (Exception ex) { System.out.println(ex); } }*/ } } } } private void terminateThread(){ threadTerminated = true; } } /** * EventListener for Linux OS * * @since 0.8 */ private class LinuxEventThread extends EventThread { //Essential interruptions for events: BREAK, ERR, TXEMPTY private final int INTERRUPT_BREAK = 512; private final int INTERRUPT_TX = 1024; private final int INTERRUPT_FRAME = 2048; private final int INTERRUPT_OVERRUN = 4096; private final int INTERRUPT_PARITY = 8192; //Count of interruptions private int interruptBreak; private int interruptTX; private int interruptFrame; private int interruptOverrun; private int interruptParity; //Previous states if lines (then state change event will be generated) private int preCTS; private int preDSR; private int preRLSD; private int preRING; //Need to get initial states public LinuxEventThread(){ int[][] eventArray = waitEvents(); for(int i = 0; i < eventArray.length; i++){ int eventType = eventArray[i][0]; int eventValue = eventArray[i][1]; switch(eventType){ case INTERRUPT_BREAK: interruptBreak = eventValue; break; case INTERRUPT_TX: interruptTX = eventValue; break; case INTERRUPT_FRAME: interruptFrame = eventValue; break; case INTERRUPT_OVERRUN: interruptOverrun = eventValue; break; case INTERRUPT_PARITY: interruptParity = eventValue; break; case MASK_CTS: preCTS = eventValue; break; case MASK_DSR: preDSR = eventValue; break; case MASK_RING: preRING = eventValue; break; case MASK_RLSD: preRLSD = eventValue; break; } } } @Override public void run() { while(!super.threadTerminated){ int[][] eventArray = waitEvents(); int mask = getLinuxMask(); boolean interruptTxChanged = false; int errorMask = 0; for(int i = 0; i < eventArray.length; i++){ boolean sendEvent = false; int eventType = eventArray[i][0]; int eventValue = eventArray[i][1]; if(eventType > 0 && !super.threadTerminated){ switch(eventType){ case INTERRUPT_BREAK: if(eventValue != interruptBreak){ interruptBreak = eventValue; if((mask & MASK_BREAK) == MASK_BREAK){ eventType = MASK_BREAK; eventValue = 0; sendEvent = true; } } break; case INTERRUPT_TX: if(eventValue != interruptTX){ interruptTX = eventValue; interruptTxChanged = true; } break; case INTERRUPT_FRAME: if(eventValue != interruptFrame){ interruptFrame = eventValue; errorMask |= ERROR_FRAME; } break; case INTERRUPT_OVERRUN: if(eventValue != interruptOverrun){ interruptOverrun = eventValue; errorMask |= ERROR_OVERRUN; } break; case INTERRUPT_PARITY: if(eventValue != interruptParity){ interruptParity = eventValue; errorMask |= ERROR_PARITY; } if((mask & MASK_ERR) == MASK_ERR && errorMask != 0){ eventType = MASK_ERR; eventValue = errorMask; sendEvent = true; } break; case MASK_CTS: if(eventValue != preCTS){ preCTS = eventValue; if((mask & MASK_CTS) == MASK_CTS){ sendEvent = true; } } break; case MASK_DSR: if(eventValue != preDSR){ preDSR = eventValue; if((mask & MASK_DSR) == MASK_DSR){ sendEvent = true; } } break; case MASK_RING: if(eventValue != preRING){ preRING = eventValue; if((mask & MASK_RING) == MASK_RING){ sendEvent = true; } } break; case MASK_RLSD: /*DCD*/ if(eventValue != preRLSD){ preRLSD = eventValue; if((mask & MASK_RLSD) == MASK_RLSD){ sendEvent = true; } } break; case MASK_RXCHAR: if(((mask & MASK_RXCHAR) == MASK_RXCHAR) && (eventValue > 0)){ sendEvent = true; } break; /*case MASK_RXFLAG: //Do nothing at this moment if(((mask & MASK_RXFLAG) == MASK_RXFLAG) && (eventValue > 0)){ sendEvent = true; } break;*/ case MASK_TXEMPTY: if(((mask & MASK_TXEMPTY) == MASK_TXEMPTY) && (eventValue == 0) && interruptTxChanged){ sendEvent = true; } break; } if(sendEvent){ eventListener.serialEvent(new SerialPortEvent(portName, eventType, eventValue)); } } } //Need to sleep some time try { Thread.sleep(0, 100); } catch (Exception ex) { //Do nothing } } } } } java-simple-serial-connector-2.6.0/src/java/jssc/SerialPortException.java0000644000175000017500000000623412152352643026364 0ustar showardshoward/* jSSC (Java Simple Serial Connector) - serial port communication library. * © Alexey Sokolov (scream3r), 2010-2013. * * This file is part of jSSC. * * jSSC is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * jSSC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with jSSC. If not, see . * * If you use jSSC in public project you can inform me about this by e-mail, * of course if you want it. * * e-mail: scream3r.org@gmail.com * web-site: http://scream3r.org | http://code.google.com/p/java-simple-serial-connector/ */ package jssc; /** * * @author scream3r */ public class SerialPortException extends Exception { final public static String TYPE_PORT_ALREADY_OPENED = "Port already opened"; final public static String TYPE_PORT_NOT_OPENED = "Port not opened"; final public static String TYPE_CANT_SET_MASK = "Can't set mask"; final public static String TYPE_LISTENER_ALREADY_ADDED = "Event listener already added"; final public static String TYPE_LISTENER_THREAD_INTERRUPTED = "Event listener thread interrupted"; final public static String TYPE_CANT_REMOVE_LISTENER = "Can't remove event listener, because listener not added"; /** * @since 0.8 */ final public static String TYPE_PARAMETER_IS_NOT_CORRECT = "Parameter is not correct"; /** * @since 0.8 */ final public static String TYPE_NULL_NOT_PERMITTED = "Null not permitted"; /** * @since 0.9.0 */ final public static String TYPE_PORT_BUSY = "Port busy"; /** * @since 0.9.0 */ final public static String TYPE_PORT_NOT_FOUND = "Port not found"; /** * @since 2.2.0 */ final public static String TYPE_PERMISSION_DENIED = "Permission denied"; /** * @since 2.3.0 */ final public static String TYPE_INCORRECT_SERIAL_PORT = "Incorrect serial port"; private String portName; private String methodName; private String exceptionType; public SerialPortException(String portName, String methodName, String exceptionType){ super("Port name - " + portName + "; Method name - " + methodName + "; Exception type - " + exceptionType + "."); this.portName = portName; this.methodName = methodName; this.exceptionType = exceptionType; } /** * Getting port name during operation with which the exception was called */ public String getPortName(){ return portName; } /** * Getting method name during execution of which the exception was called */ public String getMethodName(){ return methodName; } /** * Getting exception type */ public String getExceptionType(){ return exceptionType; } } java-simple-serial-connector-2.6.0/src/cpp/0000755000175000017500000000000012152352643020450 5ustar showardshowardjava-simple-serial-connector-2.6.0/src/cpp/jssc_SerialNativeInterface.h0000644000175000017500000001304612152352643026056 0ustar showardshoward/* jSSC (Java Simple Serial Connector) - serial port communication library. * © Alexey Sokolov (scream3r), 2010-2013. * * This file is part of jSSC. * * jSSC is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * jSSC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with jSSC. If not, see . * * If you use jSSC in public project you can inform me about this by e-mail, * of course if you want it. * * e-mail: scream3r.org@gmail.com * web-site: http://scream3r.org | http://code.google.com/p/java-simple-serial-connector/ */ /* DO NOT EDIT THIS FILE - it is machine generated */ #include /* Header for class jssc_SerialNativeInterface */ #ifndef _Included_jssc_SerialNativeInterface #define _Included_jssc_SerialNativeInterface #ifdef __cplusplus extern "C" { #endif #undef jssc_SerialNativeInterface_OS_LINUX #define jssc_SerialNativeInterface_OS_LINUX 0L #undef jssc_SerialNativeInterface_OS_WINDOWS #define jssc_SerialNativeInterface_OS_WINDOWS 1L #undef jssc_SerialNativeInterface_OS_SOLARIS #define jssc_SerialNativeInterface_OS_SOLARIS 2L #undef jssc_SerialNativeInterface_OS_MAC_OS_X #define jssc_SerialNativeInterface_OS_MAC_OS_X 3L #undef jssc_SerialNativeInterface_ERR_PORT_BUSY #define jssc_SerialNativeInterface_ERR_PORT_BUSY -1LL #undef jssc_SerialNativeInterface_ERR_PORT_NOT_FOUND #define jssc_SerialNativeInterface_ERR_PORT_NOT_FOUND -2LL #undef jssc_SerialNativeInterface_ERR_PERMISSION_DENIED #define jssc_SerialNativeInterface_ERR_PERMISSION_DENIED -3LL #undef jssc_SerialNativeInterface_ERR_INCORRECT_SERIAL_PORT #define jssc_SerialNativeInterface_ERR_INCORRECT_SERIAL_PORT -4LL /* * Class: jssc_SerialNativeInterface * Method: openPort * Signature: (Ljava/lang/String;Z)J */ JNIEXPORT jlong JNICALL Java_jssc_SerialNativeInterface_openPort (JNIEnv *, jobject, jstring, jboolean); /* * Class: jssc_SerialNativeInterface * Method: setParams * Signature: (JIIIIZZI)Z */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setParams (JNIEnv *, jobject, jlong, jint, jint, jint, jint, jboolean, jboolean, jint); /* * Class: jssc_SerialNativeInterface * Method: purgePort * Signature: (JI)Z */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_purgePort (JNIEnv *, jobject, jlong, jint); /* * Class: jssc_SerialNativeInterface * Method: closePort * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_closePort (JNIEnv *, jobject, jlong); /* * Class: jssc_SerialNativeInterface * Method: setEventsMask * Signature: (JI)Z */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setEventsMask (JNIEnv *, jobject, jlong, jint); /* * Class: jssc_SerialNativeInterface * Method: getEventsMask * Signature: (J)I */ JNIEXPORT jint JNICALL Java_jssc_SerialNativeInterface_getEventsMask (JNIEnv *, jobject, jlong); /* * Class: jssc_SerialNativeInterface * Method: waitEvents * Signature: (J)[[I */ JNIEXPORT jobjectArray JNICALL Java_jssc_SerialNativeInterface_waitEvents (JNIEnv *, jobject, jlong); /* * Class: jssc_SerialNativeInterface * Method: setRTS * Signature: (JZ)Z */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setRTS (JNIEnv *, jobject, jlong, jboolean); /* * Class: jssc_SerialNativeInterface * Method: setDTR * Signature: (JZ)Z */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setDTR (JNIEnv *, jobject, jlong, jboolean); /* * Class: jssc_SerialNativeInterface * Method: readBytes * Signature: (JI)[B */ JNIEXPORT jbyteArray JNICALL Java_jssc_SerialNativeInterface_readBytes (JNIEnv *, jobject, jlong, jint); /* * Class: jssc_SerialNativeInterface * Method: writeBytes * Signature: (J[B)Z */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_writeBytes (JNIEnv *, jobject, jlong, jbyteArray); /* * Class: jssc_SerialNativeInterface * Method: getBuffersBytesCount * Signature: (J)[I */ JNIEXPORT jintArray JNICALL Java_jssc_SerialNativeInterface_getBuffersBytesCount (JNIEnv *, jobject, jlong); /* * Class: jssc_SerialNativeInterface * Method: setFlowControlMode * Signature: (JI)Z */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setFlowControlMode (JNIEnv *, jobject, jlong, jint); /* * Class: jssc_SerialNativeInterface * Method: getFlowControlMode * Signature: (J)I */ JNIEXPORT jint JNICALL Java_jssc_SerialNativeInterface_getFlowControlMode (JNIEnv *, jobject, jlong); /* * Class: jssc_SerialNativeInterface * Method: getSerialPortNames * Signature: ()[Ljava/lang/String; */ JNIEXPORT jobjectArray JNICALL Java_jssc_SerialNativeInterface_getSerialPortNames (JNIEnv *, jobject); /* * Class: jssc_SerialNativeInterface * Method: getLinesStatus * Signature: (J)[I */ JNIEXPORT jintArray JNICALL Java_jssc_SerialNativeInterface_getLinesStatus (JNIEnv *, jobject, jlong); /* * Class: jssc_SerialNativeInterface * Method: sendBreak * Signature: (JI)Z */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_sendBreak (JNIEnv *, jobject, jlong, jint); #ifdef __cplusplus } #endif #endif java-simple-serial-connector-2.6.0/src/cpp/windows/0000755000175000017500000000000012152352643022142 5ustar showardshowardjava-simple-serial-connector-2.6.0/src/cpp/windows/jssc.c++0000644000175000017500000005373012152352643023406 0ustar showardshoward/* jSSC (Java Simple Serial Connector) - serial port communication library. * © Alexey Sokolov (scream3r), 2010-2013. * * This file is part of jSSC. * * jSSC is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * jSSC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with jSSC. If not, see . * * If you use jSSC in public project you can inform me about this by e-mail, * of course if you want it. * * e-mail: scream3r.org@gmail.com * web-site: http://scream3r.org | http://code.google.com/p/java-simple-serial-connector/ */ #include #include #include #include "../jssc_SerialNativeInterface.h" //#include /* * Port opening. * * In 2.2.0 added useTIOCEXCL (not used in Windows, only for compatibility with _nix version) */ JNIEXPORT jlong JNICALL Java_jssc_SerialNativeInterface_openPort(JNIEnv *env, jobject object, jstring portName, jboolean useTIOCEXCL){ char prefix[] = "\\\\.\\"; const char* port = env->GetStringUTFChars(portName, JNI_FALSE); //since 2.1.0 -> string concat fix char portFullName[strlen(prefix) + strlen(port) + 1]; strcpy(portFullName, prefix); strcat(portFullName, port); //<- since 2.1.0 HANDLE hComm = CreateFile(portFullName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); env->ReleaseStringUTFChars(portName, port); //since 2.3.0 -> if(hComm != INVALID_HANDLE_VALUE){ DCB *dcb = new DCB(); if(!GetCommState(hComm, dcb)){ hComm = (HANDLE)jssc_SerialNativeInterface_ERR_INCORRECT_SERIAL_PORT;//(-4)Incorrect serial port } delete dcb; } else { DWORD errorValue = GetLastError(); if(errorValue == ERROR_ACCESS_DENIED){ hComm = (HANDLE)jssc_SerialNativeInterface_ERR_PORT_BUSY;//(-1)Port busy } else if(errorValue == ERROR_FILE_NOT_FOUND){ hComm = (HANDLE)jssc_SerialNativeInterface_ERR_PORT_NOT_FOUND;//(-2)Port not found } } //<- since 2.3.0 return (jlong)hComm;//since 2.4.0 changed to jlong }; /* * Setting serial port params. * * In 2.6.0 added flags (not used in Windows, only for compatibility with _nix version) */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setParams (JNIEnv *env, jobject object, jlong portHandle, jint baudRate, jint byteSize, jint stopBits, jint parity, jboolean setRTS, jboolean setDTR, jint flags){ HANDLE hComm = (HANDLE)portHandle; DCB *dcb = new DCB(); jboolean returnValue = JNI_FALSE; if(GetCommState(hComm, dcb)){ dcb->BaudRate = baudRate; dcb->ByteSize = byteSize; dcb->StopBits = stopBits; dcb->Parity = parity; //since 0.8 -> if(setRTS == JNI_TRUE){ dcb->fRtsControl = RTS_CONTROL_ENABLE; } else { dcb->fRtsControl = RTS_CONTROL_DISABLE; } if(setDTR == JNI_TRUE){ dcb->fDtrControl = DTR_CONTROL_ENABLE; } else { dcb->fDtrControl = DTR_CONTROL_DISABLE; } dcb->fOutxCtsFlow = FALSE; dcb->fOutxDsrFlow = FALSE; dcb->fDsrSensitivity = FALSE; dcb->fTXContinueOnXoff = TRUE; dcb->fOutX = FALSE; dcb->fInX = FALSE; dcb->fErrorChar = FALSE; dcb->fNull = FALSE; dcb->fAbortOnError = FALSE; dcb->XonLim = 2048; dcb->XoffLim = 512; dcb->XonChar = (char)17; //DC1 dcb->XoffChar = (char)19; //DC3 //<- since 0.8 if(SetCommState(hComm, dcb)){ //since 2.1.0 -> previously setted timeouts by another application should be cleared COMMTIMEOUTS *lpCommTimeouts = new COMMTIMEOUTS(); lpCommTimeouts->ReadIntervalTimeout = 0; lpCommTimeouts->ReadTotalTimeoutConstant = 0; lpCommTimeouts->ReadTotalTimeoutMultiplier = 0; lpCommTimeouts->WriteTotalTimeoutConstant = 0; lpCommTimeouts->WriteTotalTimeoutMultiplier = 0; if(SetCommTimeouts(hComm, lpCommTimeouts)){ returnValue = JNI_TRUE; } delete lpCommTimeouts; //<- since 2.1.0 } } delete dcb; return returnValue; } /* * PurgeComm */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_purgePort (JNIEnv *env, jobject object, jlong portHandle, jint flags){ HANDLE hComm = (HANDLE)portHandle; DWORD dwFlags = (DWORD)flags; return (PurgeComm(hComm, dwFlags) ? JNI_TRUE : JNI_FALSE); } /* * Port closing */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_closePort (JNIEnv *env, jobject object, jlong portHandle){ HANDLE hComm = (HANDLE)portHandle; return (CloseHandle(hComm) ? JNI_TRUE : JNI_FALSE); } /* * Set events mask */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setEventsMask (JNIEnv *env, jobject object, jlong portHandle, jint mask){ HANDLE hComm = (HANDLE)portHandle; DWORD dwEvtMask = (DWORD)mask; return (SetCommMask(hComm, dwEvtMask) ? JNI_TRUE : JNI_FALSE); } /* * Get events mask */ JNIEXPORT jint JNICALL Java_jssc_SerialNativeInterface_getEventsMask (JNIEnv *env, jobject object, jlong portHandle){ HANDLE hComm = (HANDLE)portHandle; DWORD lpEvtMask; if(GetCommMask(hComm, &lpEvtMask)){ return (jint)lpEvtMask; } else { return -1; } } /* * Change RTS line state (ON || OFF) */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setRTS (JNIEnv *env, jobject object, jlong portHandle, jboolean enabled){ HANDLE hComm = (HANDLE)portHandle; if(enabled == JNI_TRUE){ return (EscapeCommFunction(hComm, SETRTS) ? JNI_TRUE : JNI_FALSE); } else { return (EscapeCommFunction(hComm, CLRRTS) ? JNI_TRUE : JNI_FALSE); } } /* * Change DTR line state (ON || OFF) */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setDTR (JNIEnv *env, jobject object, jlong portHandle, jboolean enabled){ HANDLE hComm = (HANDLE)portHandle; if(enabled == JNI_TRUE){ return (EscapeCommFunction(hComm, SETDTR) ? JNI_TRUE : JNI_FALSE); } else { return (EscapeCommFunction(hComm, CLRDTR) ? JNI_TRUE : JNI_FALSE); } } /* * Write data to port * portHandle - port handle * buffer - byte array for sending */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_writeBytes (JNIEnv *env, jobject object, jlong portHandle, jbyteArray buffer){ HANDLE hComm = (HANDLE)portHandle; DWORD lpNumberOfBytesTransferred; DWORD lpNumberOfBytesWritten; OVERLAPPED *overlapped = new OVERLAPPED(); jboolean returnValue = JNI_FALSE; jbyte* jBuffer = env->GetByteArrayElements(buffer, JNI_FALSE); overlapped->hEvent = CreateEventA(NULL, true, false, NULL); if(WriteFile(hComm, jBuffer, (DWORD)env->GetArrayLength(buffer), &lpNumberOfBytesWritten, overlapped)){ returnValue = JNI_TRUE; } else if(GetLastError() == ERROR_IO_PENDING){ if(WaitForSingleObject(overlapped->hEvent, INFINITE) == WAIT_OBJECT_0){ if(GetOverlappedResult(hComm, overlapped, &lpNumberOfBytesTransferred, false)){ returnValue = JNI_TRUE; } } } env->ReleaseByteArrayElements(buffer, jBuffer, 0); CloseHandle(overlapped->hEvent); delete overlapped; return returnValue; } /* * Read data from port * portHandle - port handle * byteCount - count of bytes for reading */ JNIEXPORT jbyteArray JNICALL Java_jssc_SerialNativeInterface_readBytes (JNIEnv *env, jobject object, jlong portHandle, jint byteCount){ HANDLE hComm = (HANDLE)portHandle; DWORD lpNumberOfBytesTransferred; DWORD lpNumberOfBytesRead; OVERLAPPED *overlapped = new OVERLAPPED(); jbyte lpBuffer[byteCount]; jbyteArray returnArray = env->NewByteArray(byteCount); overlapped->hEvent = CreateEventA(NULL, true, false, NULL); if(ReadFile(hComm, lpBuffer, (DWORD)byteCount, &lpNumberOfBytesRead, overlapped)){ env->SetByteArrayRegion(returnArray, 0, byteCount, lpBuffer); } else if(GetLastError() == ERROR_IO_PENDING){ if(WaitForSingleObject(overlapped->hEvent, INFINITE) == WAIT_OBJECT_0){ if(GetOverlappedResult(hComm, overlapped, &lpNumberOfBytesTransferred, false)){ env->SetByteArrayRegion(returnArray, 0, byteCount, lpBuffer); } } } CloseHandle(overlapped->hEvent); delete overlapped; return returnArray; } /* * Get bytes count in serial port buffers (Input and Output) */ JNIEXPORT jintArray JNICALL Java_jssc_SerialNativeInterface_getBuffersBytesCount (JNIEnv *env, jobject object, jlong portHandle){ HANDLE hComm = (HANDLE)portHandle; jint returnValues[2]; returnValues[0] = -1; returnValues[1] = -1; jintArray returnArray = env->NewIntArray(2); DWORD lpErrors; COMSTAT *comstat = new COMSTAT(); if(ClearCommError(hComm, &lpErrors, comstat)){ returnValues[0] = (jint)comstat->cbInQue; returnValues[1] = (jint)comstat->cbOutQue; } else { returnValues[0] = -1; returnValues[1] = -1; } delete comstat; env->SetIntArrayRegion(returnArray, 0, 2, returnValues); return returnArray; } //since 0.8 -> const jint FLOWCONTROL_NONE = 0; const jint FLOWCONTROL_RTSCTS_IN = 1; const jint FLOWCONTROL_RTSCTS_OUT = 2; const jint FLOWCONTROL_XONXOFF_IN = 4; const jint FLOWCONTROL_XONXOFF_OUT = 8; //<- since 0.8 /* * Setting flow control mode * * since 0.8 */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setFlowControlMode (JNIEnv *env, jobject object, jlong portHandle, jint mask){ HANDLE hComm = (HANDLE)portHandle; jboolean returnValue = JNI_FALSE; DCB *dcb = new DCB(); if(GetCommState(hComm, dcb)){ dcb->fRtsControl = RTS_CONTROL_ENABLE; dcb->fOutxCtsFlow = FALSE; dcb->fOutX = FALSE; dcb->fInX = FALSE; if(mask != FLOWCONTROL_NONE){ if((mask & FLOWCONTROL_RTSCTS_IN) == FLOWCONTROL_RTSCTS_IN){ dcb->fRtsControl = RTS_CONTROL_HANDSHAKE; } if((mask & FLOWCONTROL_RTSCTS_OUT) == FLOWCONTROL_RTSCTS_OUT){ dcb->fOutxCtsFlow = TRUE; } if((mask & FLOWCONTROL_XONXOFF_IN) == FLOWCONTROL_XONXOFF_IN){ dcb->fInX = TRUE; } if((mask & FLOWCONTROL_XONXOFF_OUT) == FLOWCONTROL_XONXOFF_OUT){ dcb->fOutX = TRUE; } } if(SetCommState(hComm, dcb)){ returnValue = JNI_TRUE; } } delete dcb; return returnValue; } /* * Getting flow control mode * * since 0.8 */ JNIEXPORT jint JNICALL Java_jssc_SerialNativeInterface_getFlowControlMode (JNIEnv *env, jobject object, jlong portHandle){ HANDLE hComm = (HANDLE)portHandle; jint returnValue = 0; DCB *dcb = new DCB(); if(GetCommState(hComm, dcb)){ if(dcb->fRtsControl == RTS_CONTROL_HANDSHAKE){ returnValue |= FLOWCONTROL_RTSCTS_IN; } if(dcb->fOutxCtsFlow == TRUE){ returnValue |= FLOWCONTROL_RTSCTS_OUT; } if(dcb->fInX == TRUE){ returnValue |= FLOWCONTROL_XONXOFF_IN; } if(dcb->fOutX == TRUE){ returnValue |= FLOWCONTROL_XONXOFF_OUT; } } delete dcb; return returnValue; } /* * Send break for setted duration * * since 0.8 */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_sendBreak (JNIEnv *env, jobject object, jlong portHandle, jint duration){ HANDLE hComm = (HANDLE)portHandle; jboolean returnValue = JNI_FALSE; if(duration > 0){ if(SetCommBreak(hComm) > 0){ Sleep(duration); if(ClearCommBreak(hComm) > 0){ returnValue = JNI_TRUE; } } } return returnValue; } /* * Wait event * portHandle - port handle */ JNIEXPORT jobjectArray JNICALL Java_jssc_SerialNativeInterface_waitEvents (JNIEnv *env, jobject object, jlong portHandle) { HANDLE hComm = (HANDLE)portHandle; DWORD lpEvtMask = 0; DWORD lpNumberOfBytesTransferred = 0; OVERLAPPED *overlapped = new OVERLAPPED(); jclass intClass = env->FindClass("[I"); jobjectArray returnArray; boolean functionSuccessful = false; overlapped->hEvent = CreateEventA(NULL, true, false, NULL); if(WaitCommEvent(hComm, &lpEvtMask, overlapped)){ functionSuccessful = true; } else if(GetLastError() == ERROR_IO_PENDING){ if(WaitForSingleObject(overlapped->hEvent, INFINITE) == WAIT_OBJECT_0){ if(GetOverlappedResult(hComm, overlapped, &lpNumberOfBytesTransferred, false)){ functionSuccessful = true; } } } if(functionSuccessful){ boolean executeGetCommModemStatus = false; boolean executeClearCommError = false; DWORD events[9];//fixed since 0.8 (old value is 8) jint eventsCount = 0; if((EV_BREAK & lpEvtMask) == EV_BREAK){ events[eventsCount] = EV_BREAK; eventsCount++; } if((EV_CTS & lpEvtMask) == EV_CTS){ events[eventsCount] = EV_CTS; eventsCount++; executeGetCommModemStatus = true; } if((EV_DSR & lpEvtMask) == EV_DSR){ events[eventsCount] = EV_DSR; eventsCount++; executeGetCommModemStatus = true; } if((EV_ERR & lpEvtMask) == EV_ERR){ events[eventsCount] = EV_ERR; eventsCount++; executeClearCommError = true; } if((EV_RING & lpEvtMask) == EV_RING){ events[eventsCount] = EV_RING; eventsCount++; executeGetCommModemStatus = true; } if((EV_RLSD & lpEvtMask) == EV_RLSD){ events[eventsCount] = EV_RLSD; eventsCount++; executeGetCommModemStatus = true; } if((EV_RXCHAR & lpEvtMask) == EV_RXCHAR){ events[eventsCount] = EV_RXCHAR; eventsCount++; executeClearCommError = true; } if((EV_RXFLAG & lpEvtMask) == EV_RXFLAG){ events[eventsCount] = EV_RXFLAG; eventsCount++; executeClearCommError = true; } if((EV_TXEMPTY & lpEvtMask) == EV_TXEMPTY){ events[eventsCount] = EV_TXEMPTY; eventsCount++; executeClearCommError = true; } /* * Execute GetCommModemStatus function if it's needed (get lines status) */ jint statusCTS = 0; jint statusDSR = 0; jint statusRING = 0; jint statusRLSD = 0; boolean successGetCommModemStatus = false; if(executeGetCommModemStatus){ DWORD lpModemStat; if(GetCommModemStatus(hComm, &lpModemStat)){ successGetCommModemStatus = true; if((MS_CTS_ON & lpModemStat) == MS_CTS_ON){ statusCTS = 1; } if((MS_DSR_ON & lpModemStat) == MS_DSR_ON){ statusDSR = 1; } if((MS_RING_ON & lpModemStat) == MS_RING_ON){ statusRING = 1; } if((MS_RLSD_ON & lpModemStat) == MS_RLSD_ON){ statusRLSD = 1; } } else { jint lastError = (jint)GetLastError(); statusCTS = lastError; statusDSR = lastError; statusRING = lastError; statusRLSD = lastError; } } /* * Execute ClearCommError function if it's needed (get count of bytes in buffers and errors) */ jint bytesCountIn = 0; jint bytesCountOut = 0; jint communicationsErrors = 0; boolean successClearCommError = false; if(executeClearCommError){ DWORD lpErrors; COMSTAT *comstat = new COMSTAT(); if(ClearCommError(hComm, &lpErrors, comstat)){ successClearCommError = true; bytesCountIn = (jint)comstat->cbInQue; bytesCountOut = (jint)comstat->cbOutQue; communicationsErrors = (jint)lpErrors; } else { jint lastError = (jint)GetLastError(); bytesCountIn = lastError; bytesCountOut = lastError; communicationsErrors = lastError; } delete comstat; } /* * Create int[][] for events values */ returnArray = env->NewObjectArray(eventsCount, intClass, NULL); /* * Set events values */ for(jint i = 0; i < eventsCount; i++){ jint returnValues[2]; switch(events[i]){ case EV_BREAK: returnValues[0] = (jint)events[i]; returnValues[1] = 0; goto forEnd; case EV_CTS: returnValues[1] = statusCTS; goto modemStatus; case EV_DSR: returnValues[1] = statusDSR; goto modemStatus; case EV_ERR: returnValues[1] = communicationsErrors; goto bytesAndErrors; case EV_RING: returnValues[1] = statusRING; goto modemStatus; case EV_RLSD: returnValues[1] = statusRLSD; goto modemStatus; case EV_RXCHAR: returnValues[1] = bytesCountIn; goto bytesAndErrors; case EV_RXFLAG: returnValues[1] = bytesCountIn; goto bytesAndErrors; case EV_TXEMPTY: returnValues[1] = bytesCountOut; goto bytesAndErrors; default: returnValues[0] = (jint)events[i]; returnValues[1] = 0; goto forEnd; }; modemStatus: { if(successGetCommModemStatus){ returnValues[0] = (jint)events[i]; } else { returnValues[0] = -1; } goto forEnd; } bytesAndErrors: { if(successClearCommError){ returnValues[0] = (jint)events[i]; } else { returnValues[0] = -1; } goto forEnd; } forEnd: { jintArray singleResultArray = env->NewIntArray(2); env->SetIntArrayRegion(singleResultArray, 0, 2, returnValues); env->SetObjectArrayElement(returnArray, i, singleResultArray); }; } } else { returnArray = env->NewObjectArray(1, intClass, NULL); jint returnValues[2]; returnValues[0] = -1; returnValues[1] = (jint)GetLastError(); jintArray singleResultArray = env->NewIntArray(2); env->SetIntArrayRegion(singleResultArray, 0, 2, returnValues); env->SetObjectArrayElement(returnArray, 0, singleResultArray); }; CloseHandle(overlapped->hEvent); delete overlapped; return returnArray; } /* * Get serial port names */ JNIEXPORT jobjectArray JNICALL Java_jssc_SerialNativeInterface_getSerialPortNames (JNIEnv *env, jobject object){ HKEY phkResult; LPCSTR lpSubKey = "HARDWARE\\DEVICEMAP\\SERIALCOMM\\"; jobjectArray returnArray = NULL; if(RegOpenKeyExA(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_READ, &phkResult) == ERROR_SUCCESS){ boolean hasMoreElements = true; DWORD keysCount = 0; char valueName[256]; DWORD valueNameSize; DWORD enumResult; while(hasMoreElements){ valueNameSize = 256; enumResult = RegEnumValueA(phkResult, keysCount, valueName, &valueNameSize, NULL, NULL, NULL, NULL); if(enumResult == ERROR_SUCCESS){ keysCount++; } else if(enumResult == ERROR_NO_MORE_ITEMS){ hasMoreElements = false; } else { hasMoreElements = false; } } if(keysCount > 0){ jclass stringClass = env->FindClass("java/lang/String"); returnArray = env->NewObjectArray((jsize)keysCount, stringClass, NULL); char lpValueName[256]; DWORD lpcchValueName; byte lpData[256]; DWORD lpcbData; DWORD result; for(DWORD i = 0; i < keysCount; i++){ lpcchValueName = 256; lpcbData = 256; result = RegEnumValueA(phkResult, i, lpValueName, &lpcchValueName, NULL, NULL, lpData, &lpcbData); if(result == ERROR_SUCCESS){ env->SetObjectArrayElement(returnArray, i, env->NewStringUTF((char*)lpData)); } } } CloseHandle(phkResult); } return returnArray; } /* * Get lines status * * returnValues[0] - CTS * returnValues[1] - DSR * returnValues[2] - RING * returnValues[3] - RLSD * */ JNIEXPORT jintArray JNICALL Java_jssc_SerialNativeInterface_getLinesStatus (JNIEnv *env, jobject object, jlong portHandle){ HANDLE hComm = (HANDLE)portHandle; DWORD lpModemStat; jint returnValues[4]; for(jint i = 0; i < 4; i++){ returnValues[i] = 0; } jintArray returnArray = env->NewIntArray(4); if(GetCommModemStatus(hComm, &lpModemStat)){ if((MS_CTS_ON & lpModemStat) == MS_CTS_ON){ returnValues[0] = 1; } if((MS_DSR_ON & lpModemStat) == MS_DSR_ON){ returnValues[1] = 1; } if((MS_RING_ON & lpModemStat) == MS_RING_ON){ returnValues[2] = 1; } if((MS_RLSD_ON & lpModemStat) == MS_RLSD_ON){ returnValues[3] = 1; } } env->SetIntArrayRegion(returnArray, 0, 4, returnValues); return returnArray; } java-simple-serial-connector-2.6.0/src/cpp/_nix_based/0000755000175000017500000000000012152352643022543 5ustar showardshowardjava-simple-serial-connector-2.6.0/src/cpp/_nix_based/jssc.cpp0000644000175000017500000006113312152352643024215 0ustar showardshoward/* jSSC (Java Simple Serial Connector) - serial port communication library. * © Alexey Sokolov (scream3r), 2010-2013. * * This file is part of jSSC. * * jSSC is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * jSSC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with jSSC. If not, see . * * If you use jSSC in public project you can inform me about this by e-mail, * of course if you want it. * * e-mail: scream3r.org@gmail.com * web-site: http://scream3r.org | http://code.google.com/p/java-simple-serial-connector/ */ #include #include #include #include #include #include #include //-D_TS_ERRNO use for Solaris C++ compiler #include //since 2.5.0 #ifdef __linux__ #include #endif #ifdef __SunOS #include //Needed for FIONREAD in Solaris #include //Needed for select() function #endif #ifdef __APPLE__ #include //Needed for IOSSIOSPEED in Mac OS X (Non standard baudrate) #endif #include #include "../jssc_SerialNativeInterface.h" //#include //-lCstd use for Solaris linker /* OK */ /* * Port opening * * In 2.2.0 added useTIOCEXCL */ JNIEXPORT jlong JNICALL Java_jssc_SerialNativeInterface_openPort(JNIEnv *env, jobject object, jstring portName, jboolean useTIOCEXCL){ const char* port = env->GetStringUTFChars(portName, JNI_FALSE); jlong hComm = open(port, O_RDWR | O_NOCTTY | O_NDELAY); if(hComm != -1){ //since 2.2.0 -> (check termios structure for separating real serial devices from others) termios *settings = new termios(); if(tcgetattr(hComm, settings) == 0){ #if defined TIOCEXCL //&& !defined __SunOS if(useTIOCEXCL == JNI_TRUE){ ioctl(hComm, TIOCEXCL); } #endif int flags = fcntl(hComm, F_GETFL, 0); flags &= ~O_NDELAY; fcntl(hComm, F_SETFL, flags); } else { hComm = jssc_SerialNativeInterface_ERR_INCORRECT_SERIAL_PORT;//-4; } delete settings; //<- since 2.2.0 } else {//since 0.9 -> if(errno == EBUSY){//Port busy hComm = jssc_SerialNativeInterface_ERR_PORT_BUSY;//-1 } else if(errno == ENOENT){//Port not found hComm = jssc_SerialNativeInterface_ERR_PORT_NOT_FOUND;//-2; }//-> since 2.2.0 else if(errno == EACCES){//Permission denied hComm = jssc_SerialNativeInterface_ERR_PERMISSION_DENIED;//-3; } else { hComm = jssc_SerialNativeInterface_ERR_PORT_NOT_FOUND;//-2; }//<- since 2.2.0 }//<- since 0.9 env->ReleaseStringUTFChars(portName, port); return hComm; } /* OK */ /* * Choose baudrate */ speed_t getBaudRateByNum(jint baudRate) { switch(baudRate){ case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif #ifdef B115200 case 115200: return B115200; #endif #ifdef B230400 case 230400: return B230400; #endif #ifdef B460800 case 460800: return B460800; #endif #ifdef B500000 case 500000: return B500000; #endif #ifdef B576000 case 576000: return B576000; #endif #ifdef B921600 case 921600: return B921600; #endif #ifdef B1000000 case 1000000: return B1000000; #endif #ifdef B1152000 case 1152000: return B1152000; #endif #ifdef B1500000 case 1500000: return B1500000; #endif #ifdef B2000000 case 2000000: return B2000000; #endif #ifdef B2500000 case 2500000: return B2500000; #endif #ifdef B3000000 case 3000000: return B3000000; #endif #ifdef B3500000 case 3500000: return B3500000; #endif #ifdef B4000000 case 4000000: return B4000000; #endif default: return -1; } } /* OK */ /* * Choose data bits */ int getDataBitsByNum(jint byteSize) { switch(byteSize){ case 5: return CS5; case 6: return CS6; case 7: return CS7; case 8: return CS8; default: return -1; } } //since 2.6.0 -> const jint PARAMS_FLAG_IGNPAR = 1; const jint PARAMS_FLAG_PARMRK = 2; //<- since 2.6.0 /* OK */ /* * Set serial port settings * * In 2.6.0 added flags parameter */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setParams (JNIEnv *env, jobject object, jlong portHandle, jint baudRate, jint byteSize, jint stopBits, jint parity, jboolean setRTS, jboolean setDTR, jint flags){ jboolean returnValue = JNI_FALSE; speed_t baudRateValue = getBaudRateByNum(baudRate); int dataBits = getDataBitsByNum(byteSize); termios *settings = new termios(); if(tcgetattr(portHandle, settings) == 0){ if(baudRateValue != -1){ //Set standart baudrate from "termios.h" if(cfsetispeed(settings, baudRateValue) < 0 || cfsetospeed(settings, baudRateValue) < 0){ goto methodEnd; } } else { #ifdef __SunOS goto methodEnd;//Solaris don't support non standart baudrates #elif defined __linux__ //Try to calculate a divisor for setting non standart baudrate serial_struct *serial_info = new serial_struct(); if(ioctl(portHandle, TIOCGSERIAL, serial_info) < 0){ //Getting serial_info structure delete serial_info; goto methodEnd; } else { serial_info->flags |= ASYNC_SPD_CUST; serial_info->custom_divisor = (serial_info->baud_base/baudRate); //Calculate divisor if(serial_info->custom_divisor == 0){ //If divisor == 0 go to method end to prevent "division by zero" error delete serial_info; goto methodEnd; } settings->c_cflag |= B38400; if(cfsetispeed(settings, B38400) < 0 || cfsetospeed(settings, B38400) < 0){ delete serial_info; goto methodEnd; } if(ioctl(portHandle, TIOCSSERIAL, serial_info) < 0){//Try to set new settings with non standart baudrate delete serial_info; goto methodEnd; } delete serial_info; } #endif } } /* * Setting data bits */ if(dataBits != -1){ settings->c_cflag &= ~CSIZE; settings->c_cflag |= dataBits; } else { goto methodEnd; } /* * Setting stop bits */ if(stopBits == 0){ //1 stop bit (for info see ->> MSDN) settings->c_cflag &= ~CSTOPB; } else if((stopBits == 1) || (stopBits == 2)){ //1 == 1.5 stop bits; 2 == 2 stop bits (for info see ->> MSDN) settings->c_cflag |= CSTOPB; } else { goto methodEnd; } settings->c_cflag |= (CREAD | CLOCAL); settings->c_cflag &= ~CRTSCTS; settings->c_lflag &= ~(ICANON | ECHO | ECHOE | ECHOK | ECHONL | ECHOCTL | ECHOPRT | ECHOKE | ISIG | IEXTEN); settings->c_iflag &= ~(IXON | IXOFF | IXANY | INPCK | IGNPAR | PARMRK | ISTRIP | IGNBRK | BRKINT | INLCR | IGNCR| ICRNL); #ifdef IUCLC settings->c_iflag &= ~IUCLC; #endif settings->c_oflag &= ~OPOST; //since 2.6.0 -> if((flags & PARAMS_FLAG_IGNPAR) == PARAMS_FLAG_IGNPAR){ settings->c_iflag |= IGNPAR; } if((flags & PARAMS_FLAG_PARMRK) == PARAMS_FLAG_PARMRK){ settings->c_iflag |= PARMRK; } //<- since 2.6.0 //since 0.9 -> settings->c_cc[VMIN] = 0; settings->c_cc[VTIME] = 0; //<- since 0.9 /* * Parity bits */ #ifdef PAREXT settings->c_cflag &= ~(PARENB | PARODD | PAREXT);//Clear parity settings #elif defined CMSPAR settings->c_cflag &= ~(PARENB | PARODD | CMSPAR);//Clear parity settings #else settings->c_cflag &= ~(PARENB | PARODD);//Clear parity settings #endif if(parity == 1){//Parity ODD settings->c_cflag |= (PARENB | PARODD); settings->c_iflag |= INPCK; } else if(parity == 2){//Parity EVEN settings->c_cflag |= PARENB; settings->c_iflag |= INPCK; } else if(parity == 3){//Parity MARK #ifdef PAREXT settings->c_cflag |= (PARENB | PARODD | PAREXT); settings->c_iflag |= INPCK; #elif defined CMSPAR settings->c_cflag |= (PARENB | PARODD | CMSPAR); settings->c_iflag |= INPCK; #endif } else if(parity == 4){//Parity SPACE #ifdef PAREXT settings->c_cflag |= (PARENB | PAREXT); settings->c_iflag |= INPCK; #elif defined CMSPAR settings->c_cflag |= (PARENB | CMSPAR); settings->c_iflag |= INPCK; #endif } else if(parity == 0){ //Do nothing (Parity NONE) } else { goto methodEnd; } if(tcsetattr(portHandle, TCSANOW, settings) == 0){//Try to set all settings #ifdef __APPLE__ //Try to set non-standard baud rate in Mac OS X if(baudRateValue == -1){ speed_t speed = (speed_t)baudRate; if(ioctl(portHandle, IOSSIOSPEED, &speed) < 0){//IOSSIOSPEED must be used only after tcsetattr goto methodEnd; } } #endif int lineStatus; if(ioctl(portHandle, TIOCMGET, &lineStatus) >= 0){ if(setRTS == JNI_TRUE){ lineStatus |= TIOCM_RTS; } else { lineStatus &= ~TIOCM_RTS; } if(setDTR == JNI_TRUE){ lineStatus |= TIOCM_DTR; } else { lineStatus &= ~TIOCM_DTR; } if(ioctl(portHandle, TIOCMSET, &lineStatus) >= 0){ returnValue = JNI_TRUE; } } } methodEnd: { delete settings; return returnValue; } } const jint PURGE_RXABORT = 0x0002; //ignored const jint PURGE_RXCLEAR = 0x0008; const jint PURGE_TXABORT = 0x0001; //ignored const jint PURGE_TXCLEAR = 0x0004; /* OK */ /* * PurgeComm */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_purgePort (JNIEnv *env, jobject object, jlong portHandle, jint flags){ int clearValue = -1; if((flags & PURGE_RXCLEAR) && (flags & PURGE_TXCLEAR)){ clearValue = TCIOFLUSH; } else if(flags & PURGE_RXCLEAR) { clearValue = TCIFLUSH; } else if(flags & PURGE_TXCLEAR) { clearValue = TCOFLUSH; } else if((flags & PURGE_RXABORT) || (flags & PURGE_TXABORT)){ return JNI_TRUE; } else { return JNI_FALSE; } return tcflush(portHandle, clearValue) == 0 ? JNI_TRUE : JNI_FALSE; } /* OK */ /* Closing the port */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_closePort (JNIEnv *env, jobject object, jlong portHandle){ #if defined TIOCNXCL //&& !defined __SunOS ioctl(portHandle, TIOCNXCL);//since 2.1.0 Clear exclusive port access on closing #endif return close(portHandle) == 0 ? JNI_TRUE : JNI_FALSE; } /* OK */ /* * Setting events mask */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setEventsMask (JNIEnv *env, jobject object, jlong portHandle, jint mask){ //Don't needed in linux, implemented in java code return JNI_TRUE; } /* OK */ /* * Getting events mask */ JNIEXPORT jint JNICALL Java_jssc_SerialNativeInterface_getEventsMask (JNIEnv *env, jobject object, jlong portHandle){ //Don't needed in linux, implemented in java code return -1; } /* OK */ /* * RTS line status changing (ON || OFF) */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setRTS (JNIEnv *env, jobject object, jlong portHandle, jboolean enabled){ int returnValue = 0; int lineStatus; ioctl(portHandle, TIOCMGET, &lineStatus); if(enabled == JNI_TRUE){ lineStatus |= TIOCM_RTS; } else { lineStatus &= ~TIOCM_RTS; } returnValue = ioctl(portHandle, TIOCMSET, &lineStatus); return (returnValue >= 0 ? JNI_TRUE : JNI_FALSE); } /* OK */ /* * DTR line status changing (ON || OFF) */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setDTR (JNIEnv *env, jobject object, jlong portHandle, jboolean enabled){ int returnValue = 0; int lineStatus; ioctl(portHandle, TIOCMGET, &lineStatus); if(enabled == JNI_TRUE){ lineStatus |= TIOCM_DTR; } else { lineStatus &= ~TIOCM_DTR; } returnValue = ioctl(portHandle, TIOCMSET, &lineStatus); return (returnValue >= 0 ? JNI_TRUE : JNI_FALSE); } /* OK */ /* * Writing data to the port */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_writeBytes (JNIEnv *env, jobject object, jlong portHandle, jbyteArray buffer){ jbyte* jBuffer = env->GetByteArrayElements(buffer, JNI_FALSE); jint bufferSize = env->GetArrayLength(buffer); jint result = write(portHandle, jBuffer, (size_t)bufferSize); env->ReleaseByteArrayElements(buffer, jBuffer, 0); return result == bufferSize ? JNI_TRUE : JNI_FALSE; } /* OK */ /* * Reading data from the port * * Rewrited in 2.5.0 (using select() function for correct block reading in MacOS X) */ JNIEXPORT jbyteArray JNICALL Java_jssc_SerialNativeInterface_readBytes (JNIEnv *env, jobject object, jlong portHandle, jint byteCount){ fd_set read_fd_set; jbyte *lpBuffer = new jbyte[byteCount]; int byteRemains = byteCount; while(byteRemains > 0) { FD_ZERO(&read_fd_set); FD_SET(portHandle, &read_fd_set); select(portHandle + 1, &read_fd_set, NULL, NULL, NULL); int result = read(portHandle, lpBuffer + (byteCount - byteRemains), byteRemains); if(result > 0){ byteRemains -= result; } } FD_CLR(portHandle, &read_fd_set); jbyteArray returnArray = env->NewByteArray(byteCount); env->SetByteArrayRegion(returnArray, 0, byteCount, lpBuffer); delete lpBuffer; return returnArray; } /* OK */ /* * Get bytes count in serial port buffers (Input and Output) */ JNIEXPORT jintArray JNICALL Java_jssc_SerialNativeInterface_getBuffersBytesCount (JNIEnv *env, jobject object, jlong portHandle){ jint returnValues[2]; returnValues[0] = -1; //Input buffer returnValues[1] = -1; //Output buffer jintArray returnArray = env->NewIntArray(2); ioctl(portHandle, FIONREAD, &returnValues[0]); ioctl(portHandle, TIOCOUTQ, &returnValues[1]); env->SetIntArrayRegion(returnArray, 0, 2, returnValues); return returnArray; } const jint FLOWCONTROL_NONE = 0; const jint FLOWCONTROL_RTSCTS_IN = 1; const jint FLOWCONTROL_RTSCTS_OUT = 2; const jint FLOWCONTROL_XONXOFF_IN = 4; const jint FLOWCONTROL_XONXOFF_OUT = 8; /* OK */ /* * Setting flow control mode */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setFlowControlMode (JNIEnv *env, jobject object, jlong portHandle, jint mask){ jboolean returnValue = JNI_FALSE; termios *settings = new termios(); if(tcgetattr(portHandle, settings) == 0){ settings->c_cflag &= ~CRTSCTS; settings->c_iflag &= ~(IXON | IXOFF); if(mask != FLOWCONTROL_NONE){ if(((mask & FLOWCONTROL_RTSCTS_IN) == FLOWCONTROL_RTSCTS_IN) || ((mask & FLOWCONTROL_RTSCTS_OUT) == FLOWCONTROL_RTSCTS_OUT)){ settings->c_cflag |= CRTSCTS; } if((mask & FLOWCONTROL_XONXOFF_IN) == FLOWCONTROL_XONXOFF_IN){ settings->c_iflag |= IXOFF; } if((mask & FLOWCONTROL_XONXOFF_OUT) == FLOWCONTROL_XONXOFF_OUT){ settings->c_iflag |= IXON; } } if(tcsetattr(portHandle, TCSANOW, settings) == 0){ returnValue = JNI_TRUE; } } delete settings; return returnValue; } /* OK */ /* * Getting flow control mode */ JNIEXPORT jint JNICALL Java_jssc_SerialNativeInterface_getFlowControlMode (JNIEnv *env, jobject object, jlong portHandle){ jint returnValue = 0; termios *settings = new termios(); if(tcgetattr(portHandle, settings) == 0){ if(settings->c_cflag & CRTSCTS){ returnValue |= (FLOWCONTROL_RTSCTS_IN | FLOWCONTROL_RTSCTS_OUT); } if(settings->c_iflag & IXOFF){ returnValue |= FLOWCONTROL_XONXOFF_IN; } if(settings->c_iflag & IXON){ returnValue |= FLOWCONTROL_XONXOFF_OUT; } } return returnValue; } /* OK */ /* * Send break for setted duration */ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_sendBreak (JNIEnv *env, jobject object, jlong portHandle, jint duration){ jboolean returnValue = JNI_FALSE; if(duration > 0){ if(ioctl(portHandle, TIOCSBRK, 0) >= 0){ int sec = (duration >= 1000 ? duration/1000 : 0); int nanoSec = (sec > 0 ? duration - sec*1000 : duration)*1000000; struct timespec *timeStruct = new timespec(); timeStruct->tv_sec = sec; timeStruct->tv_nsec = nanoSec; nanosleep(timeStruct, NULL); delete(timeStruct); if(ioctl(portHandle, TIOCCBRK, 0) >= 0){ returnValue = JNI_TRUE; } } } return returnValue; } /* OK */ /* * Return "statusLines" from ioctl(portHandle, TIOCMGET, &statusLines) * Need for "_waitEvents" and "_getLinesStatus" */ int getLinesStatus(jlong portHandle) { int statusLines; ioctl(portHandle, TIOCMGET, &statusLines); return statusLines; } /* OK */ /* * Not supported in Solaris and Mac OS X * * Get interrupts count for: * 0 - Break(for BREAK event) * 1 - TX(for TXEMPTY event) * --ERRORS(for ERR event)-- * 2 - Frame * 3 - Overrun * 4 - Parity */ void getInterruptsCount(jlong portHandle, int intArray[]) { #ifdef TIOCGICOUNT struct serial_icounter_struct *icount = new serial_icounter_struct(); if(ioctl(portHandle, TIOCGICOUNT, icount) >= 0){ intArray[0] = icount->brk; intArray[1] = icount->tx; intArray[2] = icount->frame; intArray[3] = icount->overrun; intArray[4] = icount->parity; } delete icount; #endif } const jint INTERRUPT_BREAK = 512; const jint INTERRUPT_TX = 1024; const jint INTERRUPT_FRAME = 2048; const jint INTERRUPT_OVERRUN = 4096; const jint INTERRUPT_PARITY = 8192; const jint EV_CTS = 8; const jint EV_DSR = 16; const jint EV_RING = 256; const jint EV_RLSD = 32; const jint EV_RXCHAR = 1; //const jint EV_RXFLAG = 2; //Not supported const jint EV_TXEMPTY = 4; const jint events[] = {INTERRUPT_BREAK, INTERRUPT_TX, INTERRUPT_FRAME, INTERRUPT_OVERRUN, INTERRUPT_PARITY, EV_CTS, EV_DSR, EV_RING, EV_RLSD, EV_RXCHAR, //EV_RXFLAG, //Not supported EV_TXEMPTY}; /* OK */ /* * Collecting data for EventListener class (Linux have no implementation of "WaitCommEvent" function from Windows) * */ JNIEXPORT jobjectArray JNICALL Java_jssc_SerialNativeInterface_waitEvents (JNIEnv *env, jobject object, jlong portHandle) { jclass intClass = env->FindClass("[I"); jobjectArray returnArray = env->NewObjectArray(sizeof(events)/sizeof(jint), intClass, NULL); /*Input buffer*/ jint bytesCountIn = 0; ioctl(portHandle, FIONREAD, &bytesCountIn); /*Output buffer*/ jint bytesCountOut = 0; ioctl(portHandle, TIOCOUTQ, &bytesCountOut); /*Lines status*/ int statusLines = getLinesStatus(portHandle); jint statusCTS = 0; jint statusDSR = 0; jint statusRING = 0; jint statusRLSD = 0; /*CTS status*/ if(statusLines & TIOCM_CTS){ statusCTS = 1; } /*DSR status*/ if(statusLines & TIOCM_DSR){ statusDSR = 1; } /*RING status*/ if(statusLines & TIOCM_RNG){ statusRING = 1; } /*RLSD(DCD) status*/ if(statusLines & TIOCM_CAR){ statusRLSD = 1; } /*Interrupts*/ int interrupts[] = {-1, -1, -1, -1, -1}; getInterruptsCount(portHandle, interrupts); jint interruptBreak = interrupts[0]; jint interruptTX = interrupts[1]; jint interruptFrame = interrupts[2]; jint interruptOverrun = interrupts[3]; jint interruptParity = interrupts[4]; for(int i = 0; i < sizeof(events)/sizeof(jint); i++){ jint returnValues[2]; switch(events[i]) { case INTERRUPT_BREAK: //Interrupt Break - for BREAK event returnValues[1] = interruptBreak; goto forEnd; case INTERRUPT_TX: //Interrupt TX - for TXEMPTY event returnValues[1] = interruptTX; goto forEnd; case INTERRUPT_FRAME: //Interrupt Frame - for ERR event returnValues[1] = interruptFrame; goto forEnd; case INTERRUPT_OVERRUN: //Interrupt Overrun - for ERR event returnValues[1] = interruptOverrun; goto forEnd; case INTERRUPT_PARITY: //Interrupt Parity - for ERR event returnValues[1] = interruptParity; goto forEnd; case EV_CTS: returnValues[1] = statusCTS; goto forEnd; case EV_DSR: returnValues[1] = statusDSR; goto forEnd; case EV_RING: returnValues[1] = statusRING; goto forEnd; case EV_RLSD: /*DCD*/ returnValues[1] = statusRLSD; goto forEnd; case EV_RXCHAR: returnValues[1] = bytesCountIn; goto forEnd; /*case EV_RXFLAG: // Event RXFLAG - Not supported returnValues[0] = EV_RXFLAG; returnValues[1] = 0; goto forEnd;*/ case EV_TXEMPTY: returnValues[1] = bytesCountOut; goto forEnd; } forEnd: { returnValues[0] = events[i]; jintArray singleResultArray = env->NewIntArray(2); env->SetIntArrayRegion(singleResultArray, 0, 2, returnValues); env->SetObjectArrayElement(returnArray, i, singleResultArray); }; } return returnArray; } /* OK */ /* * Getting serial ports names like an a String array (String[]) */ JNIEXPORT jobjectArray JNICALL Java_jssc_SerialNativeInterface_getSerialPortNames (JNIEnv *env, jobject object){ //Don't needed in linux, implemented in java code (Note: null will be returned) return NULL; } /* OK */ /* * Getting lines status * * returnValues[0] - CTS * returnValues[1] - DSR * returnValues[2] - RING * returnValues[3] - RLSD(DCD) */ JNIEXPORT jintArray JNICALL Java_jssc_SerialNativeInterface_getLinesStatus (JNIEnv *env, jobject object, jlong portHandle){ jint returnValues[4]; for(jint i = 0; i < 4; i++){ returnValues[i] = 0; } jintArray returnArray = env->NewIntArray(4); /*Lines status*/ int statusLines = getLinesStatus(portHandle); /*CTS status*/ if(statusLines & TIOCM_CTS){ returnValues[0] = 1; } /*DSR status*/ if(statusLines & TIOCM_DSR){ returnValues[1] = 1; } /*RING status*/ if(statusLines & TIOCM_RNG){ returnValues[2] = 1; } /*RLSD(DCD) status*/ if(statusLines & TIOCM_CAR){ returnValues[3] = 1; } env->SetIntArrayRegion(returnArray, 0, 4, returnValues); return returnArray; }