From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From nate at n4te.com Thu Nov 26 14:32:21 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 13:32:21 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Ah, thanks Ivan. What do you think about supporting both 32 bit and 64 bit DLLs, with the correct one chosen at runtime? This way I don't need two separate versions of my app. -Nate 2009/11/26 Ivan Maidanski : > Nate wrote: >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >> I see a user has come up with a workaround for 64 bit OS X. Has anyone >> done this for Windows? Are there plans to support 64 bit Windows? > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > >> >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >> Other open source projects such as LWJGL (http://lwjgl.org/) include >> both 32 and 64 bit native libs and the correct lib is automatically >> used. >> >> -Nate > > From ivmai at mail.ru Thu Nov 26 14:52:53 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Fri, 27 Nov 2009 00:52:53 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan From Kapil_Gupta at hcl.in Thu Nov 26 22:47:13 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 27 Nov 2009 11:17:13 +0530 Subject: [Rxtx] Rxtx Digest, Vol 27, Issue 7 In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960FDD2F38A@NDA-HCLT-EVS05.HCLT. CORP.HCL.IN-F0913EFA-B2A5-28E5-3684-11AABE813CF9> Hi, I am also facing the same issue as Mariusz is facing, I am facing it on Intel Mac 10.5.8. I am using RXTX 2.2 Pre binaries. First time I am able to read the data from my device, but second time port open hangs (RXTXPort.java). I am using TI chip set in my device. I created a C sample to test the driver but that works perfectly to read device any number of times. No hangs !! Note: My sample works fine on Windows XP. Please help. Thanks, Kapil -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Thursday, November 26, 2009 6:50 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 27, Issue 7 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! (M.Dec-GMail) 2. Re: Patch adding monThread setDaemon (Steffen DETTMER) 3. Re: Patch adding monThread setDaemon (Ivan Maidanski) 4. Patch for WinCE readArray (Ivan Maidanski) 5. Re: Patch adding monThread setDaemon (Ivan Maidanski) 6. Re: SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! (Ivan Maidanski) 7. Re: Patch adding monThread setDaemon (Trent Jarvi) 8. 64 bit (Nate) 9. Re: 64 bit (Ivan Maidanski) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Nov 2009 20:23:54 +0100 From: "M.Dec-GMail" To: Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2 at mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end ------------------------------ Message: 2 Date: Mon, 23 Nov 2009 22:26:36 +0100 From: "Steffen DETTMER" To: "rxtx" Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset="utf-8" > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail ------------------------------ Message: 3 Date: Tue, 24 Nov 2009 10:36:34 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 4 Date: Tue, 24 Nov 2009 22:26:00 +0300 From: Ivan Maidanski To: rxtx Subject: [Rxtx] Patch for WinCE readArray Message-ID: Content-Type: text/plain; charset="koi8-r" Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: ------------------------------ Message: 5 Date: Tue, 24 Nov 2009 22:33:41 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 6 Date: Tue, 24 Nov 2009 22:38:40 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! Message-ID: Content-Type: text/plain; charset=koi8-r Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) ------------------------------ Message: 7 Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) From: Trent Jarvi To: Ivan Maidanski Cc: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------ Message: 8 Date: Thu, 26 Nov 2009 05:08:27 -0800 From: Nate To: rxtx at qbang.org Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate ------------------------------ Message: 9 Date: Thu, 26 Nov 2009 16:24:21 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] 64 bit Message-ID: Content-Type: text/plain; charset=koi8-r Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate ------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx End of Rxtx Digest, Vol 27, Issue 7 *********************************** DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From m.kirkland at comcast.net Fri Nov 27 01:56:33 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 27 Nov 2009 00:56:33 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Or you could try the following utility which will modify the native library search path at run time based on the os.name and os.arch system properties. http://hamware.info/tools/LibLoader.zip Read the comments in the code and the properties file for details. Mike -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Ivan Maidanski Sent: Thursday, November 26, 2009 1:53 PM To: rxtx Subject: Re: [Rxtx] 64 bit Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From nate at n4te.com Thu Nov 26 14:32:21 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 13:32:21 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Ah, thanks Ivan. What do you think about supporting both 32 bit and 64 bit DLLs, with the correct one chosen at runtime? This way I don't need two separate versions of my app. -Nate 2009/11/26 Ivan Maidanski : > Nate wrote: >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >> I see a user has come up with a workaround for 64 bit OS X. Has anyone >> done this for Windows? Are there plans to support 64 bit Windows? > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > >> >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >> Other open source projects such as LWJGL (http://lwjgl.org/) include >> both 32 and 64 bit native libs and the correct lib is automatically >> used. >> >> -Nate > > From ivmai at mail.ru Thu Nov 26 14:52:53 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Fri, 27 Nov 2009 00:52:53 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan From Kapil_Gupta at hcl.in Thu Nov 26 22:47:13 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 27 Nov 2009 11:17:13 +0530 Subject: [Rxtx] Rxtx Digest, Vol 27, Issue 7 In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960FDD2F38A@NDA-HCLT-EVS05.HCLT. CORP.HCL.IN-F0913EFA-B2A5-28E5-3684-11AABE813CF9> Hi, I am also facing the same issue as Mariusz is facing, I am facing it on Intel Mac 10.5.8. I am using RXTX 2.2 Pre binaries. First time I am able to read the data from my device, but second time port open hangs (RXTXPort.java). I am using TI chip set in my device. I created a C sample to test the driver but that works perfectly to read device any number of times. No hangs !! Note: My sample works fine on Windows XP. Please help. Thanks, Kapil -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Thursday, November 26, 2009 6:50 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 27, Issue 7 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! (M.Dec-GMail) 2. Re: Patch adding monThread setDaemon (Steffen DETTMER) 3. Re: Patch adding monThread setDaemon (Ivan Maidanski) 4. Patch for WinCE readArray (Ivan Maidanski) 5. Re: Patch adding monThread setDaemon (Ivan Maidanski) 6. Re: SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! (Ivan Maidanski) 7. Re: Patch adding monThread setDaemon (Trent Jarvi) 8. 64 bit (Nate) 9. Re: 64 bit (Ivan Maidanski) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Nov 2009 20:23:54 +0100 From: "M.Dec-GMail" To: Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2 at mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end ------------------------------ Message: 2 Date: Mon, 23 Nov 2009 22:26:36 +0100 From: "Steffen DETTMER" To: "rxtx" Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset="utf-8" > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail ------------------------------ Message: 3 Date: Tue, 24 Nov 2009 10:36:34 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 4 Date: Tue, 24 Nov 2009 22:26:00 +0300 From: Ivan Maidanski To: rxtx Subject: [Rxtx] Patch for WinCE readArray Message-ID: Content-Type: text/plain; charset="koi8-r" Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: ------------------------------ Message: 5 Date: Tue, 24 Nov 2009 22:33:41 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 6 Date: Tue, 24 Nov 2009 22:38:40 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! Message-ID: Content-Type: text/plain; charset=koi8-r Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) ------------------------------ Message: 7 Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) From: Trent Jarvi To: Ivan Maidanski Cc: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------ Message: 8 Date: Thu, 26 Nov 2009 05:08:27 -0800 From: Nate To: rxtx at qbang.org Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate ------------------------------ Message: 9 Date: Thu, 26 Nov 2009 16:24:21 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] 64 bit Message-ID: Content-Type: text/plain; charset=koi8-r Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate ------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx End of Rxtx Digest, Vol 27, Issue 7 *********************************** DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From m.kirkland at comcast.net Fri Nov 27 01:56:33 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 27 Nov 2009 00:56:33 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Or you could try the following utility which will modify the native library search path at run time based on the os.name and os.arch system properties. http://hamware.info/tools/LibLoader.zip Read the comments in the code and the properties file for details. Mike -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Ivan Maidanski Sent: Thursday, November 26, 2009 1:53 PM To: rxtx Subject: Re: [Rxtx] 64 bit Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri Nov 27 08:48:41 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 27 Nov 2009 08:48:41 -0700 (MST) Subject: [Rxtx] 64 bit In-Reply-To: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: I've used the native library search path to solve the problem in the past. The 64/32 bit library is one issue. There is also an issue binaries that can run on multiple archs. http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ This can be complicated by libc sources/versions ... At first glance, it would appear reasonable to modify the library name or path. When I think about it, the better approach is to make sure the libraries load in an intuitive way when installed alone for the novice and leave the multiple arch/os support problem as an exercise for the implementor as they will have an advanced skill set (and hopefully a nice wiki page helping them). On Fri, 27 Nov 2009, Mike Kirkland wrote: > Or you could try the following utility which will modify the native library > search path at run time based on the os.name and os.arch system properties. > > http://hamware.info/tools/LibLoader.zip > > Read the comments in the code and the properties file for details. > > Mike > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Ivan Maidanski > Sent: Thursday, November 26, 2009 1:53 PM > To: rxtx > Subject: Re: [Rxtx] 64 bit > > Hi! > Nate wrote: >> Ah, thanks Ivan. >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String > basename) which if sun.arch.data.model property is defined and equals "64" > then first tries to load basename+"64" library otherwize (if not 64 or > failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with > RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" > for 64-bit targets (optionally, if needed). > >> >> -Nate >> >> >> 2009/11/26 Ivan Maidanski : >>> Nate wrote: >>>> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >>>> I see a user has come up with a workaround for 64 bit OS X. Has anyone >>>> done this for Windows? Are there plans to support 64 bit Windows? >>> >>> rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily > rebuild it from the sources using e.g. mingw-w64.) >>> >>>> >>>> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >>>> Other open source projects such as LWJGL (http://lwjgl.org/) include >>>> both 32 and 64 bit native libs and the correct lib is automatically >>>> used. > > Best regards, > Ivan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Fri Nov 27 13:55:55 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Fri, 27 Nov 2009 21:55:55 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved Message-ID: Hi Ivan, Trent, Steffen, Kapil and all :) I have found a method how to close() and reopen RXTX serial port without problems. This is done on the rxtx-2.2pre2 version, but I think that it should work on earlier versions as well. I have tested it on Windows XP, Vista and Linux, Ubuntu distribution. On Windows XP it works on native UART and VCP, on Vista and Ubuntu I haven't native UART, so I have tested it with USB-RS232 VCP from FTDI. There is NO code changes in Java and C, this is only better external service of the processes between Java threads and native interface. I have found it looking in the code and tracing Java in Netbeans 6.7.1. using printouts from C part - #define TRENT_IS_HERE :) Attached file - TwoWaySerialCommMd.java is derived from the original TwoWaySerialComm.java but works a bit better :). Important comments are inside the file. I hope Kapil answers what about Macintosh but it should looks like in Linux. A bit about works of the Ivan and Steffen form last days. I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good idea when RXTXPort is used as a part of the application, but I think that Trent should accept or not this change. In my opinion this change does nothing in this case. If somebody needs serial daemon should do it a level up... Especially to Trent: 1. I have read a lot about synchronisation and in my opinion monThreadMutex in RXTXPort.java should be declared as final, the same with Sync in CommPortIdentifier. 2. Please check this example and, if this is good, add it to official examples of the RXTX. ABOUT EVENTS In my application I have checked events as well, but they works to slow for me - to big delay - I don't know why. Finally, I have decided to generate my own Exception when data from inStream is collected and proper parsed (I need packs of bytes). Exception transfers data to rest of the application. The only disadvantage is ASCII model of the data which may be transferred through Exception, but for me its enough. Therefore I don't know what to do with SerialEvent of the RXTX - I have found questions about the same problem with close() while using Events. Maybe somebody wiil solve this problem using my job. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M+R\F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8-"B\O)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F#0HO+R!(;W<@=&\@=7-E(%)8 M5%A397)I86Q0;W)T#0HO+R!">2!-87)I=7-Z($1E8RP at 4&]L86YD#0HO+R!. M;W9E;6)E5-EB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@<')E<&%R:6YG(&EN4W1R96%M(&%N9"!O M=713=')E86T@=&\@9&5A8W1I=F%T92!B969OF5D*'-T;W!296%D M375T97 at I#0H@(" @(" @(" @(" @>W-T;W!296%D(#T@=')U93M]#0H@(" @ M(" @('-Y;F-H"D-"B @(" @(" @(" @ M("![4]W;F5D M*"D@*0T*(" @(" @("![#0H@(" @(" @(" @("!3>7-T96TN;W5T+G!R:6YT M;&XH(D5R2!I;B!U2P@;&EN92 X-# L M(#@V,0T*+R\@5VEN9&]W7-T96TN;W5T+G!R:6YT;&XH(D5R2!T:&ES(&5X86UP;&4N(BD[#0H@(" @(" @(" @ M("!]#0H@(" @(" @('T@(" @( T*(" @('T-"B\O*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H@(" @+RHJ("HO#0H@(" @<'5B;&EC('-T M871I8R!C;&%SB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@16YA8FQI;F<@=V]R:R!O9B!T:&4@:6Y3 M=')E86T-"@T*(" @(" @(" @(" @('-Y;F-H71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5; M,3 R-%T[#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @ M("!TB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)@T*+R\@0VAE8VMI;F<@:68 at 86)O=70@=&\@8VQO7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@&-E<'1I;VX@ M92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPF5D*'-T;W!70T*(" @(" @(" @(" @>R @(" @(" @(" @(" @(" -"B @(" @ M(" @(" @(" @("!I;G0 at 8R ](# [#0H@(" @(" @(" @(" @(" @=VAI;&4@ M*" H(&,@/2!3>7-T96TN:6XN7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@=W)I=&EN9RXN+B(I.PT*(" @(" @ M(" @(" @(" @(" @(" @(" @8G)E86L[#0H@(" @(" @(" @(" @(" @(" @ M('T-"B @(" @(" @(" @(" @(" @(" @=&AI&-E<'1I;VX at 92 I#0H@(" @ M(" @(" @("![#0H@(" @(" @(" @(" @(" @92YP" H1$(Y M("T@<&EN(#(@8V]N;F5C=&5D('1O(#,I("!D871A('=I;&P@ T*(" @(" @("!3=')I;F<@<&]R=$YA;64@ M/2 B+V1E=B]T='E54T(P(CL-"@T*+R\@36%C#0HO+U-T3\_/S\_/S\_(CL-"@T*(" @(" @("!TPT*(" @(" @(" @(" @5-E2 at I("T at 4G5N=&EM92YG9712=6YT:6UE*"DN9G)E94UE;6]R>2 at I*2D[ M#0H@(" @(" @(" @4WES=&5M+F]U="YPPT*(" @(" @("!3>7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!O M<&5N*"DN+BXB("L@<&]R=$YA;64I.PT*(" @(" @("!T7-T96TN;W5T+G!R:6YT;&XH(E=A:71I;F7-T96TN;W5T+G!R:6YT;&XH92YT M;U-T0T*(" @(" @("![#0H@(" @(" @(" @(" @&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @92YP M&ET*# I.PT*(" @('T-"GT-"@`` ` end From nate at n4te.com Fri Nov 27 17:09:50 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:09:50 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> 2009/11/26 Ivan Maidanski : > Nate wrote: >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). Please see the attached patch for the Java changes. I didn't update the build scripts, I'm fine with just renaming the libs myself for now. After some thought, I decided since the sun.arch.data.model property is unreliable, being Sun JVM specific, so I settled on loading the 32-bit lib by default and trying the 64-bit lib if that fails. The patch also sets "devel" to false in RXTXCommDriver. I strongly believe a third party library should not be hardcoded to dump to System.out, especially when nothing is wrong. If I want to dump the rxtx version to System.out, I can write one line of code to do so (ASCII art is certainly not needed). -Nate -------------- next part -------------- A non-text attachment was scrubbed... Name: nativeLib.patch Type: application/octet-stream Size: 2700 bytes Desc: not available URL: From nate at n4te.com Fri Nov 27 17:12:24 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:12:24 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: <7d6ffee60911271612u4f3830aam295c56fe6c93e277@mail.gmail.com> On Fri, Nov 27, 2009 at 7:48 AM, Trent Jarvi wrote: > The 64/32 bit library is one issue. There is also an issue binaries that > can run on multiple archs. > > http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ > > This can be complicated by libc sources/versions ... > > At first glance, it would appear reasonable to modify the library name or > path. When I think about it, the better approach is to make sure the > libraries load in an intuitive way when installed alone for the novice and > leave the multiple arch/os support problem as an exercise for the > implementor as they will have an advanced skill set (and hopefully a nice > wiki page helping them). Ideally rxtx could be shipped with all the native libs and it would know how to pick the appropriate one. This way it can be kept up to date by the rxtx project rather than each user with this need maintain their own loading code. That said, if no one actually has this need, I don't see a problem with waiting for the first person to implement it, then absorbing it into the rxtx project. IMO, the next best thing is to at least handle the most common case, which is 32/64-bit. -Nate From ivmai at mail.ru Sat Nov 28 00:48:05 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 10:48:05 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: Hi! Nate wrote: > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> What do you think about supporting both 32 bit and 64 bit DLLs, with > >> the correct one chosen at runtime? This way I don't need two separate > >> versions of my app. > > > > I think it would be good. I think this should be implemented as follows: > > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > Please see the attached patch for the Java changes. I didn't update > the build scripts, I'm fine with just renaming the libs myself for > now. After some thought, I decided since the sun.arch.data.model > property is unreliable, being Sun JVM specific, so I settled on > loading the 32-bit lib by default and trying the 64-bit lib if that > fails. I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. > > The patch also sets "devel" to false in RXTXCommDriver. I strongly > believe a third party library should not be hardcoded to dump to > System.out, especially when nothing is wrong. If I want to dump the > rxtx version to System.out, I can write one line of code to do so > (ASCII art is certainly not needed). > > -Nate > > ATTACHMENT: application/x-patch (nativeLib.patch) From nate at n4te.com Sat Nov 28 00:55:59 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 23:55:59 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: <7d6ffee60911272355p73e526a0t5c10a7fc4d0f6663@mail.gmail.com> Hi Ivan, 2009/11/27 Ivan Maidanski : > Hi! > Nate wrote: >> 2009/11/26 Ivan Maidanski : >> > Nate wrote: >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> >> the correct one chosen at runtime? This way I don't need two separate >> >> versions of my app. >> > >> > I think it would be good. I think this should be implemented as follows: >> > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); >> > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); >> > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). >> >> Please see the attached patch for the Java changes. I didn't update >> the build scripts, I'm fine with just renaming the libs myself for >> now. After some thought, I decided since the sun.arch.data.model >> property is unreliable, being Sun JVM specific, so I settled on >> loading the 32-bit lib by default and trying the 64-bit lib if that >> fails. > > I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. I meant unreliable in that the property isn't defined by the JVM spec, so may not be available in all JVMs. This means even if it is false, 64-bit must be tried before absolute failure. > The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. Sure. Here is how I would write it, with clarity in mind: static void loadLibrary (String baseName) { if (System.getProperty("sun.arch.data.model", "").equals("64")) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ex64) { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ignored) { throw ex64; } } } else { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ex32) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ignored) { throw ex32; } } } } -Nate >> >> The patch also sets "devel" to false in RXTXCommDriver. I strongly >> believe a third party library should not be hardcoded to dump to >> System.out, especially when nothing is wrong. If I want to dump the >> rxtx version to System.out, I can write one line of code to do so >> (ASCII art is certainly not needed). >> >> -Nate >> >> ATTACHMENT: application/x-patch (nativeLib.patch) > > From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From nate at n4te.com Thu Nov 26 14:32:21 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 13:32:21 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Ah, thanks Ivan. What do you think about supporting both 32 bit and 64 bit DLLs, with the correct one chosen at runtime? This way I don't need two separate versions of my app. -Nate 2009/11/26 Ivan Maidanski : > Nate wrote: >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >> I see a user has come up with a workaround for 64 bit OS X. Has anyone >> done this for Windows? Are there plans to support 64 bit Windows? > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > >> >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >> Other open source projects such as LWJGL (http://lwjgl.org/) include >> both 32 and 64 bit native libs and the correct lib is automatically >> used. >> >> -Nate > > From ivmai at mail.ru Thu Nov 26 14:52:53 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Fri, 27 Nov 2009 00:52:53 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan From Kapil_Gupta at hcl.in Thu Nov 26 22:47:13 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 27 Nov 2009 11:17:13 +0530 Subject: [Rxtx] Rxtx Digest, Vol 27, Issue 7 In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960FDD2F38A@NDA-HCLT-EVS05.HCLT. CORP.HCL.IN-F0913EFA-B2A5-28E5-3684-11AABE813CF9> Hi, I am also facing the same issue as Mariusz is facing, I am facing it on Intel Mac 10.5.8. I am using RXTX 2.2 Pre binaries. First time I am able to read the data from my device, but second time port open hangs (RXTXPort.java). I am using TI chip set in my device. I created a C sample to test the driver but that works perfectly to read device any number of times. No hangs !! Note: My sample works fine on Windows XP. Please help. Thanks, Kapil -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Thursday, November 26, 2009 6:50 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 27, Issue 7 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! (M.Dec-GMail) 2. Re: Patch adding monThread setDaemon (Steffen DETTMER) 3. Re: Patch adding monThread setDaemon (Ivan Maidanski) 4. Patch for WinCE readArray (Ivan Maidanski) 5. Re: Patch adding monThread setDaemon (Ivan Maidanski) 6. Re: SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! (Ivan Maidanski) 7. Re: Patch adding monThread setDaemon (Trent Jarvi) 8. 64 bit (Nate) 9. Re: 64 bit (Ivan Maidanski) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Nov 2009 20:23:54 +0100 From: "M.Dec-GMail" To: Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2 at mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end ------------------------------ Message: 2 Date: Mon, 23 Nov 2009 22:26:36 +0100 From: "Steffen DETTMER" To: "rxtx" Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset="utf-8" > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail ------------------------------ Message: 3 Date: Tue, 24 Nov 2009 10:36:34 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 4 Date: Tue, 24 Nov 2009 22:26:00 +0300 From: Ivan Maidanski To: rxtx Subject: [Rxtx] Patch for WinCE readArray Message-ID: Content-Type: text/plain; charset="koi8-r" Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: ------------------------------ Message: 5 Date: Tue, 24 Nov 2009 22:33:41 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 6 Date: Tue, 24 Nov 2009 22:38:40 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! Message-ID: Content-Type: text/plain; charset=koi8-r Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) ------------------------------ Message: 7 Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) From: Trent Jarvi To: Ivan Maidanski Cc: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------ Message: 8 Date: Thu, 26 Nov 2009 05:08:27 -0800 From: Nate To: rxtx at qbang.org Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate ------------------------------ Message: 9 Date: Thu, 26 Nov 2009 16:24:21 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] 64 bit Message-ID: Content-Type: text/plain; charset=koi8-r Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate ------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx End of Rxtx Digest, Vol 27, Issue 7 *********************************** DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From m.kirkland at comcast.net Fri Nov 27 01:56:33 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 27 Nov 2009 00:56:33 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Or you could try the following utility which will modify the native library search path at run time based on the os.name and os.arch system properties. http://hamware.info/tools/LibLoader.zip Read the comments in the code and the properties file for details. Mike -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Ivan Maidanski Sent: Thursday, November 26, 2009 1:53 PM To: rxtx Subject: Re: [Rxtx] 64 bit Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri Nov 27 08:48:41 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 27 Nov 2009 08:48:41 -0700 (MST) Subject: [Rxtx] 64 bit In-Reply-To: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: I've used the native library search path to solve the problem in the past. The 64/32 bit library is one issue. There is also an issue binaries that can run on multiple archs. http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ This can be complicated by libc sources/versions ... At first glance, it would appear reasonable to modify the library name or path. When I think about it, the better approach is to make sure the libraries load in an intuitive way when installed alone for the novice and leave the multiple arch/os support problem as an exercise for the implementor as they will have an advanced skill set (and hopefully a nice wiki page helping them). On Fri, 27 Nov 2009, Mike Kirkland wrote: > Or you could try the following utility which will modify the native library > search path at run time based on the os.name and os.arch system properties. > > http://hamware.info/tools/LibLoader.zip > > Read the comments in the code and the properties file for details. > > Mike > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Ivan Maidanski > Sent: Thursday, November 26, 2009 1:53 PM > To: rxtx > Subject: Re: [Rxtx] 64 bit > > Hi! > Nate wrote: >> Ah, thanks Ivan. >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String > basename) which if sun.arch.data.model property is defined and equals "64" > then first tries to load basename+"64" library otherwize (if not 64 or > failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with > RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" > for 64-bit targets (optionally, if needed). > >> >> -Nate >> >> >> 2009/11/26 Ivan Maidanski : >>> Nate wrote: >>>> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >>>> I see a user has come up with a workaround for 64 bit OS X. Has anyone >>>> done this for Windows? Are there plans to support 64 bit Windows? >>> >>> rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily > rebuild it from the sources using e.g. mingw-w64.) >>> >>>> >>>> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >>>> Other open source projects such as LWJGL (http://lwjgl.org/) include >>>> both 32 and 64 bit native libs and the correct lib is automatically >>>> used. > > Best regards, > Ivan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Fri Nov 27 13:55:55 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Fri, 27 Nov 2009 21:55:55 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved Message-ID: Hi Ivan, Trent, Steffen, Kapil and all :) I have found a method how to close() and reopen RXTX serial port without problems. This is done on the rxtx-2.2pre2 version, but I think that it should work on earlier versions as well. I have tested it on Windows XP, Vista and Linux, Ubuntu distribution. On Windows XP it works on native UART and VCP, on Vista and Ubuntu I haven't native UART, so I have tested it with USB-RS232 VCP from FTDI. There is NO code changes in Java and C, this is only better external service of the processes between Java threads and native interface. I have found it looking in the code and tracing Java in Netbeans 6.7.1. using printouts from C part - #define TRENT_IS_HERE :) Attached file - TwoWaySerialCommMd.java is derived from the original TwoWaySerialComm.java but works a bit better :). Important comments are inside the file. I hope Kapil answers what about Macintosh but it should looks like in Linux. A bit about works of the Ivan and Steffen form last days. I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good idea when RXTXPort is used as a part of the application, but I think that Trent should accept or not this change. In my opinion this change does nothing in this case. If somebody needs serial daemon should do it a level up... Especially to Trent: 1. I have read a lot about synchronisation and in my opinion monThreadMutex in RXTXPort.java should be declared as final, the same with Sync in CommPortIdentifier. 2. Please check this example and, if this is good, add it to official examples of the RXTX. ABOUT EVENTS In my application I have checked events as well, but they works to slow for me - to big delay - I don't know why. Finally, I have decided to generate my own Exception when data from inStream is collected and proper parsed (I need packs of bytes). Exception transfers data to rest of the application. The only disadvantage is ASCII model of the data which may be transferred through Exception, but for me its enough. Therefore I don't know what to do with SerialEvent of the RXTX - I have found questions about the same problem with close() while using Events. Maybe somebody wiil solve this problem using my job. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M+R\F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8-"B\O)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F#0HO+R!(;W<@=&\@=7-E(%)8 M5%A397)I86Q0;W)T#0HO+R!">2!-87)I=7-Z($1E8RP at 4&]L86YD#0HO+R!. M;W9E;6)E5-EB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@<')E<&%R:6YG(&EN4W1R96%M(&%N9"!O M=713=')E86T@=&\@9&5A8W1I=F%T92!B969OF5D*'-T;W!296%D M375T97 at I#0H@(" @(" @(" @(" @>W-T;W!296%D(#T@=')U93M]#0H@(" @ M(" @('-Y;F-H"D-"B @(" @(" @(" @ M("![4]W;F5D M*"D@*0T*(" @(" @("![#0H@(" @(" @(" @("!3>7-T96TN;W5T+G!R:6YT M;&XH(D5R2!I;B!U2P@;&EN92 X-# L M(#@V,0T*+R\@5VEN9&]W7-T96TN;W5T+G!R:6YT;&XH(D5R2!T:&ES(&5X86UP;&4N(BD[#0H@(" @(" @(" @ M("!]#0H@(" @(" @('T@(" @( T*(" @('T-"B\O*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H@(" @+RHJ("HO#0H@(" @<'5B;&EC('-T M871I8R!C;&%SB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@16YA8FQI;F<@=V]R:R!O9B!T:&4@:6Y3 M=')E86T-"@T*(" @(" @(" @(" @('-Y;F-H71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5; M,3 R-%T[#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @ M("!TB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)@T*+R\@0VAE8VMI;F<@:68 at 86)O=70@=&\@8VQO7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@&-E<'1I;VX@ M92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPF5D*'-T;W!70T*(" @(" @(" @(" @>R @(" @(" @(" @(" @(" -"B @(" @ M(" @(" @(" @("!I;G0 at 8R ](# [#0H@(" @(" @(" @(" @(" @=VAI;&4@ M*" H(&,@/2!3>7-T96TN:6XN7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@=W)I=&EN9RXN+B(I.PT*(" @(" @ M(" @(" @(" @(" @(" @(" @8G)E86L[#0H@(" @(" @(" @(" @(" @(" @ M('T-"B @(" @(" @(" @(" @(" @(" @=&AI&-E<'1I;VX at 92 I#0H@(" @ M(" @(" @("![#0H@(" @(" @(" @(" @(" @92YP" H1$(Y M("T@<&EN(#(@8V]N;F5C=&5D('1O(#,I("!D871A('=I;&P@ T*(" @(" @("!3=')I;F<@<&]R=$YA;64@ M/2 B+V1E=B]T='E54T(P(CL-"@T*+R\@36%C#0HO+U-T3\_/S\_/S\_(CL-"@T*(" @(" @("!TPT*(" @(" @(" @(" @5-E2 at I("T at 4G5N=&EM92YG9712=6YT:6UE*"DN9G)E94UE;6]R>2 at I*2D[ M#0H@(" @(" @(" @4WES=&5M+F]U="YPPT*(" @(" @("!3>7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!O M<&5N*"DN+BXB("L@<&]R=$YA;64I.PT*(" @(" @("!T7-T96TN;W5T+G!R:6YT;&XH(E=A:71I;F7-T96TN;W5T+G!R:6YT;&XH92YT M;U-T0T*(" @(" @("![#0H@(" @(" @(" @(" @&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @92YP M&ET*# I.PT*(" @('T-"GT-"@`` ` end From nate at n4te.com Fri Nov 27 17:09:50 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:09:50 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> 2009/11/26 Ivan Maidanski : > Nate wrote: >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). Please see the attached patch for the Java changes. I didn't update the build scripts, I'm fine with just renaming the libs myself for now. After some thought, I decided since the sun.arch.data.model property is unreliable, being Sun JVM specific, so I settled on loading the 32-bit lib by default and trying the 64-bit lib if that fails. The patch also sets "devel" to false in RXTXCommDriver. I strongly believe a third party library should not be hardcoded to dump to System.out, especially when nothing is wrong. If I want to dump the rxtx version to System.out, I can write one line of code to do so (ASCII art is certainly not needed). -Nate -------------- next part -------------- A non-text attachment was scrubbed... Name: nativeLib.patch Type: application/octet-stream Size: 2700 bytes Desc: not available URL: From nate at n4te.com Fri Nov 27 17:12:24 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:12:24 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: <7d6ffee60911271612u4f3830aam295c56fe6c93e277@mail.gmail.com> On Fri, Nov 27, 2009 at 7:48 AM, Trent Jarvi wrote: > The 64/32 bit library is one issue. There is also an issue binaries that > can run on multiple archs. > > http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ > > This can be complicated by libc sources/versions ... > > At first glance, it would appear reasonable to modify the library name or > path. When I think about it, the better approach is to make sure the > libraries load in an intuitive way when installed alone for the novice and > leave the multiple arch/os support problem as an exercise for the > implementor as they will have an advanced skill set (and hopefully a nice > wiki page helping them). Ideally rxtx could be shipped with all the native libs and it would know how to pick the appropriate one. This way it can be kept up to date by the rxtx project rather than each user with this need maintain their own loading code. That said, if no one actually has this need, I don't see a problem with waiting for the first person to implement it, then absorbing it into the rxtx project. IMO, the next best thing is to at least handle the most common case, which is 32/64-bit. -Nate From ivmai at mail.ru Sat Nov 28 00:48:05 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 10:48:05 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: Hi! Nate wrote: > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> What do you think about supporting both 32 bit and 64 bit DLLs, with > >> the correct one chosen at runtime? This way I don't need two separate > >> versions of my app. > > > > I think it would be good. I think this should be implemented as follows: > > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > Please see the attached patch for the Java changes. I didn't update > the build scripts, I'm fine with just renaming the libs myself for > now. After some thought, I decided since the sun.arch.data.model > property is unreliable, being Sun JVM specific, so I settled on > loading the 32-bit lib by default and trying the 64-bit lib if that > fails. I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. > > The patch also sets "devel" to false in RXTXCommDriver. I strongly > believe a third party library should not be hardcoded to dump to > System.out, especially when nothing is wrong. If I want to dump the > rxtx version to System.out, I can write one line of code to do so > (ASCII art is certainly not needed). > > -Nate > > ATTACHMENT: application/x-patch (nativeLib.patch) From nate at n4te.com Sat Nov 28 00:55:59 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 23:55:59 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: <7d6ffee60911272355p73e526a0t5c10a7fc4d0f6663@mail.gmail.com> Hi Ivan, 2009/11/27 Ivan Maidanski : > Hi! > Nate wrote: >> 2009/11/26 Ivan Maidanski : >> > Nate wrote: >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> >> the correct one chosen at runtime? This way I don't need two separate >> >> versions of my app. >> > >> > I think it would be good. I think this should be implemented as follows: >> > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); >> > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); >> > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). >> >> Please see the attached patch for the Java changes. I didn't update >> the build scripts, I'm fine with just renaming the libs myself for >> now. After some thought, I decided since the sun.arch.data.model >> property is unreliable, being Sun JVM specific, so I settled on >> loading the 32-bit lib by default and trying the 64-bit lib if that >> fails. > > I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. I meant unreliable in that the property isn't defined by the JVM spec, so may not be available in all JVMs. This means even if it is false, 64-bit must be tried before absolute failure. > The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. Sure. Here is how I would write it, with clarity in mind: static void loadLibrary (String baseName) { if (System.getProperty("sun.arch.data.model", "").equals("64")) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ex64) { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ignored) { throw ex64; } } } else { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ex32) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ignored) { throw ex32; } } } } -Nate >> >> The patch also sets "devel" to false in RXTXCommDriver. I strongly >> believe a third party library should not be hardcoded to dump to >> System.out, especially when nothing is wrong. If I want to dump the >> rxtx version to System.out, I can write one line of code to do so >> (ASCII art is certainly not needed). >> >> -Nate >> >> ATTACHMENT: application/x-patch (nativeLib.patch) > > From ivmai at mail.ru Sat Nov 28 07:26:43 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 17:26:43 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: References: Message-ID: "M.Dec-GMail" wrote: > Hi Ivan, Trent, Steffen, Kapil and all :) > ... > A bit about works of the Ivan and Steffen from last days. > > I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good > idea when RXTXPort is used as a part of the application, but I think that > Trent should accept or not this change. > In my opinion this change does nothing in this case. > If somebody needs serial daemon should do it a level up... I never claimed setDaemon patch would solve the port close problem. It solves "not exiting" a badly-written application problem (I mean an app is returning from main() without calling close() for ports). > ... > Regards > Mariusz Dec From mariusz.dec at gmail.com Sat Nov 28 09:29:04 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 28 Nov 2009 17:29:04 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <536A5B02D18041459E65A4D1182D1374@mdam2> ----- Original Message ----- From: "Ivan Maidanski" To: "rxtx" Sent: Saturday, November 28, 2009 3:26 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > I never claimed setDaemon patch would solve the port close problem. It > solves "not exiting" a badly-written application problem (I mean an app is > returning from main() without calling close() for ports). It was general notice - not about close - but I am sorry - this is my mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. So - your proposal is good, but I have observed that RXTXPort ends work even without close, if application ends with System.exit(0). But in this case - If you will try my example without System.exit(0), program stays in memory and Netbeans says that application runs... This is the case of baddly written application - what in this case? Something is wrong in my techniuqe of subsequent opens? Variables configuration? No finalize of the RXTX port? Maybe this is it. If yes, everything should be changed and my example is workaround only - all threads disconnections should be done during close, inside RXTXPort.java.. Today I have written serial port scanner which is looking for specific external device checking all system serial ports - opening, sending query, closing (this is why I needed working close()). No memory waste, no lost threads in memory, but my application ends with System.exit(0). Workaround works... Regards Mariusz Dec >> ... >> Regards >> Mariusz Dec > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ivmai at mail.ru Sat Nov 28 09:57:33 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 19:57:33 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: <536A5B02D18041459E65A4D1182D1374@mdam2> References: <536A5B02D18041459E65A4D1182D1374@mdam2> Message-ID: "M.Dec-GMail" wrote: > ----- Original Message ----- > From: "Ivan Maidanski" > Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > > > I never claimed setDaemon patch would solve the port close problem. It > > solves "not exiting" a badly-written application problem (I mean an app is > > returning from main() without calling close() for ports). > > It was general notice - not about close - but I am sorry - this is my > mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. > So - your proposal is good, but I have observed that RXTXPort ends work even > without close, if application ends with System.exit(0). That's how exit works by the definition (contrary to returning from main(String[])). > > But in this case - If you will try my example without System.exit(0), > program stays in memory and Netbeans says that application runs... > This is the case of badly written application - what in this case? No, in my case a "badly-written application" is exiting from an app w/o closing ports - this works with the original Sun Comm API but run into a "not exiting" problem with rxtx (unless System.exit is used, of course). > Something is wrong in my technique of subsequent opens? > Variables configuration? > No finalize of the RXTX port? Maybe this is it. Finalizers are not guaranteed to be ever run. > If yes, everything should be changed and my example is workaround only - all > threads disconnections should be done during close, inside RXTXPort.java.. > > Today I have written serial port scanner which is looking for specific > external device checking all system serial ports - opening, sending query, > closing (this is why I needed working close()). > No memory waste, no lost threads in memory, but my application ends with > System.exit(0). > Workaround works... > > Regards > Mariusz Dec At present, I use System.exit(0) in my app to workaround the absence of setDaemon too. Regards, Ovan From mariusz.dec at gmail.com Sun Nov 29 01:01:28 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 09:01:28 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: Hi all, While googling for something, I have found this site: http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ There is a lot about RXTX, and sample works with Events. It differs from original RXTX samples. The only question is - why original samples doesn't work correct and there is no links to real solutions... RXTX project is great but... Regards Mariusz Dec From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From nate at n4te.com Thu Nov 26 14:32:21 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 13:32:21 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Ah, thanks Ivan. What do you think about supporting both 32 bit and 64 bit DLLs, with the correct one chosen at runtime? This way I don't need two separate versions of my app. -Nate 2009/11/26 Ivan Maidanski : > Nate wrote: >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >> I see a user has come up with a workaround for 64 bit OS X. Has anyone >> done this for Windows? Are there plans to support 64 bit Windows? > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > >> >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >> Other open source projects such as LWJGL (http://lwjgl.org/) include >> both 32 and 64 bit native libs and the correct lib is automatically >> used. >> >> -Nate > > From ivmai at mail.ru Thu Nov 26 14:52:53 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Fri, 27 Nov 2009 00:52:53 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan From Kapil_Gupta at hcl.in Thu Nov 26 22:47:13 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 27 Nov 2009 11:17:13 +0530 Subject: [Rxtx] Rxtx Digest, Vol 27, Issue 7 In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960FDD2F38A@NDA-HCLT-EVS05.HCLT. CORP.HCL.IN-F0913EFA-B2A5-28E5-3684-11AABE813CF9> Hi, I am also facing the same issue as Mariusz is facing, I am facing it on Intel Mac 10.5.8. I am using RXTX 2.2 Pre binaries. First time I am able to read the data from my device, but second time port open hangs (RXTXPort.java). I am using TI chip set in my device. I created a C sample to test the driver but that works perfectly to read device any number of times. No hangs !! Note: My sample works fine on Windows XP. Please help. Thanks, Kapil -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Thursday, November 26, 2009 6:50 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 27, Issue 7 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! (M.Dec-GMail) 2. Re: Patch adding monThread setDaemon (Steffen DETTMER) 3. Re: Patch adding monThread setDaemon (Ivan Maidanski) 4. Patch for WinCE readArray (Ivan Maidanski) 5. Re: Patch adding monThread setDaemon (Ivan Maidanski) 6. Re: SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! (Ivan Maidanski) 7. Re: Patch adding monThread setDaemon (Trent Jarvi) 8. 64 bit (Nate) 9. Re: 64 bit (Ivan Maidanski) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Nov 2009 20:23:54 +0100 From: "M.Dec-GMail" To: Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2 at mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end ------------------------------ Message: 2 Date: Mon, 23 Nov 2009 22:26:36 +0100 From: "Steffen DETTMER" To: "rxtx" Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset="utf-8" > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail ------------------------------ Message: 3 Date: Tue, 24 Nov 2009 10:36:34 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 4 Date: Tue, 24 Nov 2009 22:26:00 +0300 From: Ivan Maidanski To: rxtx Subject: [Rxtx] Patch for WinCE readArray Message-ID: Content-Type: text/plain; charset="koi8-r" Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: ------------------------------ Message: 5 Date: Tue, 24 Nov 2009 22:33:41 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 6 Date: Tue, 24 Nov 2009 22:38:40 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! Message-ID: Content-Type: text/plain; charset=koi8-r Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) ------------------------------ Message: 7 Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) From: Trent Jarvi To: Ivan Maidanski Cc: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------ Message: 8 Date: Thu, 26 Nov 2009 05:08:27 -0800 From: Nate To: rxtx at qbang.org Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate ------------------------------ Message: 9 Date: Thu, 26 Nov 2009 16:24:21 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] 64 bit Message-ID: Content-Type: text/plain; charset=koi8-r Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate ------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx End of Rxtx Digest, Vol 27, Issue 7 *********************************** DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From m.kirkland at comcast.net Fri Nov 27 01:56:33 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 27 Nov 2009 00:56:33 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Or you could try the following utility which will modify the native library search path at run time based on the os.name and os.arch system properties. http://hamware.info/tools/LibLoader.zip Read the comments in the code and the properties file for details. Mike -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Ivan Maidanski Sent: Thursday, November 26, 2009 1:53 PM To: rxtx Subject: Re: [Rxtx] 64 bit Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri Nov 27 08:48:41 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 27 Nov 2009 08:48:41 -0700 (MST) Subject: [Rxtx] 64 bit In-Reply-To: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: I've used the native library search path to solve the problem in the past. The 64/32 bit library is one issue. There is also an issue binaries that can run on multiple archs. http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ This can be complicated by libc sources/versions ... At first glance, it would appear reasonable to modify the library name or path. When I think about it, the better approach is to make sure the libraries load in an intuitive way when installed alone for the novice and leave the multiple arch/os support problem as an exercise for the implementor as they will have an advanced skill set (and hopefully a nice wiki page helping them). On Fri, 27 Nov 2009, Mike Kirkland wrote: > Or you could try the following utility which will modify the native library > search path at run time based on the os.name and os.arch system properties. > > http://hamware.info/tools/LibLoader.zip > > Read the comments in the code and the properties file for details. > > Mike > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Ivan Maidanski > Sent: Thursday, November 26, 2009 1:53 PM > To: rxtx > Subject: Re: [Rxtx] 64 bit > > Hi! > Nate wrote: >> Ah, thanks Ivan. >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String > basename) which if sun.arch.data.model property is defined and equals "64" > then first tries to load basename+"64" library otherwize (if not 64 or > failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with > RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" > for 64-bit targets (optionally, if needed). > >> >> -Nate >> >> >> 2009/11/26 Ivan Maidanski : >>> Nate wrote: >>>> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >>>> I see a user has come up with a workaround for 64 bit OS X. Has anyone >>>> done this for Windows? Are there plans to support 64 bit Windows? >>> >>> rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily > rebuild it from the sources using e.g. mingw-w64.) >>> >>>> >>>> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >>>> Other open source projects such as LWJGL (http://lwjgl.org/) include >>>> both 32 and 64 bit native libs and the correct lib is automatically >>>> used. > > Best regards, > Ivan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Fri Nov 27 13:55:55 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Fri, 27 Nov 2009 21:55:55 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved Message-ID: Hi Ivan, Trent, Steffen, Kapil and all :) I have found a method how to close() and reopen RXTX serial port without problems. This is done on the rxtx-2.2pre2 version, but I think that it should work on earlier versions as well. I have tested it on Windows XP, Vista and Linux, Ubuntu distribution. On Windows XP it works on native UART and VCP, on Vista and Ubuntu I haven't native UART, so I have tested it with USB-RS232 VCP from FTDI. There is NO code changes in Java and C, this is only better external service of the processes between Java threads and native interface. I have found it looking in the code and tracing Java in Netbeans 6.7.1. using printouts from C part - #define TRENT_IS_HERE :) Attached file - TwoWaySerialCommMd.java is derived from the original TwoWaySerialComm.java but works a bit better :). Important comments are inside the file. I hope Kapil answers what about Macintosh but it should looks like in Linux. A bit about works of the Ivan and Steffen form last days. I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good idea when RXTXPort is used as a part of the application, but I think that Trent should accept or not this change. In my opinion this change does nothing in this case. If somebody needs serial daemon should do it a level up... Especially to Trent: 1. I have read a lot about synchronisation and in my opinion monThreadMutex in RXTXPort.java should be declared as final, the same with Sync in CommPortIdentifier. 2. Please check this example and, if this is good, add it to official examples of the RXTX. ABOUT EVENTS In my application I have checked events as well, but they works to slow for me - to big delay - I don't know why. Finally, I have decided to generate my own Exception when data from inStream is collected and proper parsed (I need packs of bytes). Exception transfers data to rest of the application. The only disadvantage is ASCII model of the data which may be transferred through Exception, but for me its enough. Therefore I don't know what to do with SerialEvent of the RXTX - I have found questions about the same problem with close() while using Events. Maybe somebody wiil solve this problem using my job. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M+R\F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8-"B\O)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F#0HO+R!(;W<@=&\@=7-E(%)8 M5%A397)I86Q0;W)T#0HO+R!">2!-87)I=7-Z($1E8RP at 4&]L86YD#0HO+R!. M;W9E;6)E5-EB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@<')E<&%R:6YG(&EN4W1R96%M(&%N9"!O M=713=')E86T@=&\@9&5A8W1I=F%T92!B969OF5D*'-T;W!296%D M375T97 at I#0H@(" @(" @(" @(" @>W-T;W!296%D(#T@=')U93M]#0H@(" @ M(" @('-Y;F-H"D-"B @(" @(" @(" @ M("![4]W;F5D M*"D@*0T*(" @(" @("![#0H@(" @(" @(" @("!3>7-T96TN;W5T+G!R:6YT M;&XH(D5R2!I;B!U2P@;&EN92 X-# L M(#@V,0T*+R\@5VEN9&]W7-T96TN;W5T+G!R:6YT;&XH(D5R2!T:&ES(&5X86UP;&4N(BD[#0H@(" @(" @(" @ M("!]#0H@(" @(" @('T@(" @( T*(" @('T-"B\O*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H@(" @+RHJ("HO#0H@(" @<'5B;&EC('-T M871I8R!C;&%SB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@16YA8FQI;F<@=V]R:R!O9B!T:&4@:6Y3 M=')E86T-"@T*(" @(" @(" @(" @('-Y;F-H71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5; M,3 R-%T[#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @ M("!TB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)@T*+R\@0VAE8VMI;F<@:68 at 86)O=70@=&\@8VQO7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@&-E<'1I;VX@ M92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPF5D*'-T;W!70T*(" @(" @(" @(" @>R @(" @(" @(" @(" @(" -"B @(" @ M(" @(" @(" @("!I;G0 at 8R ](# [#0H@(" @(" @(" @(" @(" @=VAI;&4@ M*" H(&,@/2!3>7-T96TN:6XN7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@=W)I=&EN9RXN+B(I.PT*(" @(" @ M(" @(" @(" @(" @(" @(" @8G)E86L[#0H@(" @(" @(" @(" @(" @(" @ M('T-"B @(" @(" @(" @(" @(" @(" @=&AI&-E<'1I;VX at 92 I#0H@(" @ M(" @(" @("![#0H@(" @(" @(" @(" @(" @92YP" H1$(Y M("T@<&EN(#(@8V]N;F5C=&5D('1O(#,I("!D871A('=I;&P@ T*(" @(" @("!3=')I;F<@<&]R=$YA;64@ M/2 B+V1E=B]T='E54T(P(CL-"@T*+R\@36%C#0HO+U-T3\_/S\_/S\_(CL-"@T*(" @(" @("!TPT*(" @(" @(" @(" @5-E2 at I("T at 4G5N=&EM92YG9712=6YT:6UE*"DN9G)E94UE;6]R>2 at I*2D[ M#0H@(" @(" @(" @4WES=&5M+F]U="YPPT*(" @(" @("!3>7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!O M<&5N*"DN+BXB("L@<&]R=$YA;64I.PT*(" @(" @("!T7-T96TN;W5T+G!R:6YT;&XH(E=A:71I;F7-T96TN;W5T+G!R:6YT;&XH92YT M;U-T0T*(" @(" @("![#0H@(" @(" @(" @(" @&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @92YP M&ET*# I.PT*(" @('T-"GT-"@`` ` end From nate at n4te.com Fri Nov 27 17:09:50 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:09:50 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> 2009/11/26 Ivan Maidanski : > Nate wrote: >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). Please see the attached patch for the Java changes. I didn't update the build scripts, I'm fine with just renaming the libs myself for now. After some thought, I decided since the sun.arch.data.model property is unreliable, being Sun JVM specific, so I settled on loading the 32-bit lib by default and trying the 64-bit lib if that fails. The patch also sets "devel" to false in RXTXCommDriver. I strongly believe a third party library should not be hardcoded to dump to System.out, especially when nothing is wrong. If I want to dump the rxtx version to System.out, I can write one line of code to do so (ASCII art is certainly not needed). -Nate -------------- next part -------------- A non-text attachment was scrubbed... Name: nativeLib.patch Type: application/octet-stream Size: 2700 bytes Desc: not available URL: From nate at n4te.com Fri Nov 27 17:12:24 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:12:24 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: <7d6ffee60911271612u4f3830aam295c56fe6c93e277@mail.gmail.com> On Fri, Nov 27, 2009 at 7:48 AM, Trent Jarvi wrote: > The 64/32 bit library is one issue. There is also an issue binaries that > can run on multiple archs. > > http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ > > This can be complicated by libc sources/versions ... > > At first glance, it would appear reasonable to modify the library name or > path. When I think about it, the better approach is to make sure the > libraries load in an intuitive way when installed alone for the novice and > leave the multiple arch/os support problem as an exercise for the > implementor as they will have an advanced skill set (and hopefully a nice > wiki page helping them). Ideally rxtx could be shipped with all the native libs and it would know how to pick the appropriate one. This way it can be kept up to date by the rxtx project rather than each user with this need maintain their own loading code. That said, if no one actually has this need, I don't see a problem with waiting for the first person to implement it, then absorbing it into the rxtx project. IMO, the next best thing is to at least handle the most common case, which is 32/64-bit. -Nate From ivmai at mail.ru Sat Nov 28 00:48:05 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 10:48:05 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: Hi! Nate wrote: > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> What do you think about supporting both 32 bit and 64 bit DLLs, with > >> the correct one chosen at runtime? This way I don't need two separate > >> versions of my app. > > > > I think it would be good. I think this should be implemented as follows: > > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > Please see the attached patch for the Java changes. I didn't update > the build scripts, I'm fine with just renaming the libs myself for > now. After some thought, I decided since the sun.arch.data.model > property is unreliable, being Sun JVM specific, so I settled on > loading the 32-bit lib by default and trying the 64-bit lib if that > fails. I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. > > The patch also sets "devel" to false in RXTXCommDriver. I strongly > believe a third party library should not be hardcoded to dump to > System.out, especially when nothing is wrong. If I want to dump the > rxtx version to System.out, I can write one line of code to do so > (ASCII art is certainly not needed). > > -Nate > > ATTACHMENT: application/x-patch (nativeLib.patch) From nate at n4te.com Sat Nov 28 00:55:59 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 23:55:59 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: <7d6ffee60911272355p73e526a0t5c10a7fc4d0f6663@mail.gmail.com> Hi Ivan, 2009/11/27 Ivan Maidanski : > Hi! > Nate wrote: >> 2009/11/26 Ivan Maidanski : >> > Nate wrote: >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> >> the correct one chosen at runtime? This way I don't need two separate >> >> versions of my app. >> > >> > I think it would be good. I think this should be implemented as follows: >> > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); >> > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); >> > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). >> >> Please see the attached patch for the Java changes. I didn't update >> the build scripts, I'm fine with just renaming the libs myself for >> now. After some thought, I decided since the sun.arch.data.model >> property is unreliable, being Sun JVM specific, so I settled on >> loading the 32-bit lib by default and trying the 64-bit lib if that >> fails. > > I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. I meant unreliable in that the property isn't defined by the JVM spec, so may not be available in all JVMs. This means even if it is false, 64-bit must be tried before absolute failure. > The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. Sure. Here is how I would write it, with clarity in mind: static void loadLibrary (String baseName) { if (System.getProperty("sun.arch.data.model", "").equals("64")) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ex64) { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ignored) { throw ex64; } } } else { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ex32) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ignored) { throw ex32; } } } } -Nate >> >> The patch also sets "devel" to false in RXTXCommDriver. I strongly >> believe a third party library should not be hardcoded to dump to >> System.out, especially when nothing is wrong. If I want to dump the >> rxtx version to System.out, I can write one line of code to do so >> (ASCII art is certainly not needed). >> >> -Nate >> >> ATTACHMENT: application/x-patch (nativeLib.patch) > > From ivmai at mail.ru Sat Nov 28 07:26:43 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 17:26:43 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: References: Message-ID: "M.Dec-GMail" wrote: > Hi Ivan, Trent, Steffen, Kapil and all :) > ... > A bit about works of the Ivan and Steffen from last days. > > I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good > idea when RXTXPort is used as a part of the application, but I think that > Trent should accept or not this change. > In my opinion this change does nothing in this case. > If somebody needs serial daemon should do it a level up... I never claimed setDaemon patch would solve the port close problem. It solves "not exiting" a badly-written application problem (I mean an app is returning from main() without calling close() for ports). > ... > Regards > Mariusz Dec From mariusz.dec at gmail.com Sat Nov 28 09:29:04 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 28 Nov 2009 17:29:04 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <536A5B02D18041459E65A4D1182D1374@mdam2> ----- Original Message ----- From: "Ivan Maidanski" To: "rxtx" Sent: Saturday, November 28, 2009 3:26 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > I never claimed setDaemon patch would solve the port close problem. It > solves "not exiting" a badly-written application problem (I mean an app is > returning from main() without calling close() for ports). It was general notice - not about close - but I am sorry - this is my mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. So - your proposal is good, but I have observed that RXTXPort ends work even without close, if application ends with System.exit(0). But in this case - If you will try my example without System.exit(0), program stays in memory and Netbeans says that application runs... This is the case of baddly written application - what in this case? Something is wrong in my techniuqe of subsequent opens? Variables configuration? No finalize of the RXTX port? Maybe this is it. If yes, everything should be changed and my example is workaround only - all threads disconnections should be done during close, inside RXTXPort.java.. Today I have written serial port scanner which is looking for specific external device checking all system serial ports - opening, sending query, closing (this is why I needed working close()). No memory waste, no lost threads in memory, but my application ends with System.exit(0). Workaround works... Regards Mariusz Dec >> ... >> Regards >> Mariusz Dec > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ivmai at mail.ru Sat Nov 28 09:57:33 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 19:57:33 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: <536A5B02D18041459E65A4D1182D1374@mdam2> References: <536A5B02D18041459E65A4D1182D1374@mdam2> Message-ID: "M.Dec-GMail" wrote: > ----- Original Message ----- > From: "Ivan Maidanski" > Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > > > I never claimed setDaemon patch would solve the port close problem. It > > solves "not exiting" a badly-written application problem (I mean an app is > > returning from main() without calling close() for ports). > > It was general notice - not about close - but I am sorry - this is my > mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. > So - your proposal is good, but I have observed that RXTXPort ends work even > without close, if application ends with System.exit(0). That's how exit works by the definition (contrary to returning from main(String[])). > > But in this case - If you will try my example without System.exit(0), > program stays in memory and Netbeans says that application runs... > This is the case of badly written application - what in this case? No, in my case a "badly-written application" is exiting from an app w/o closing ports - this works with the original Sun Comm API but run into a "not exiting" problem with rxtx (unless System.exit is used, of course). > Something is wrong in my technique of subsequent opens? > Variables configuration? > No finalize of the RXTX port? Maybe this is it. Finalizers are not guaranteed to be ever run. > If yes, everything should be changed and my example is workaround only - all > threads disconnections should be done during close, inside RXTXPort.java.. > > Today I have written serial port scanner which is looking for specific > external device checking all system serial ports - opening, sending query, > closing (this is why I needed working close()). > No memory waste, no lost threads in memory, but my application ends with > System.exit(0). > Workaround works... > > Regards > Mariusz Dec At present, I use System.exit(0) in my app to workaround the absence of setDaemon too. Regards, Ovan From mariusz.dec at gmail.com Sun Nov 29 01:01:28 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 09:01:28 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: Hi all, While googling for something, I have found this site: http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ There is a lot about RXTX, and sample works with Events. It differs from original RXTX samples. The only question is - why original samples doesn't work correct and there is no links to real solutions... RXTX project is great but... Regards Mariusz Dec From tjarvi at qbang.org Sun Nov 29 08:57:08 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 29 Nov 2009 08:57:08 -0700 (MST) Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: On Sun, 29 Nov 2009, M.Dec-Gazeta wrote: > Hi all, > While googling for something, I have found this site: > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. > > The only question is - why original samples doesn't work correct and there > is no links to real solutions... > RXTX project is great but... > Hi Mariusz, The rxtx project is far from perfect and needs help from users as well as developers. As you identify problems such as the original samples not doing what you need and missing links to the one you wanted, please do take a moment to edit the page another user created in hopes of helping you. Just remember that the wiki pages are almost entirely sponsored by individuals taking time to fix what bothered them. In the early stages, the concern was no examples. A positive tone is always appreciated. Posting to the mail-list is also appreciated and will make it more likely to attract a developer to sponsor a fix with their efforts. -- Trent Jarvi tjarvi at qbang.org From mariusz.dec at gmail.com Sun Nov 29 11:39:59 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 19:39:59 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <9732BACF0EFD43F3A6B0396ADF0C7811@mdam2> Hi Jarvi, > ...A positive tone is always appreciated. I am very sorry, that you have received my message as something wrong in my mind about your work in this GREAT project. I am very sorry - belive me please. I hope that my work over this close() problem, ready to use example and published later link, shows my FULL POSITIVE thinking about RXTX. Regards Mariusz Dec > > -- > Trent Jarvi > tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Mon Nov 30 04:06:03 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 12:06:03 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Hi, I could not resist to write about how to use InputStream.read(byte[]) because I think this again is an example showing it wrongly. * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. it contains: 259 private byte[] readBuffer = new byte[400]; (I better don't comment on this one here) 272 try { 273 int availableBytes = inStream.available(); 274 if (availableBytes > 0) { 275 // Read the serial port 276 inStream.read(readBuffer, 0, availableBytes); 277 278 // Print it out 279 System.out.println("Recv :" + 280 new String(readBuffer, 0, availableBytes)); 281 } 282 } catch (IOException e) { 283 } I think this is wrong: - exceptions should be ignored never (without even logging) - when code cannot handle an exception, I think it should not catch it (or catch-log-throw) - it assumes 400 bytes are the maximum a serial link can recveive in a read call, but there is no such guarantee by the API - it assumes that read will read availableBytes but there is no such guarantee by API definition - it assumes availableBytes <= readBuffer.length - The STDOUT output depends on timing details (it could happen that in one situation two Recv: lines are printed but in another arbitrary similar situation just one is printed due to different timing details I think InputStream.read(byte[]) is better to be used in a construction like this (assuming it polls based on an event as in the example): // some doReadFunc(): boolean eof = false; int chunkSize = 128; byte[] readData = new byte[0]; while(eof == false && inStream.available()) { byte[] readBuf = new byte[chunkSize]; // available() guaranteed read will not block, but // we may read more than available bytes here (in case more were // received) or less than (if read returns earlier, which is // allowed by spec) - but at least 1. int thisRead = inStream.read(readBuffer, 0, readBuf.length); if (thisRead == -1) { // Please note that we cannot throw here // if (readData.length() > 0), // because caller would not see the contents of readData. // But we could throw in case readData is empty. eof = true; } else { // Now we need a "readData += readBuffer;". // Don't know if this really is so uncomfortable on Java or if I // just don't know how to do it better. This commonly should be // in some appendBuffer helper function (doing realloc + 2copy) byte[]tmpBuf = new byte[readData.length + thisRead]; // assert(readData.length + thisRead == totalRead); System.arraycopy(readData, 0, tmpBuf, 0, readData.length); System.arraycopy(readBuf, 0, tmpBuf, readData.length, thisRead); readData = tmpBuf; } } // readData contains the data that could be read. It could be empty/zero // in case no bytes available(), but it blocks never. It could be that exactly at the time when inStream.available() returned zero a new byte arrives, so typically someone will need to have a message parsing loop around (or integrated) - usually it is easier to try to read what is needed and timeout otherwise (in contrast to read what is avialable and then guess if could be complete by timing). Simple example could be: // has methods "boolean isComplete()" and "int bytesNeeded()". BinaryMessage message; while(!message.isComplete() && !timer.isExpired() ) { // doRead(InputStream, int len) which does NOT BLOCK but return zero // in case there is no data avialable() byte[] readData = doRead(input, message.bytesNeeded()); // we should not poll. With Java InputStream it is hard to handle, // because avialable() has no timeout parameter. We can use small // delays to convert this spinlock to a 20 ms poll which works when // having a few connections only but wastes resources. Better would // be to synchronize with some events such as // SerialPortEvent.DATA_AVAILABLE, but this makes this code depend // on SerialPort (otherwise, it would work on ANY InputStream which // IMHO should be the reason why InputStream exists, but this is // off-topic here) } if (timer.isExpired()) { // handle timeout } // else assert(message.isComplete()); Exceptions could be handled in a way like: String portName = "/dev/ttyS0"; // pseudo code: SerialPort port = SerialPort.open(portName); try { try { thisRead = port.is.read(); if (thisRead == -1) { if (readData.length == 0) { throw new ConnectionClosedByPeerException(); } } } catch {IOException ioex) { CommException ex = new CommIOException(ioex); ex.appendInfo("while reading"); } } catch (CommException ex) { // Instead of the read call above probably we call a method working // on InputStream. This function cannot know the portName, but for // the user this is very important. Because of this we add the // information. We do this on each level/layer: our caller appends // why the port were read (e.g. "while initilizing modem" or // "quering thermometer sensor") and so on. The user then can get a // message like // unexpected DCD drop (carrier lost) while reading /dev/ttyS0 for // Modem communication while sending file UPLOAD.DAT for module // DataReconciliation triggered by Cron Call "Daily Reconciliation" // by application "My Monitor". // much better than "IOException in IO.java:1234"! // They are intended to include ANY information needed to resolve the // issue (without needing complete logs maybe even with // version-dependent stack dumps, which would be horrible). CommException ex = new CommIOException(ioex); ex.appendInfo(" on port " + portName); } Comments, corrections and critics are appreciated! oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 04:50:40 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 12:50:40 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Message-ID: <17E538BC24EE42EC89F5BB086205F581@mdam2> ----- Original Message ----- From: "Steffen DETTMER" To: "rxtx" Sent: Monday, November 30, 2009 12:06 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > Hi, > > I could not resist to write about how to use InputStream.read(byte[]) > because I think this again is an example showing it wrongly. > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: >> http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ >> >> There is a lot about RXTX, and sample works with Events. >> It differs from original RXTX samples. > I didn't checked this sample befor posting, and I did missusage of the word "works". Sorry, should be "sample prepared for Events". Yesterday afteroon I have checked this technique in XP only, but I have had problems and have switched to other tasks. Steffen, please attach your new complete example to be sure no errors while changing and please let me know in which platform you have tested it. I will check it on my systems. Maybe this is a platform problem? Why I think so: My sample works in Windows and Linux, but in real application I have detected problem with Linux. In old systems we have had hard list of the serial ports, but now user may connect and disconnect USB-Serial dongle while application is running. Effects are clear... We (developers) have to be ready to serve it. And therefore I have an configuration form where user may check device, find it automatically or declare manually COM (dev/tty...) device. Before each auto-looking for my specific device I have (I should) to re-read available ports (I have the button to manually refresh list of the ports as well). In XP and Vista it works very good. No one crash in 5 hours when I was doing that!!! But in Linux (newest Ubuntu) there is a problem. Doing an enumeration of the devices when RXTX driver was previousluy used, places new instance of the RXTXDriver in the memory: CommPortIdentifier.java, line 327. When this action occurs, IOLocked stays 2, previously used device is not visible even if was correctly closed! Application hangs, but I don't know yet where - earlier it was read loop. Now I have to do some other things, later I will go back to problem. Regards Mariusz From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From nate at n4te.com Thu Nov 26 14:32:21 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 13:32:21 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Ah, thanks Ivan. What do you think about supporting both 32 bit and 64 bit DLLs, with the correct one chosen at runtime? This way I don't need two separate versions of my app. -Nate 2009/11/26 Ivan Maidanski : > Nate wrote: >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >> I see a user has come up with a workaround for 64 bit OS X. Has anyone >> done this for Windows? Are there plans to support 64 bit Windows? > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > >> >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >> Other open source projects such as LWJGL (http://lwjgl.org/) include >> both 32 and 64 bit native libs and the correct lib is automatically >> used. >> >> -Nate > > From ivmai at mail.ru Thu Nov 26 14:52:53 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Fri, 27 Nov 2009 00:52:53 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan From Kapil_Gupta at hcl.in Thu Nov 26 22:47:13 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 27 Nov 2009 11:17:13 +0530 Subject: [Rxtx] Rxtx Digest, Vol 27, Issue 7 In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960FDD2F38A@NDA-HCLT-EVS05.HCLT. CORP.HCL.IN-F0913EFA-B2A5-28E5-3684-11AABE813CF9> Hi, I am also facing the same issue as Mariusz is facing, I am facing it on Intel Mac 10.5.8. I am using RXTX 2.2 Pre binaries. First time I am able to read the data from my device, but second time port open hangs (RXTXPort.java). I am using TI chip set in my device. I created a C sample to test the driver but that works perfectly to read device any number of times. No hangs !! Note: My sample works fine on Windows XP. Please help. Thanks, Kapil -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Thursday, November 26, 2009 6:50 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 27, Issue 7 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! (M.Dec-GMail) 2. Re: Patch adding monThread setDaemon (Steffen DETTMER) 3. Re: Patch adding monThread setDaemon (Ivan Maidanski) 4. Patch for WinCE readArray (Ivan Maidanski) 5. Re: Patch adding monThread setDaemon (Ivan Maidanski) 6. Re: SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! (Ivan Maidanski) 7. Re: Patch adding monThread setDaemon (Trent Jarvi) 8. 64 bit (Nate) 9. Re: 64 bit (Ivan Maidanski) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Nov 2009 20:23:54 +0100 From: "M.Dec-GMail" To: Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2 at mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end ------------------------------ Message: 2 Date: Mon, 23 Nov 2009 22:26:36 +0100 From: "Steffen DETTMER" To: "rxtx" Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset="utf-8" > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail ------------------------------ Message: 3 Date: Tue, 24 Nov 2009 10:36:34 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 4 Date: Tue, 24 Nov 2009 22:26:00 +0300 From: Ivan Maidanski To: rxtx Subject: [Rxtx] Patch for WinCE readArray Message-ID: Content-Type: text/plain; charset="koi8-r" Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: ------------------------------ Message: 5 Date: Tue, 24 Nov 2009 22:33:41 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 6 Date: Tue, 24 Nov 2009 22:38:40 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! Message-ID: Content-Type: text/plain; charset=koi8-r Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) ------------------------------ Message: 7 Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) From: Trent Jarvi To: Ivan Maidanski Cc: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------ Message: 8 Date: Thu, 26 Nov 2009 05:08:27 -0800 From: Nate To: rxtx at qbang.org Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate ------------------------------ Message: 9 Date: Thu, 26 Nov 2009 16:24:21 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] 64 bit Message-ID: Content-Type: text/plain; charset=koi8-r Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate ------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx End of Rxtx Digest, Vol 27, Issue 7 *********************************** DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From m.kirkland at comcast.net Fri Nov 27 01:56:33 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 27 Nov 2009 00:56:33 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Or you could try the following utility which will modify the native library search path at run time based on the os.name and os.arch system properties. http://hamware.info/tools/LibLoader.zip Read the comments in the code and the properties file for details. Mike -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Ivan Maidanski Sent: Thursday, November 26, 2009 1:53 PM To: rxtx Subject: Re: [Rxtx] 64 bit Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri Nov 27 08:48:41 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 27 Nov 2009 08:48:41 -0700 (MST) Subject: [Rxtx] 64 bit In-Reply-To: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: I've used the native library search path to solve the problem in the past. The 64/32 bit library is one issue. There is also an issue binaries that can run on multiple archs. http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ This can be complicated by libc sources/versions ... At first glance, it would appear reasonable to modify the library name or path. When I think about it, the better approach is to make sure the libraries load in an intuitive way when installed alone for the novice and leave the multiple arch/os support problem as an exercise for the implementor as they will have an advanced skill set (and hopefully a nice wiki page helping them). On Fri, 27 Nov 2009, Mike Kirkland wrote: > Or you could try the following utility which will modify the native library > search path at run time based on the os.name and os.arch system properties. > > http://hamware.info/tools/LibLoader.zip > > Read the comments in the code and the properties file for details. > > Mike > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Ivan Maidanski > Sent: Thursday, November 26, 2009 1:53 PM > To: rxtx > Subject: Re: [Rxtx] 64 bit > > Hi! > Nate wrote: >> Ah, thanks Ivan. >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String > basename) which if sun.arch.data.model property is defined and equals "64" > then first tries to load basename+"64" library otherwize (if not 64 or > failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with > RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" > for 64-bit targets (optionally, if needed). > >> >> -Nate >> >> >> 2009/11/26 Ivan Maidanski : >>> Nate wrote: >>>> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >>>> I see a user has come up with a workaround for 64 bit OS X. Has anyone >>>> done this for Windows? Are there plans to support 64 bit Windows? >>> >>> rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily > rebuild it from the sources using e.g. mingw-w64.) >>> >>>> >>>> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >>>> Other open source projects such as LWJGL (http://lwjgl.org/) include >>>> both 32 and 64 bit native libs and the correct lib is automatically >>>> used. > > Best regards, > Ivan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Fri Nov 27 13:55:55 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Fri, 27 Nov 2009 21:55:55 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved Message-ID: Hi Ivan, Trent, Steffen, Kapil and all :) I have found a method how to close() and reopen RXTX serial port without problems. This is done on the rxtx-2.2pre2 version, but I think that it should work on earlier versions as well. I have tested it on Windows XP, Vista and Linux, Ubuntu distribution. On Windows XP it works on native UART and VCP, on Vista and Ubuntu I haven't native UART, so I have tested it with USB-RS232 VCP from FTDI. There is NO code changes in Java and C, this is only better external service of the processes between Java threads and native interface. I have found it looking in the code and tracing Java in Netbeans 6.7.1. using printouts from C part - #define TRENT_IS_HERE :) Attached file - TwoWaySerialCommMd.java is derived from the original TwoWaySerialComm.java but works a bit better :). Important comments are inside the file. I hope Kapil answers what about Macintosh but it should looks like in Linux. A bit about works of the Ivan and Steffen form last days. I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good idea when RXTXPort is used as a part of the application, but I think that Trent should accept or not this change. In my opinion this change does nothing in this case. If somebody needs serial daemon should do it a level up... Especially to Trent: 1. I have read a lot about synchronisation and in my opinion monThreadMutex in RXTXPort.java should be declared as final, the same with Sync in CommPortIdentifier. 2. Please check this example and, if this is good, add it to official examples of the RXTX. ABOUT EVENTS In my application I have checked events as well, but they works to slow for me - to big delay - I don't know why. Finally, I have decided to generate my own Exception when data from inStream is collected and proper parsed (I need packs of bytes). Exception transfers data to rest of the application. The only disadvantage is ASCII model of the data which may be transferred through Exception, but for me its enough. Therefore I don't know what to do with SerialEvent of the RXTX - I have found questions about the same problem with close() while using Events. Maybe somebody wiil solve this problem using my job. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M+R\F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8-"B\O)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F#0HO+R!(;W<@=&\@=7-E(%)8 M5%A397)I86Q0;W)T#0HO+R!">2!-87)I=7-Z($1E8RP at 4&]L86YD#0HO+R!. M;W9E;6)E5-EB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@<')E<&%R:6YG(&EN4W1R96%M(&%N9"!O M=713=')E86T@=&\@9&5A8W1I=F%T92!B969OF5D*'-T;W!296%D M375T97 at I#0H@(" @(" @(" @(" @>W-T;W!296%D(#T@=')U93M]#0H@(" @ M(" @('-Y;F-H"D-"B @(" @(" @(" @ M("![4]W;F5D M*"D@*0T*(" @(" @("![#0H@(" @(" @(" @("!3>7-T96TN;W5T+G!R:6YT M;&XH(D5R2!I;B!U2P@;&EN92 X-# L M(#@V,0T*+R\@5VEN9&]W7-T96TN;W5T+G!R:6YT;&XH(D5R2!T:&ES(&5X86UP;&4N(BD[#0H@(" @(" @(" @ M("!]#0H@(" @(" @('T@(" @( T*(" @('T-"B\O*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H@(" @+RHJ("HO#0H@(" @<'5B;&EC('-T M871I8R!C;&%SB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@16YA8FQI;F<@=V]R:R!O9B!T:&4@:6Y3 M=')E86T-"@T*(" @(" @(" @(" @('-Y;F-H71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5; M,3 R-%T[#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @ M("!TB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)@T*+R\@0VAE8VMI;F<@:68 at 86)O=70@=&\@8VQO7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@&-E<'1I;VX@ M92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPF5D*'-T;W!70T*(" @(" @(" @(" @>R @(" @(" @(" @(" @(" -"B @(" @ M(" @(" @(" @("!I;G0 at 8R ](# [#0H@(" @(" @(" @(" @(" @=VAI;&4@ M*" H(&,@/2!3>7-T96TN:6XN7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@=W)I=&EN9RXN+B(I.PT*(" @(" @ M(" @(" @(" @(" @(" @(" @8G)E86L[#0H@(" @(" @(" @(" @(" @(" @ M('T-"B @(" @(" @(" @(" @(" @(" @=&AI&-E<'1I;VX at 92 I#0H@(" @ M(" @(" @("![#0H@(" @(" @(" @(" @(" @92YP" H1$(Y M("T@<&EN(#(@8V]N;F5C=&5D('1O(#,I("!D871A('=I;&P@ T*(" @(" @("!3=')I;F<@<&]R=$YA;64@ M/2 B+V1E=B]T='E54T(P(CL-"@T*+R\@36%C#0HO+U-T3\_/S\_/S\_(CL-"@T*(" @(" @("!TPT*(" @(" @(" @(" @5-E2 at I("T at 4G5N=&EM92YG9712=6YT:6UE*"DN9G)E94UE;6]R>2 at I*2D[ M#0H@(" @(" @(" @4WES=&5M+F]U="YPPT*(" @(" @("!3>7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!O M<&5N*"DN+BXB("L@<&]R=$YA;64I.PT*(" @(" @("!T7-T96TN;W5T+G!R:6YT;&XH(E=A:71I;F7-T96TN;W5T+G!R:6YT;&XH92YT M;U-T0T*(" @(" @("![#0H@(" @(" @(" @(" @&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @92YP M&ET*# I.PT*(" @('T-"GT-"@`` ` end From nate at n4te.com Fri Nov 27 17:09:50 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:09:50 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> 2009/11/26 Ivan Maidanski : > Nate wrote: >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). Please see the attached patch for the Java changes. I didn't update the build scripts, I'm fine with just renaming the libs myself for now. After some thought, I decided since the sun.arch.data.model property is unreliable, being Sun JVM specific, so I settled on loading the 32-bit lib by default and trying the 64-bit lib if that fails. The patch also sets "devel" to false in RXTXCommDriver. I strongly believe a third party library should not be hardcoded to dump to System.out, especially when nothing is wrong. If I want to dump the rxtx version to System.out, I can write one line of code to do so (ASCII art is certainly not needed). -Nate -------------- next part -------------- A non-text attachment was scrubbed... Name: nativeLib.patch Type: application/octet-stream Size: 2700 bytes Desc: not available URL: From nate at n4te.com Fri Nov 27 17:12:24 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:12:24 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: <7d6ffee60911271612u4f3830aam295c56fe6c93e277@mail.gmail.com> On Fri, Nov 27, 2009 at 7:48 AM, Trent Jarvi wrote: > The 64/32 bit library is one issue. There is also an issue binaries that > can run on multiple archs. > > http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ > > This can be complicated by libc sources/versions ... > > At first glance, it would appear reasonable to modify the library name or > path. When I think about it, the better approach is to make sure the > libraries load in an intuitive way when installed alone for the novice and > leave the multiple arch/os support problem as an exercise for the > implementor as they will have an advanced skill set (and hopefully a nice > wiki page helping them). Ideally rxtx could be shipped with all the native libs and it would know how to pick the appropriate one. This way it can be kept up to date by the rxtx project rather than each user with this need maintain their own loading code. That said, if no one actually has this need, I don't see a problem with waiting for the first person to implement it, then absorbing it into the rxtx project. IMO, the next best thing is to at least handle the most common case, which is 32/64-bit. -Nate From ivmai at mail.ru Sat Nov 28 00:48:05 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 10:48:05 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: Hi! Nate wrote: > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> What do you think about supporting both 32 bit and 64 bit DLLs, with > >> the correct one chosen at runtime? This way I don't need two separate > >> versions of my app. > > > > I think it would be good. I think this should be implemented as follows: > > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > Please see the attached patch for the Java changes. I didn't update > the build scripts, I'm fine with just renaming the libs myself for > now. After some thought, I decided since the sun.arch.data.model > property is unreliable, being Sun JVM specific, so I settled on > loading the 32-bit lib by default and trying the 64-bit lib if that > fails. I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. > > The patch also sets "devel" to false in RXTXCommDriver. I strongly > believe a third party library should not be hardcoded to dump to > System.out, especially when nothing is wrong. If I want to dump the > rxtx version to System.out, I can write one line of code to do so > (ASCII art is certainly not needed). > > -Nate > > ATTACHMENT: application/x-patch (nativeLib.patch) From nate at n4te.com Sat Nov 28 00:55:59 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 23:55:59 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: <7d6ffee60911272355p73e526a0t5c10a7fc4d0f6663@mail.gmail.com> Hi Ivan, 2009/11/27 Ivan Maidanski : > Hi! > Nate wrote: >> 2009/11/26 Ivan Maidanski : >> > Nate wrote: >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> >> the correct one chosen at runtime? This way I don't need two separate >> >> versions of my app. >> > >> > I think it would be good. I think this should be implemented as follows: >> > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); >> > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); >> > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). >> >> Please see the attached patch for the Java changes. I didn't update >> the build scripts, I'm fine with just renaming the libs myself for >> now. After some thought, I decided since the sun.arch.data.model >> property is unreliable, being Sun JVM specific, so I settled on >> loading the 32-bit lib by default and trying the 64-bit lib if that >> fails. > > I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. I meant unreliable in that the property isn't defined by the JVM spec, so may not be available in all JVMs. This means even if it is false, 64-bit must be tried before absolute failure. > The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. Sure. Here is how I would write it, with clarity in mind: static void loadLibrary (String baseName) { if (System.getProperty("sun.arch.data.model", "").equals("64")) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ex64) { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ignored) { throw ex64; } } } else { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ex32) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ignored) { throw ex32; } } } } -Nate >> >> The patch also sets "devel" to false in RXTXCommDriver. I strongly >> believe a third party library should not be hardcoded to dump to >> System.out, especially when nothing is wrong. If I want to dump the >> rxtx version to System.out, I can write one line of code to do so >> (ASCII art is certainly not needed). >> >> -Nate >> >> ATTACHMENT: application/x-patch (nativeLib.patch) > > From ivmai at mail.ru Sat Nov 28 07:26:43 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 17:26:43 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: References: Message-ID: "M.Dec-GMail" wrote: > Hi Ivan, Trent, Steffen, Kapil and all :) > ... > A bit about works of the Ivan and Steffen from last days. > > I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good > idea when RXTXPort is used as a part of the application, but I think that > Trent should accept or not this change. > In my opinion this change does nothing in this case. > If somebody needs serial daemon should do it a level up... I never claimed setDaemon patch would solve the port close problem. It solves "not exiting" a badly-written application problem (I mean an app is returning from main() without calling close() for ports). > ... > Regards > Mariusz Dec From mariusz.dec at gmail.com Sat Nov 28 09:29:04 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 28 Nov 2009 17:29:04 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <536A5B02D18041459E65A4D1182D1374@mdam2> ----- Original Message ----- From: "Ivan Maidanski" To: "rxtx" Sent: Saturday, November 28, 2009 3:26 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > I never claimed setDaemon patch would solve the port close problem. It > solves "not exiting" a badly-written application problem (I mean an app is > returning from main() without calling close() for ports). It was general notice - not about close - but I am sorry - this is my mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. So - your proposal is good, but I have observed that RXTXPort ends work even without close, if application ends with System.exit(0). But in this case - If you will try my example without System.exit(0), program stays in memory and Netbeans says that application runs... This is the case of baddly written application - what in this case? Something is wrong in my techniuqe of subsequent opens? Variables configuration? No finalize of the RXTX port? Maybe this is it. If yes, everything should be changed and my example is workaround only - all threads disconnections should be done during close, inside RXTXPort.java.. Today I have written serial port scanner which is looking for specific external device checking all system serial ports - opening, sending query, closing (this is why I needed working close()). No memory waste, no lost threads in memory, but my application ends with System.exit(0). Workaround works... Regards Mariusz Dec >> ... >> Regards >> Mariusz Dec > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ivmai at mail.ru Sat Nov 28 09:57:33 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 19:57:33 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: <536A5B02D18041459E65A4D1182D1374@mdam2> References: <536A5B02D18041459E65A4D1182D1374@mdam2> Message-ID: "M.Dec-GMail" wrote: > ----- Original Message ----- > From: "Ivan Maidanski" > Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > > > I never claimed setDaemon patch would solve the port close problem. It > > solves "not exiting" a badly-written application problem (I mean an app is > > returning from main() without calling close() for ports). > > It was general notice - not about close - but I am sorry - this is my > mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. > So - your proposal is good, but I have observed that RXTXPort ends work even > without close, if application ends with System.exit(0). That's how exit works by the definition (contrary to returning from main(String[])). > > But in this case - If you will try my example without System.exit(0), > program stays in memory and Netbeans says that application runs... > This is the case of badly written application - what in this case? No, in my case a "badly-written application" is exiting from an app w/o closing ports - this works with the original Sun Comm API but run into a "not exiting" problem with rxtx (unless System.exit is used, of course). > Something is wrong in my technique of subsequent opens? > Variables configuration? > No finalize of the RXTX port? Maybe this is it. Finalizers are not guaranteed to be ever run. > If yes, everything should be changed and my example is workaround only - all > threads disconnections should be done during close, inside RXTXPort.java.. > > Today I have written serial port scanner which is looking for specific > external device checking all system serial ports - opening, sending query, > closing (this is why I needed working close()). > No memory waste, no lost threads in memory, but my application ends with > System.exit(0). > Workaround works... > > Regards > Mariusz Dec At present, I use System.exit(0) in my app to workaround the absence of setDaemon too. Regards, Ovan From mariusz.dec at gmail.com Sun Nov 29 01:01:28 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 09:01:28 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: Hi all, While googling for something, I have found this site: http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ There is a lot about RXTX, and sample works with Events. It differs from original RXTX samples. The only question is - why original samples doesn't work correct and there is no links to real solutions... RXTX project is great but... Regards Mariusz Dec From tjarvi at qbang.org Sun Nov 29 08:57:08 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 29 Nov 2009 08:57:08 -0700 (MST) Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: On Sun, 29 Nov 2009, M.Dec-Gazeta wrote: > Hi all, > While googling for something, I have found this site: > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. > > The only question is - why original samples doesn't work correct and there > is no links to real solutions... > RXTX project is great but... > Hi Mariusz, The rxtx project is far from perfect and needs help from users as well as developers. As you identify problems such as the original samples not doing what you need and missing links to the one you wanted, please do take a moment to edit the page another user created in hopes of helping you. Just remember that the wiki pages are almost entirely sponsored by individuals taking time to fix what bothered them. In the early stages, the concern was no examples. A positive tone is always appreciated. Posting to the mail-list is also appreciated and will make it more likely to attract a developer to sponsor a fix with their efforts. -- Trent Jarvi tjarvi at qbang.org From mariusz.dec at gmail.com Sun Nov 29 11:39:59 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 19:39:59 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <9732BACF0EFD43F3A6B0396ADF0C7811@mdam2> Hi Jarvi, > ...A positive tone is always appreciated. I am very sorry, that you have received my message as something wrong in my mind about your work in this GREAT project. I am very sorry - belive me please. I hope that my work over this close() problem, ready to use example and published later link, shows my FULL POSITIVE thinking about RXTX. Regards Mariusz Dec > > -- > Trent Jarvi > tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Mon Nov 30 04:06:03 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 12:06:03 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Hi, I could not resist to write about how to use InputStream.read(byte[]) because I think this again is an example showing it wrongly. * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. it contains: 259 private byte[] readBuffer = new byte[400]; (I better don't comment on this one here) 272 try { 273 int availableBytes = inStream.available(); 274 if (availableBytes > 0) { 275 // Read the serial port 276 inStream.read(readBuffer, 0, availableBytes); 277 278 // Print it out 279 System.out.println("Recv :" + 280 new String(readBuffer, 0, availableBytes)); 281 } 282 } catch (IOException e) { 283 } I think this is wrong: - exceptions should be ignored never (without even logging) - when code cannot handle an exception, I think it should not catch it (or catch-log-throw) - it assumes 400 bytes are the maximum a serial link can recveive in a read call, but there is no such guarantee by the API - it assumes that read will read availableBytes but there is no such guarantee by API definition - it assumes availableBytes <= readBuffer.length - The STDOUT output depends on timing details (it could happen that in one situation two Recv: lines are printed but in another arbitrary similar situation just one is printed due to different timing details I think InputStream.read(byte[]) is better to be used in a construction like this (assuming it polls based on an event as in the example): // some doReadFunc(): boolean eof = false; int chunkSize = 128; byte[] readData = new byte[0]; while(eof == false && inStream.available()) { byte[] readBuf = new byte[chunkSize]; // available() guaranteed read will not block, but // we may read more than available bytes here (in case more were // received) or less than (if read returns earlier, which is // allowed by spec) - but at least 1. int thisRead = inStream.read(readBuffer, 0, readBuf.length); if (thisRead == -1) { // Please note that we cannot throw here // if (readData.length() > 0), // because caller would not see the contents of readData. // But we could throw in case readData is empty. eof = true; } else { // Now we need a "readData += readBuffer;". // Don't know if this really is so uncomfortable on Java or if I // just don't know how to do it better. This commonly should be // in some appendBuffer helper function (doing realloc + 2copy) byte[]tmpBuf = new byte[readData.length + thisRead]; // assert(readData.length + thisRead == totalRead); System.arraycopy(readData, 0, tmpBuf, 0, readData.length); System.arraycopy(readBuf, 0, tmpBuf, readData.length, thisRead); readData = tmpBuf; } } // readData contains the data that could be read. It could be empty/zero // in case no bytes available(), but it blocks never. It could be that exactly at the time when inStream.available() returned zero a new byte arrives, so typically someone will need to have a message parsing loop around (or integrated) - usually it is easier to try to read what is needed and timeout otherwise (in contrast to read what is avialable and then guess if could be complete by timing). Simple example could be: // has methods "boolean isComplete()" and "int bytesNeeded()". BinaryMessage message; while(!message.isComplete() && !timer.isExpired() ) { // doRead(InputStream, int len) which does NOT BLOCK but return zero // in case there is no data avialable() byte[] readData = doRead(input, message.bytesNeeded()); // we should not poll. With Java InputStream it is hard to handle, // because avialable() has no timeout parameter. We can use small // delays to convert this spinlock to a 20 ms poll which works when // having a few connections only but wastes resources. Better would // be to synchronize with some events such as // SerialPortEvent.DATA_AVAILABLE, but this makes this code depend // on SerialPort (otherwise, it would work on ANY InputStream which // IMHO should be the reason why InputStream exists, but this is // off-topic here) } if (timer.isExpired()) { // handle timeout } // else assert(message.isComplete()); Exceptions could be handled in a way like: String portName = "/dev/ttyS0"; // pseudo code: SerialPort port = SerialPort.open(portName); try { try { thisRead = port.is.read(); if (thisRead == -1) { if (readData.length == 0) { throw new ConnectionClosedByPeerException(); } } } catch {IOException ioex) { CommException ex = new CommIOException(ioex); ex.appendInfo("while reading"); } } catch (CommException ex) { // Instead of the read call above probably we call a method working // on InputStream. This function cannot know the portName, but for // the user this is very important. Because of this we add the // information. We do this on each level/layer: our caller appends // why the port were read (e.g. "while initilizing modem" or // "quering thermometer sensor") and so on. The user then can get a // message like // unexpected DCD drop (carrier lost) while reading /dev/ttyS0 for // Modem communication while sending file UPLOAD.DAT for module // DataReconciliation triggered by Cron Call "Daily Reconciliation" // by application "My Monitor". // much better than "IOException in IO.java:1234"! // They are intended to include ANY information needed to resolve the // issue (without needing complete logs maybe even with // version-dependent stack dumps, which would be horrible). CommException ex = new CommIOException(ioex); ex.appendInfo(" on port " + portName); } Comments, corrections and critics are appreciated! oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 04:50:40 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 12:50:40 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Message-ID: <17E538BC24EE42EC89F5BB086205F581@mdam2> ----- Original Message ----- From: "Steffen DETTMER" To: "rxtx" Sent: Monday, November 30, 2009 12:06 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > Hi, > > I could not resist to write about how to use InputStream.read(byte[]) > because I think this again is an example showing it wrongly. > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: >> http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ >> >> There is a lot about RXTX, and sample works with Events. >> It differs from original RXTX samples. > I didn't checked this sample befor posting, and I did missusage of the word "works". Sorry, should be "sample prepared for Events". Yesterday afteroon I have checked this technique in XP only, but I have had problems and have switched to other tasks. Steffen, please attach your new complete example to be sure no errors while changing and please let me know in which platform you have tested it. I will check it on my systems. Maybe this is a platform problem? Why I think so: My sample works in Windows and Linux, but in real application I have detected problem with Linux. In old systems we have had hard list of the serial ports, but now user may connect and disconnect USB-Serial dongle while application is running. Effects are clear... We (developers) have to be ready to serve it. And therefore I have an configuration form where user may check device, find it automatically or declare manually COM (dev/tty...) device. Before each auto-looking for my specific device I have (I should) to re-read available ports (I have the button to manually refresh list of the ports as well). In XP and Vista it works very good. No one crash in 5 hours when I was doing that!!! But in Linux (newest Ubuntu) there is a problem. Doing an enumeration of the devices when RXTX driver was previousluy used, places new instance of the RXTXDriver in the memory: CommPortIdentifier.java, line 327. When this action occurs, IOLocked stays 2, previously used device is not visible even if was correctly closed! Application hangs, but I don't know yet where - earlier it was read loop. Now I have to do some other things, later I will go back to problem. Regards Mariusz From oliverhoffmann32 at googlemail.com Mon Nov 30 08:07:31 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 16:07:31 +0100 Subject: [Rxtx] RXTX for ttyACM0 Message-ID: <200911301607.31300.oliverhoffmann32@googlemail.com> Hi RXTX Crew! I'm currently writing a small application which uses RXTX to communicate with an USB device: ... usb 1-10: new full speed USB device using ohci_hcd and address 3 usb 1-10: configuration #1 chosen from 1 choice cdc_acm 1-10:1.0: This device cannot do calls on its own. It is not a modem. cdc_acm 1-10:1.0: ttyACM0: USB ACM device usbcore: registered new interface driver cdc_acm cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters ... If I use cutecom I can open a connection to /dev/ttyACM0 without any problems, but CommPortIdentifier.getPortIdentifiers() from RXTX only lists some ttyS[0-9] devices. The only way I found is symlinking ttyACM0 to for example ttyS3, so i wonder if there's any better way (like if the user doesn't have write-access to /dev). Greatings, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 08:35:56 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:35:56 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <200911301607.31300.oliverhoffmann32@googlemail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> Message-ID: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> 2009/11/30 Oliver Hoffmann > Hi RXTX Crew! > > I'm currently writing a small application which uses RXTX to communicate > with > an USB device: > ... > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > wonder > if there's any better way (like if the user doesn't have write-access to > /dev). > To avoid this naming problem between systems and implementations of the USB-RS naming conventions I did it what you may see below. You may identify system elsewhere (isMac, isWindows, isLinux) and read appriorate prefixes from an INI file etc. So user may change their prefixes without changing application! Note that you have to look for ALL system ports, not serial only and do filtering yourself. In RXTXCommDriver.java you may change port candidates porefixes if you would like to change sources of the RXTX. If not - my example works fine. Regards Mariusz Dec /* * * @author Mariusz Dec * September 2009 */ import gnu.io.CommPortIdentifier; import java.util.Enumeration; import javax.swing.DefaultListModel; public class CommPortLister { public static String comPortsWindows = "COM"; public static String comPortsMacintosh1 = "/dev/tty"; public static String comPortsMacintosh2 = "/dev/cu"; public static String comPortsLinux1 = "/dev/usb/tty"; public static String comPortsLinux2 = "/dev/tty"; public DefaultListModel listCom() { Enumeration ports = CommPortIdentifier.getPortIdentifiers(); DefaultListModel pList = null; String pName = ""; String pStart1 = ""; String pStart2 = ""; pList = new DefaultListModel(); while(ports.hasMoreElements()) { pName = ((CommPortIdentifier)ports.nextElement()).getName(); if (isWindows) { pStart1 = comPortsWindows; pStart2 = "------"; } else if (isMac) { pStart1 = comPortsMacintosh1; pStart2 = comPortsMacintosh2; } else if (isLinux) { pStart1 = comPortsLinux1; pStart2 = comPortsLinux2; } if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) { pList.addElement(pName); } } return pList; } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Nov 30 08:40:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 16:40:13 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <17E538BC24EE42EC89F5BB086205F581@mdam2> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> Message-ID: <20091130154013.GL20226@elberon.bln.de.ingenico.com> * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100: > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > > > > > There is a lot about RXTX, and sample works with Events. > > > It differs from original RXTX samples. > > I didn't checked this sample befor posting, and I did missusage of the word > "works". Sorry, should be "sample prepared for Events". no problem. I did neither intend to critice you nor the example; I did not even read what it demonstrates (I think it is not an example how to use read in best way). Maybe I just wanted to start an example :) Also I think that this example will work (ie. print something) in most cases! I'm just afraid people could start some prototype of their apps based on it, then improve here and there and finally have some server application with rare strange failures. > Steffen, please attach your new complete example to be sure no > errors while changing and please let me know in which platform > you have tested it. I will check it on my systems. You ask me to write a complete compiling example? mmm... maybe I could take some time this week to do so, but first I would like to ensure that it is correct. We had discussions about it in the past and there were many details to consider; easy to fall in a trap. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 08:59:47 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:59:47 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <20091130154013.GL20226@elberon.bln.de.ingenico.com> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> <20091130154013.GL20226@elberon.bln.de.ingenico.com> Message-ID: <73a89f360911300759l63335522sb16bc254a4d0ebb2@mail.gmail.com> 2009/11/30 Steffen DETTMER > * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100:> you have tested > it. I will check it on my systems. > > You ask me to write a complete compiling example? > Yes, if you did it.. BTW: I have analysed your mail and In the meantime I have solved problem in my application on Linux It was a mistake while copying sources between machines... hrrrr.. Returning to your work - like in each realtime and/or physical interfaces, timing may generate problems, especially with USB. Few months ago I have seen time critical application transferred to USB-RS232 dongle. Crazy results... USB is polling data, no interrupts... My new experience: My desktop XP is very fast, Vista and Ubuntu are on slower notebook. For Vista and Win RXTX.dll computer speed is enough but for Linux I have observed that rereshing ports list in the program sequence: disonnect(curPort); porstList = refreshPortsList(); returns portsList WITHOUT curPort... It means that curPort returns on the available ports list in system with delay after close(). This is not big problem, but a bit frustrating - I do not like to add delays everywhere... Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliverhoffmann32 at googlemail.com Mon Nov 30 09:10:15 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 17:10:15 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> Message-ID: <200911301710.16126.oliverhoffmann32@googlemail.com> On Monday 30 November 2009 16:35:56 Mariusz Dec wrote: > 2009/11/30 Oliver Hoffmann > > > Hi RXTX Crew! > > > > I'm currently writing a small application which uses RXTX to communicate > > with > > an USB device: > > ... > > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > > wonder > > if there's any better way (like if the user doesn't have write-access to > > /dev). > > To avoid this naming problem between systems and implementations of the > USB-RS naming conventions I did it what you may see below. > You may identify system elsewhere (isMac, isWindows, isLinux) and read > appriorate prefixes from an INI file etc. > So user may change their prefixes without changing application! > > Note that you have to look for ALL system ports, not serial only and do > filtering yourself. > > In RXTXCommDriver.java you may change port candidates porefixes if you > would like to change sources of the RXTX. > If not - my example works fine. > > Regards > Mariusz Dec > > /* > * > * @author Mariusz Dec > * September 2009 > */ > > import gnu.io.CommPortIdentifier; > > import java.util.Enumeration; > import javax.swing.DefaultListModel; > > public class CommPortLister { > > public static String comPortsWindows = "COM"; > public static String comPortsMacintosh1 = "/dev/tty"; > public static String comPortsMacintosh2 = "/dev/cu"; > public static String comPortsLinux1 = "/dev/usb/tty"; > public static String comPortsLinux2 = "/dev/tty"; > > > public DefaultListModel listCom() { > Enumeration ports = CommPortIdentifier.getPortIdentifiers(); > DefaultListModel pList = null; > String pName = ""; > String pStart1 = ""; > String pStart2 = ""; > pList = new DefaultListModel(); > while(ports.hasMoreElements()) > { > pName = ((CommPortIdentifier)ports.nextElement()).getName(); > > if (isWindows) > { > pStart1 = comPortsWindows; > pStart2 = "------"; > } > else > if (isMac) > { > pStart1 = comPortsMacintosh1; > pStart2 = comPortsMacintosh2; > } > else > if (isLinux) > { > pStart1 = comPortsLinux1; > pStart2 = comPortsLinux2; > } > > if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) > { > pList.addElement(pName); > } > } > return pList; > } > } > This wouldn't work because the list of CommPortIdentifier.getPortIdentifiers() is already filtered, so I would have to change the "CandidatePortPrefixes" list in RXTXCommDriver as you said. But after looking through the sourcecode I found that setting gnu.io.rxtx.SerialPorts to "/dev/ttyACM0" solved the problem. Sure it's not the nicest way but at leats it works. Maybe adding "ttyACM" to the list in RXTXCommDriver.java:521 is a more permanent solution. Regards, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 10:57:04 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 18:57:04 +0100 Subject: [Rxtx] RXTX for ttyACM0 References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> <200911301710.16126.oliverhoffmann32@googlemail.com> Message-ID: <09AC73AA7B22418BBCD1297A2D85A033@mdam2> > > This wouldn't work because the list of > CommPortIdentifier.getPortIdentifiers() > is already filtered, so I would have to change the > "CandidatePortPrefixes" list > in RXTXCommDriver as you said. It works in Windows from several months...., sorry Mariusz From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From nate at n4te.com Thu Nov 26 14:32:21 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 13:32:21 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Ah, thanks Ivan. What do you think about supporting both 32 bit and 64 bit DLLs, with the correct one chosen at runtime? This way I don't need two separate versions of my app. -Nate 2009/11/26 Ivan Maidanski : > Nate wrote: >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >> I see a user has come up with a workaround for 64 bit OS X. Has anyone >> done this for Windows? Are there plans to support 64 bit Windows? > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > >> >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >> Other open source projects such as LWJGL (http://lwjgl.org/) include >> both 32 and 64 bit native libs and the correct lib is automatically >> used. >> >> -Nate > > From ivmai at mail.ru Thu Nov 26 14:52:53 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Fri, 27 Nov 2009 00:52:53 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan From Kapil_Gupta at hcl.in Thu Nov 26 22:47:13 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 27 Nov 2009 11:17:13 +0530 Subject: [Rxtx] Rxtx Digest, Vol 27, Issue 7 In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960FDD2F38A@NDA-HCLT-EVS05.HCLT. CORP.HCL.IN-F0913EFA-B2A5-28E5-3684-11AABE813CF9> Hi, I am also facing the same issue as Mariusz is facing, I am facing it on Intel Mac 10.5.8. I am using RXTX 2.2 Pre binaries. First time I am able to read the data from my device, but second time port open hangs (RXTXPort.java). I am using TI chip set in my device. I created a C sample to test the driver but that works perfectly to read device any number of times. No hangs !! Note: My sample works fine on Windows XP. Please help. Thanks, Kapil -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Thursday, November 26, 2009 6:50 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 27, Issue 7 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! (M.Dec-GMail) 2. Re: Patch adding monThread setDaemon (Steffen DETTMER) 3. Re: Patch adding monThread setDaemon (Ivan Maidanski) 4. Patch for WinCE readArray (Ivan Maidanski) 5. Re: Patch adding monThread setDaemon (Ivan Maidanski) 6. Re: SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! (Ivan Maidanski) 7. Re: Patch adding monThread setDaemon (Trent Jarvi) 8. 64 bit (Nate) 9. Re: 64 bit (Ivan Maidanski) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Nov 2009 20:23:54 +0100 From: "M.Dec-GMail" To: Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2 at mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end ------------------------------ Message: 2 Date: Mon, 23 Nov 2009 22:26:36 +0100 From: "Steffen DETTMER" To: "rxtx" Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset="utf-8" > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail ------------------------------ Message: 3 Date: Tue, 24 Nov 2009 10:36:34 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 4 Date: Tue, 24 Nov 2009 22:26:00 +0300 From: Ivan Maidanski To: rxtx Subject: [Rxtx] Patch for WinCE readArray Message-ID: Content-Type: text/plain; charset="koi8-r" Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: ------------------------------ Message: 5 Date: Tue, 24 Nov 2009 22:33:41 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 6 Date: Tue, 24 Nov 2009 22:38:40 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! Message-ID: Content-Type: text/plain; charset=koi8-r Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) ------------------------------ Message: 7 Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) From: Trent Jarvi To: Ivan Maidanski Cc: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------ Message: 8 Date: Thu, 26 Nov 2009 05:08:27 -0800 From: Nate To: rxtx at qbang.org Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate ------------------------------ Message: 9 Date: Thu, 26 Nov 2009 16:24:21 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] 64 bit Message-ID: Content-Type: text/plain; charset=koi8-r Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate ------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx End of Rxtx Digest, Vol 27, Issue 7 *********************************** DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From m.kirkland at comcast.net Fri Nov 27 01:56:33 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 27 Nov 2009 00:56:33 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Or you could try the following utility which will modify the native library search path at run time based on the os.name and os.arch system properties. http://hamware.info/tools/LibLoader.zip Read the comments in the code and the properties file for details. Mike -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Ivan Maidanski Sent: Thursday, November 26, 2009 1:53 PM To: rxtx Subject: Re: [Rxtx] 64 bit Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri Nov 27 08:48:41 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 27 Nov 2009 08:48:41 -0700 (MST) Subject: [Rxtx] 64 bit In-Reply-To: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: I've used the native library search path to solve the problem in the past. The 64/32 bit library is one issue. There is also an issue binaries that can run on multiple archs. http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ This can be complicated by libc sources/versions ... At first glance, it would appear reasonable to modify the library name or path. When I think about it, the better approach is to make sure the libraries load in an intuitive way when installed alone for the novice and leave the multiple arch/os support problem as an exercise for the implementor as they will have an advanced skill set (and hopefully a nice wiki page helping them). On Fri, 27 Nov 2009, Mike Kirkland wrote: > Or you could try the following utility which will modify the native library > search path at run time based on the os.name and os.arch system properties. > > http://hamware.info/tools/LibLoader.zip > > Read the comments in the code and the properties file for details. > > Mike > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Ivan Maidanski > Sent: Thursday, November 26, 2009 1:53 PM > To: rxtx > Subject: Re: [Rxtx] 64 bit > > Hi! > Nate wrote: >> Ah, thanks Ivan. >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String > basename) which if sun.arch.data.model property is defined and equals "64" > then first tries to load basename+"64" library otherwize (if not 64 or > failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with > RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" > for 64-bit targets (optionally, if needed). > >> >> -Nate >> >> >> 2009/11/26 Ivan Maidanski : >>> Nate wrote: >>>> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >>>> I see a user has come up with a workaround for 64 bit OS X. Has anyone >>>> done this for Windows? Are there plans to support 64 bit Windows? >>> >>> rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily > rebuild it from the sources using e.g. mingw-w64.) >>> >>>> >>>> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >>>> Other open source projects such as LWJGL (http://lwjgl.org/) include >>>> both 32 and 64 bit native libs and the correct lib is automatically >>>> used. > > Best regards, > Ivan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Fri Nov 27 13:55:55 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Fri, 27 Nov 2009 21:55:55 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved Message-ID: Hi Ivan, Trent, Steffen, Kapil and all :) I have found a method how to close() and reopen RXTX serial port without problems. This is done on the rxtx-2.2pre2 version, but I think that it should work on earlier versions as well. I have tested it on Windows XP, Vista and Linux, Ubuntu distribution. On Windows XP it works on native UART and VCP, on Vista and Ubuntu I haven't native UART, so I have tested it with USB-RS232 VCP from FTDI. There is NO code changes in Java and C, this is only better external service of the processes between Java threads and native interface. I have found it looking in the code and tracing Java in Netbeans 6.7.1. using printouts from C part - #define TRENT_IS_HERE :) Attached file - TwoWaySerialCommMd.java is derived from the original TwoWaySerialComm.java but works a bit better :). Important comments are inside the file. I hope Kapil answers what about Macintosh but it should looks like in Linux. A bit about works of the Ivan and Steffen form last days. I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good idea when RXTXPort is used as a part of the application, but I think that Trent should accept or not this change. In my opinion this change does nothing in this case. If somebody needs serial daemon should do it a level up... Especially to Trent: 1. I have read a lot about synchronisation and in my opinion monThreadMutex in RXTXPort.java should be declared as final, the same with Sync in CommPortIdentifier. 2. Please check this example and, if this is good, add it to official examples of the RXTX. ABOUT EVENTS In my application I have checked events as well, but they works to slow for me - to big delay - I don't know why. Finally, I have decided to generate my own Exception when data from inStream is collected and proper parsed (I need packs of bytes). Exception transfers data to rest of the application. The only disadvantage is ASCII model of the data which may be transferred through Exception, but for me its enough. Therefore I don't know what to do with SerialEvent of the RXTX - I have found questions about the same problem with close() while using Events. Maybe somebody wiil solve this problem using my job. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M+R\F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8-"B\O)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F#0HO+R!(;W<@=&\@=7-E(%)8 M5%A397)I86Q0;W)T#0HO+R!">2!-87)I=7-Z($1E8RP at 4&]L86YD#0HO+R!. M;W9E;6)E5-EB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@<')E<&%R:6YG(&EN4W1R96%M(&%N9"!O M=713=')E86T@=&\@9&5A8W1I=F%T92!B969OF5D*'-T;W!296%D M375T97 at I#0H@(" @(" @(" @(" @>W-T;W!296%D(#T@=')U93M]#0H@(" @ M(" @('-Y;F-H"D-"B @(" @(" @(" @ M("![4]W;F5D M*"D@*0T*(" @(" @("![#0H@(" @(" @(" @("!3>7-T96TN;W5T+G!R:6YT M;&XH(D5R2!I;B!U2P@;&EN92 X-# L M(#@V,0T*+R\@5VEN9&]W7-T96TN;W5T+G!R:6YT;&XH(D5R2!T:&ES(&5X86UP;&4N(BD[#0H@(" @(" @(" @ M("!]#0H@(" @(" @('T@(" @( T*(" @('T-"B\O*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H@(" @+RHJ("HO#0H@(" @<'5B;&EC('-T M871I8R!C;&%SB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@16YA8FQI;F<@=V]R:R!O9B!T:&4@:6Y3 M=')E86T-"@T*(" @(" @(" @(" @('-Y;F-H71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5; M,3 R-%T[#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @ M("!TB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)@T*+R\@0VAE8VMI;F<@:68 at 86)O=70@=&\@8VQO7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@&-E<'1I;VX@ M92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPF5D*'-T;W!70T*(" @(" @(" @(" @>R @(" @(" @(" @(" @(" -"B @(" @ M(" @(" @(" @("!I;G0 at 8R ](# [#0H@(" @(" @(" @(" @(" @=VAI;&4@ M*" H(&,@/2!3>7-T96TN:6XN7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@=W)I=&EN9RXN+B(I.PT*(" @(" @ M(" @(" @(" @(" @(" @(" @8G)E86L[#0H@(" @(" @(" @(" @(" @(" @ M('T-"B @(" @(" @(" @(" @(" @(" @=&AI&-E<'1I;VX at 92 I#0H@(" @ M(" @(" @("![#0H@(" @(" @(" @(" @(" @92YP" H1$(Y M("T@<&EN(#(@8V]N;F5C=&5D('1O(#,I("!D871A('=I;&P@ T*(" @(" @("!3=')I;F<@<&]R=$YA;64@ M/2 B+V1E=B]T='E54T(P(CL-"@T*+R\@36%C#0HO+U-T3\_/S\_/S\_(CL-"@T*(" @(" @("!TPT*(" @(" @(" @(" @5-E2 at I("T at 4G5N=&EM92YG9712=6YT:6UE*"DN9G)E94UE;6]R>2 at I*2D[ M#0H@(" @(" @(" @4WES=&5M+F]U="YPPT*(" @(" @("!3>7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!O M<&5N*"DN+BXB("L@<&]R=$YA;64I.PT*(" @(" @("!T7-T96TN;W5T+G!R:6YT;&XH(E=A:71I;F7-T96TN;W5T+G!R:6YT;&XH92YT M;U-T0T*(" @(" @("![#0H@(" @(" @(" @(" @&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @92YP M&ET*# I.PT*(" @('T-"GT-"@`` ` end From nate at n4te.com Fri Nov 27 17:09:50 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:09:50 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> 2009/11/26 Ivan Maidanski : > Nate wrote: >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). Please see the attached patch for the Java changes. I didn't update the build scripts, I'm fine with just renaming the libs myself for now. After some thought, I decided since the sun.arch.data.model property is unreliable, being Sun JVM specific, so I settled on loading the 32-bit lib by default and trying the 64-bit lib if that fails. The patch also sets "devel" to false in RXTXCommDriver. I strongly believe a third party library should not be hardcoded to dump to System.out, especially when nothing is wrong. If I want to dump the rxtx version to System.out, I can write one line of code to do so (ASCII art is certainly not needed). -Nate -------------- next part -------------- A non-text attachment was scrubbed... Name: nativeLib.patch Type: application/octet-stream Size: 2700 bytes Desc: not available URL: From nate at n4te.com Fri Nov 27 17:12:24 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:12:24 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: <7d6ffee60911271612u4f3830aam295c56fe6c93e277@mail.gmail.com> On Fri, Nov 27, 2009 at 7:48 AM, Trent Jarvi wrote: > The 64/32 bit library is one issue. There is also an issue binaries that > can run on multiple archs. > > http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ > > This can be complicated by libc sources/versions ... > > At first glance, it would appear reasonable to modify the library name or > path. When I think about it, the better approach is to make sure the > libraries load in an intuitive way when installed alone for the novice and > leave the multiple arch/os support problem as an exercise for the > implementor as they will have an advanced skill set (and hopefully a nice > wiki page helping them). Ideally rxtx could be shipped with all the native libs and it would know how to pick the appropriate one. This way it can be kept up to date by the rxtx project rather than each user with this need maintain their own loading code. That said, if no one actually has this need, I don't see a problem with waiting for the first person to implement it, then absorbing it into the rxtx project. IMO, the next best thing is to at least handle the most common case, which is 32/64-bit. -Nate From ivmai at mail.ru Sat Nov 28 00:48:05 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 10:48:05 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: Hi! Nate wrote: > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> What do you think about supporting both 32 bit and 64 bit DLLs, with > >> the correct one chosen at runtime? This way I don't need two separate > >> versions of my app. > > > > I think it would be good. I think this should be implemented as follows: > > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > Please see the attached patch for the Java changes. I didn't update > the build scripts, I'm fine with just renaming the libs myself for > now. After some thought, I decided since the sun.arch.data.model > property is unreliable, being Sun JVM specific, so I settled on > loading the 32-bit lib by default and trying the 64-bit lib if that > fails. I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. > > The patch also sets "devel" to false in RXTXCommDriver. I strongly > believe a third party library should not be hardcoded to dump to > System.out, especially when nothing is wrong. If I want to dump the > rxtx version to System.out, I can write one line of code to do so > (ASCII art is certainly not needed). > > -Nate > > ATTACHMENT: application/x-patch (nativeLib.patch) From nate at n4te.com Sat Nov 28 00:55:59 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 23:55:59 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: <7d6ffee60911272355p73e526a0t5c10a7fc4d0f6663@mail.gmail.com> Hi Ivan, 2009/11/27 Ivan Maidanski : > Hi! > Nate wrote: >> 2009/11/26 Ivan Maidanski : >> > Nate wrote: >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> >> the correct one chosen at runtime? This way I don't need two separate >> >> versions of my app. >> > >> > I think it would be good. I think this should be implemented as follows: >> > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); >> > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); >> > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). >> >> Please see the attached patch for the Java changes. I didn't update >> the build scripts, I'm fine with just renaming the libs myself for >> now. After some thought, I decided since the sun.arch.data.model >> property is unreliable, being Sun JVM specific, so I settled on >> loading the 32-bit lib by default and trying the 64-bit lib if that >> fails. > > I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. I meant unreliable in that the property isn't defined by the JVM spec, so may not be available in all JVMs. This means even if it is false, 64-bit must be tried before absolute failure. > The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. Sure. Here is how I would write it, with clarity in mind: static void loadLibrary (String baseName) { if (System.getProperty("sun.arch.data.model", "").equals("64")) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ex64) { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ignored) { throw ex64; } } } else { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ex32) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ignored) { throw ex32; } } } } -Nate >> >> The patch also sets "devel" to false in RXTXCommDriver. I strongly >> believe a third party library should not be hardcoded to dump to >> System.out, especially when nothing is wrong. If I want to dump the >> rxtx version to System.out, I can write one line of code to do so >> (ASCII art is certainly not needed). >> >> -Nate >> >> ATTACHMENT: application/x-patch (nativeLib.patch) > > From ivmai at mail.ru Sat Nov 28 07:26:43 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 17:26:43 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: References: Message-ID: "M.Dec-GMail" wrote: > Hi Ivan, Trent, Steffen, Kapil and all :) > ... > A bit about works of the Ivan and Steffen from last days. > > I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good > idea when RXTXPort is used as a part of the application, but I think that > Trent should accept or not this change. > In my opinion this change does nothing in this case. > If somebody needs serial daemon should do it a level up... I never claimed setDaemon patch would solve the port close problem. It solves "not exiting" a badly-written application problem (I mean an app is returning from main() without calling close() for ports). > ... > Regards > Mariusz Dec From mariusz.dec at gmail.com Sat Nov 28 09:29:04 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 28 Nov 2009 17:29:04 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <536A5B02D18041459E65A4D1182D1374@mdam2> ----- Original Message ----- From: "Ivan Maidanski" To: "rxtx" Sent: Saturday, November 28, 2009 3:26 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > I never claimed setDaemon patch would solve the port close problem. It > solves "not exiting" a badly-written application problem (I mean an app is > returning from main() without calling close() for ports). It was general notice - not about close - but I am sorry - this is my mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. So - your proposal is good, but I have observed that RXTXPort ends work even without close, if application ends with System.exit(0). But in this case - If you will try my example without System.exit(0), program stays in memory and Netbeans says that application runs... This is the case of baddly written application - what in this case? Something is wrong in my techniuqe of subsequent opens? Variables configuration? No finalize of the RXTX port? Maybe this is it. If yes, everything should be changed and my example is workaround only - all threads disconnections should be done during close, inside RXTXPort.java.. Today I have written serial port scanner which is looking for specific external device checking all system serial ports - opening, sending query, closing (this is why I needed working close()). No memory waste, no lost threads in memory, but my application ends with System.exit(0). Workaround works... Regards Mariusz Dec >> ... >> Regards >> Mariusz Dec > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ivmai at mail.ru Sat Nov 28 09:57:33 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 19:57:33 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: <536A5B02D18041459E65A4D1182D1374@mdam2> References: <536A5B02D18041459E65A4D1182D1374@mdam2> Message-ID: "M.Dec-GMail" wrote: > ----- Original Message ----- > From: "Ivan Maidanski" > Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > > > I never claimed setDaemon patch would solve the port close problem. It > > solves "not exiting" a badly-written application problem (I mean an app is > > returning from main() without calling close() for ports). > > It was general notice - not about close - but I am sorry - this is my > mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. > So - your proposal is good, but I have observed that RXTXPort ends work even > without close, if application ends with System.exit(0). That's how exit works by the definition (contrary to returning from main(String[])). > > But in this case - If you will try my example without System.exit(0), > program stays in memory and Netbeans says that application runs... > This is the case of badly written application - what in this case? No, in my case a "badly-written application" is exiting from an app w/o closing ports - this works with the original Sun Comm API but run into a "not exiting" problem with rxtx (unless System.exit is used, of course). > Something is wrong in my technique of subsequent opens? > Variables configuration? > No finalize of the RXTX port? Maybe this is it. Finalizers are not guaranteed to be ever run. > If yes, everything should be changed and my example is workaround only - all > threads disconnections should be done during close, inside RXTXPort.java.. > > Today I have written serial port scanner which is looking for specific > external device checking all system serial ports - opening, sending query, > closing (this is why I needed working close()). > No memory waste, no lost threads in memory, but my application ends with > System.exit(0). > Workaround works... > > Regards > Mariusz Dec At present, I use System.exit(0) in my app to workaround the absence of setDaemon too. Regards, Ovan From mariusz.dec at gmail.com Sun Nov 29 01:01:28 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 09:01:28 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: Hi all, While googling for something, I have found this site: http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ There is a lot about RXTX, and sample works with Events. It differs from original RXTX samples. The only question is - why original samples doesn't work correct and there is no links to real solutions... RXTX project is great but... Regards Mariusz Dec From tjarvi at qbang.org Sun Nov 29 08:57:08 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 29 Nov 2009 08:57:08 -0700 (MST) Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: On Sun, 29 Nov 2009, M.Dec-Gazeta wrote: > Hi all, > While googling for something, I have found this site: > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. > > The only question is - why original samples doesn't work correct and there > is no links to real solutions... > RXTX project is great but... > Hi Mariusz, The rxtx project is far from perfect and needs help from users as well as developers. As you identify problems such as the original samples not doing what you need and missing links to the one you wanted, please do take a moment to edit the page another user created in hopes of helping you. Just remember that the wiki pages are almost entirely sponsored by individuals taking time to fix what bothered them. In the early stages, the concern was no examples. A positive tone is always appreciated. Posting to the mail-list is also appreciated and will make it more likely to attract a developer to sponsor a fix with their efforts. -- Trent Jarvi tjarvi at qbang.org From mariusz.dec at gmail.com Sun Nov 29 11:39:59 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 19:39:59 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <9732BACF0EFD43F3A6B0396ADF0C7811@mdam2> Hi Jarvi, > ...A positive tone is always appreciated. I am very sorry, that you have received my message as something wrong in my mind about your work in this GREAT project. I am very sorry - belive me please. I hope that my work over this close() problem, ready to use example and published later link, shows my FULL POSITIVE thinking about RXTX. Regards Mariusz Dec > > -- > Trent Jarvi > tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Mon Nov 30 04:06:03 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 12:06:03 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Hi, I could not resist to write about how to use InputStream.read(byte[]) because I think this again is an example showing it wrongly. * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. it contains: 259 private byte[] readBuffer = new byte[400]; (I better don't comment on this one here) 272 try { 273 int availableBytes = inStream.available(); 274 if (availableBytes > 0) { 275 // Read the serial port 276 inStream.read(readBuffer, 0, availableBytes); 277 278 // Print it out 279 System.out.println("Recv :" + 280 new String(readBuffer, 0, availableBytes)); 281 } 282 } catch (IOException e) { 283 } I think this is wrong: - exceptions should be ignored never (without even logging) - when code cannot handle an exception, I think it should not catch it (or catch-log-throw) - it assumes 400 bytes are the maximum a serial link can recveive in a read call, but there is no such guarantee by the API - it assumes that read will read availableBytes but there is no such guarantee by API definition - it assumes availableBytes <= readBuffer.length - The STDOUT output depends on timing details (it could happen that in one situation two Recv: lines are printed but in another arbitrary similar situation just one is printed due to different timing details I think InputStream.read(byte[]) is better to be used in a construction like this (assuming it polls based on an event as in the example): // some doReadFunc(): boolean eof = false; int chunkSize = 128; byte[] readData = new byte[0]; while(eof == false && inStream.available()) { byte[] readBuf = new byte[chunkSize]; // available() guaranteed read will not block, but // we may read more than available bytes here (in case more were // received) or less than (if read returns earlier, which is // allowed by spec) - but at least 1. int thisRead = inStream.read(readBuffer, 0, readBuf.length); if (thisRead == -1) { // Please note that we cannot throw here // if (readData.length() > 0), // because caller would not see the contents of readData. // But we could throw in case readData is empty. eof = true; } else { // Now we need a "readData += readBuffer;". // Don't know if this really is so uncomfortable on Java or if I // just don't know how to do it better. This commonly should be // in some appendBuffer helper function (doing realloc + 2copy) byte[]tmpBuf = new byte[readData.length + thisRead]; // assert(readData.length + thisRead == totalRead); System.arraycopy(readData, 0, tmpBuf, 0, readData.length); System.arraycopy(readBuf, 0, tmpBuf, readData.length, thisRead); readData = tmpBuf; } } // readData contains the data that could be read. It could be empty/zero // in case no bytes available(), but it blocks never. It could be that exactly at the time when inStream.available() returned zero a new byte arrives, so typically someone will need to have a message parsing loop around (or integrated) - usually it is easier to try to read what is needed and timeout otherwise (in contrast to read what is avialable and then guess if could be complete by timing). Simple example could be: // has methods "boolean isComplete()" and "int bytesNeeded()". BinaryMessage message; while(!message.isComplete() && !timer.isExpired() ) { // doRead(InputStream, int len) which does NOT BLOCK but return zero // in case there is no data avialable() byte[] readData = doRead(input, message.bytesNeeded()); // we should not poll. With Java InputStream it is hard to handle, // because avialable() has no timeout parameter. We can use small // delays to convert this spinlock to a 20 ms poll which works when // having a few connections only but wastes resources. Better would // be to synchronize with some events such as // SerialPortEvent.DATA_AVAILABLE, but this makes this code depend // on SerialPort (otherwise, it would work on ANY InputStream which // IMHO should be the reason why InputStream exists, but this is // off-topic here) } if (timer.isExpired()) { // handle timeout } // else assert(message.isComplete()); Exceptions could be handled in a way like: String portName = "/dev/ttyS0"; // pseudo code: SerialPort port = SerialPort.open(portName); try { try { thisRead = port.is.read(); if (thisRead == -1) { if (readData.length == 0) { throw new ConnectionClosedByPeerException(); } } } catch {IOException ioex) { CommException ex = new CommIOException(ioex); ex.appendInfo("while reading"); } } catch (CommException ex) { // Instead of the read call above probably we call a method working // on InputStream. This function cannot know the portName, but for // the user this is very important. Because of this we add the // information. We do this on each level/layer: our caller appends // why the port were read (e.g. "while initilizing modem" or // "quering thermometer sensor") and so on. The user then can get a // message like // unexpected DCD drop (carrier lost) while reading /dev/ttyS0 for // Modem communication while sending file UPLOAD.DAT for module // DataReconciliation triggered by Cron Call "Daily Reconciliation" // by application "My Monitor". // much better than "IOException in IO.java:1234"! // They are intended to include ANY information needed to resolve the // issue (without needing complete logs maybe even with // version-dependent stack dumps, which would be horrible). CommException ex = new CommIOException(ioex); ex.appendInfo(" on port " + portName); } Comments, corrections and critics are appreciated! oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 04:50:40 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 12:50:40 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Message-ID: <17E538BC24EE42EC89F5BB086205F581@mdam2> ----- Original Message ----- From: "Steffen DETTMER" To: "rxtx" Sent: Monday, November 30, 2009 12:06 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > Hi, > > I could not resist to write about how to use InputStream.read(byte[]) > because I think this again is an example showing it wrongly. > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: >> http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ >> >> There is a lot about RXTX, and sample works with Events. >> It differs from original RXTX samples. > I didn't checked this sample befor posting, and I did missusage of the word "works". Sorry, should be "sample prepared for Events". Yesterday afteroon I have checked this technique in XP only, but I have had problems and have switched to other tasks. Steffen, please attach your new complete example to be sure no errors while changing and please let me know in which platform you have tested it. I will check it on my systems. Maybe this is a platform problem? Why I think so: My sample works in Windows and Linux, but in real application I have detected problem with Linux. In old systems we have had hard list of the serial ports, but now user may connect and disconnect USB-Serial dongle while application is running. Effects are clear... We (developers) have to be ready to serve it. And therefore I have an configuration form where user may check device, find it automatically or declare manually COM (dev/tty...) device. Before each auto-looking for my specific device I have (I should) to re-read available ports (I have the button to manually refresh list of the ports as well). In XP and Vista it works very good. No one crash in 5 hours when I was doing that!!! But in Linux (newest Ubuntu) there is a problem. Doing an enumeration of the devices when RXTX driver was previousluy used, places new instance of the RXTXDriver in the memory: CommPortIdentifier.java, line 327. When this action occurs, IOLocked stays 2, previously used device is not visible even if was correctly closed! Application hangs, but I don't know yet where - earlier it was read loop. Now I have to do some other things, later I will go back to problem. Regards Mariusz From oliverhoffmann32 at googlemail.com Mon Nov 30 08:07:31 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 16:07:31 +0100 Subject: [Rxtx] RXTX for ttyACM0 Message-ID: <200911301607.31300.oliverhoffmann32@googlemail.com> Hi RXTX Crew! I'm currently writing a small application which uses RXTX to communicate with an USB device: ... usb 1-10: new full speed USB device using ohci_hcd and address 3 usb 1-10: configuration #1 chosen from 1 choice cdc_acm 1-10:1.0: This device cannot do calls on its own. It is not a modem. cdc_acm 1-10:1.0: ttyACM0: USB ACM device usbcore: registered new interface driver cdc_acm cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters ... If I use cutecom I can open a connection to /dev/ttyACM0 without any problems, but CommPortIdentifier.getPortIdentifiers() from RXTX only lists some ttyS[0-9] devices. The only way I found is symlinking ttyACM0 to for example ttyS3, so i wonder if there's any better way (like if the user doesn't have write-access to /dev). Greatings, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 08:35:56 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:35:56 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <200911301607.31300.oliverhoffmann32@googlemail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> Message-ID: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> 2009/11/30 Oliver Hoffmann > Hi RXTX Crew! > > I'm currently writing a small application which uses RXTX to communicate > with > an USB device: > ... > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > wonder > if there's any better way (like if the user doesn't have write-access to > /dev). > To avoid this naming problem between systems and implementations of the USB-RS naming conventions I did it what you may see below. You may identify system elsewhere (isMac, isWindows, isLinux) and read appriorate prefixes from an INI file etc. So user may change their prefixes without changing application! Note that you have to look for ALL system ports, not serial only and do filtering yourself. In RXTXCommDriver.java you may change port candidates porefixes if you would like to change sources of the RXTX. If not - my example works fine. Regards Mariusz Dec /* * * @author Mariusz Dec * September 2009 */ import gnu.io.CommPortIdentifier; import java.util.Enumeration; import javax.swing.DefaultListModel; public class CommPortLister { public static String comPortsWindows = "COM"; public static String comPortsMacintosh1 = "/dev/tty"; public static String comPortsMacintosh2 = "/dev/cu"; public static String comPortsLinux1 = "/dev/usb/tty"; public static String comPortsLinux2 = "/dev/tty"; public DefaultListModel listCom() { Enumeration ports = CommPortIdentifier.getPortIdentifiers(); DefaultListModel pList = null; String pName = ""; String pStart1 = ""; String pStart2 = ""; pList = new DefaultListModel(); while(ports.hasMoreElements()) { pName = ((CommPortIdentifier)ports.nextElement()).getName(); if (isWindows) { pStart1 = comPortsWindows; pStart2 = "------"; } else if (isMac) { pStart1 = comPortsMacintosh1; pStart2 = comPortsMacintosh2; } else if (isLinux) { pStart1 = comPortsLinux1; pStart2 = comPortsLinux2; } if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) { pList.addElement(pName); } } return pList; } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Nov 30 08:40:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 16:40:13 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <17E538BC24EE42EC89F5BB086205F581@mdam2> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> Message-ID: <20091130154013.GL20226@elberon.bln.de.ingenico.com> * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100: > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > > > > > There is a lot about RXTX, and sample works with Events. > > > It differs from original RXTX samples. > > I didn't checked this sample befor posting, and I did missusage of the word > "works". Sorry, should be "sample prepared for Events". no problem. I did neither intend to critice you nor the example; I did not even read what it demonstrates (I think it is not an example how to use read in best way). Maybe I just wanted to start an example :) Also I think that this example will work (ie. print something) in most cases! I'm just afraid people could start some prototype of their apps based on it, then improve here and there and finally have some server application with rare strange failures. > Steffen, please attach your new complete example to be sure no > errors while changing and please let me know in which platform > you have tested it. I will check it on my systems. You ask me to write a complete compiling example? mmm... maybe I could take some time this week to do so, but first I would like to ensure that it is correct. We had discussions about it in the past and there were many details to consider; easy to fall in a trap. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 08:59:47 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:59:47 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <20091130154013.GL20226@elberon.bln.de.ingenico.com> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> <20091130154013.GL20226@elberon.bln.de.ingenico.com> Message-ID: <73a89f360911300759l63335522sb16bc254a4d0ebb2@mail.gmail.com> 2009/11/30 Steffen DETTMER > * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100:> you have tested > it. I will check it on my systems. > > You ask me to write a complete compiling example? > Yes, if you did it.. BTW: I have analysed your mail and In the meantime I have solved problem in my application on Linux It was a mistake while copying sources between machines... hrrrr.. Returning to your work - like in each realtime and/or physical interfaces, timing may generate problems, especially with USB. Few months ago I have seen time critical application transferred to USB-RS232 dongle. Crazy results... USB is polling data, no interrupts... My new experience: My desktop XP is very fast, Vista and Ubuntu are on slower notebook. For Vista and Win RXTX.dll computer speed is enough but for Linux I have observed that rereshing ports list in the program sequence: disonnect(curPort); porstList = refreshPortsList(); returns portsList WITHOUT curPort... It means that curPort returns on the available ports list in system with delay after close(). This is not big problem, but a bit frustrating - I do not like to add delays everywhere... Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliverhoffmann32 at googlemail.com Mon Nov 30 09:10:15 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 17:10:15 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> Message-ID: <200911301710.16126.oliverhoffmann32@googlemail.com> On Monday 30 November 2009 16:35:56 Mariusz Dec wrote: > 2009/11/30 Oliver Hoffmann > > > Hi RXTX Crew! > > > > I'm currently writing a small application which uses RXTX to communicate > > with > > an USB device: > > ... > > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > > wonder > > if there's any better way (like if the user doesn't have write-access to > > /dev). > > To avoid this naming problem between systems and implementations of the > USB-RS naming conventions I did it what you may see below. > You may identify system elsewhere (isMac, isWindows, isLinux) and read > appriorate prefixes from an INI file etc. > So user may change their prefixes without changing application! > > Note that you have to look for ALL system ports, not serial only and do > filtering yourself. > > In RXTXCommDriver.java you may change port candidates porefixes if you > would like to change sources of the RXTX. > If not - my example works fine. > > Regards > Mariusz Dec > > /* > * > * @author Mariusz Dec > * September 2009 > */ > > import gnu.io.CommPortIdentifier; > > import java.util.Enumeration; > import javax.swing.DefaultListModel; > > public class CommPortLister { > > public static String comPortsWindows = "COM"; > public static String comPortsMacintosh1 = "/dev/tty"; > public static String comPortsMacintosh2 = "/dev/cu"; > public static String comPortsLinux1 = "/dev/usb/tty"; > public static String comPortsLinux2 = "/dev/tty"; > > > public DefaultListModel listCom() { > Enumeration ports = CommPortIdentifier.getPortIdentifiers(); > DefaultListModel pList = null; > String pName = ""; > String pStart1 = ""; > String pStart2 = ""; > pList = new DefaultListModel(); > while(ports.hasMoreElements()) > { > pName = ((CommPortIdentifier)ports.nextElement()).getName(); > > if (isWindows) > { > pStart1 = comPortsWindows; > pStart2 = "------"; > } > else > if (isMac) > { > pStart1 = comPortsMacintosh1; > pStart2 = comPortsMacintosh2; > } > else > if (isLinux) > { > pStart1 = comPortsLinux1; > pStart2 = comPortsLinux2; > } > > if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) > { > pList.addElement(pName); > } > } > return pList; > } > } > This wouldn't work because the list of CommPortIdentifier.getPortIdentifiers() is already filtered, so I would have to change the "CandidatePortPrefixes" list in RXTXCommDriver as you said. But after looking through the sourcecode I found that setting gnu.io.rxtx.SerialPorts to "/dev/ttyACM0" solved the problem. Sure it's not the nicest way but at leats it works. Maybe adding "ttyACM" to the list in RXTXCommDriver.java:521 is a more permanent solution. Regards, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 10:57:04 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 18:57:04 +0100 Subject: [Rxtx] RXTX for ttyACM0 References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> <200911301710.16126.oliverhoffmann32@googlemail.com> Message-ID: <09AC73AA7B22418BBCD1297A2D85A033@mdam2> > > This wouldn't work because the list of > CommPortIdentifier.getPortIdentifiers() > is already filtered, so I would have to change the > "CandidatePortPrefixes" list > in RXTXCommDriver as you said. It works in Windows from several months...., sorry Mariusz From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From nate at n4te.com Thu Nov 26 14:32:21 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 13:32:21 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Ah, thanks Ivan. What do you think about supporting both 32 bit and 64 bit DLLs, with the correct one chosen at runtime? This way I don't need two separate versions of my app. -Nate 2009/11/26 Ivan Maidanski : > Nate wrote: >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >> I see a user has come up with a workaround for 64 bit OS X. Has anyone >> done this for Windows? Are there plans to support 64 bit Windows? > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > >> >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >> Other open source projects such as LWJGL (http://lwjgl.org/) include >> both 32 and 64 bit native libs and the correct lib is automatically >> used. >> >> -Nate > > From ivmai at mail.ru Thu Nov 26 14:52:53 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Fri, 27 Nov 2009 00:52:53 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan From Kapil_Gupta at hcl.in Thu Nov 26 22:47:13 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 27 Nov 2009 11:17:13 +0530 Subject: [Rxtx] Rxtx Digest, Vol 27, Issue 7 In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960FDD2F38A@NDA-HCLT-EVS05.HCLT. CORP.HCL.IN-F0913EFA-B2A5-28E5-3684-11AABE813CF9> Hi, I am also facing the same issue as Mariusz is facing, I am facing it on Intel Mac 10.5.8. I am using RXTX 2.2 Pre binaries. First time I am able to read the data from my device, but second time port open hangs (RXTXPort.java). I am using TI chip set in my device. I created a C sample to test the driver but that works perfectly to read device any number of times. No hangs !! Note: My sample works fine on Windows XP. Please help. Thanks, Kapil -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Thursday, November 26, 2009 6:50 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 27, Issue 7 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! (M.Dec-GMail) 2. Re: Patch adding monThread setDaemon (Steffen DETTMER) 3. Re: Patch adding monThread setDaemon (Ivan Maidanski) 4. Patch for WinCE readArray (Ivan Maidanski) 5. Re: Patch adding monThread setDaemon (Ivan Maidanski) 6. Re: SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! (Ivan Maidanski) 7. Re: Patch adding monThread setDaemon (Trent Jarvi) 8. 64 bit (Nate) 9. Re: 64 bit (Ivan Maidanski) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Nov 2009 20:23:54 +0100 From: "M.Dec-GMail" To: Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2 at mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end ------------------------------ Message: 2 Date: Mon, 23 Nov 2009 22:26:36 +0100 From: "Steffen DETTMER" To: "rxtx" Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset="utf-8" > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail ------------------------------ Message: 3 Date: Tue, 24 Nov 2009 10:36:34 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 4 Date: Tue, 24 Nov 2009 22:26:00 +0300 From: Ivan Maidanski To: rxtx Subject: [Rxtx] Patch for WinCE readArray Message-ID: Content-Type: text/plain; charset="koi8-r" Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: ------------------------------ Message: 5 Date: Tue, 24 Nov 2009 22:33:41 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 6 Date: Tue, 24 Nov 2009 22:38:40 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! Message-ID: Content-Type: text/plain; charset=koi8-r Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) ------------------------------ Message: 7 Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) From: Trent Jarvi To: Ivan Maidanski Cc: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------ Message: 8 Date: Thu, 26 Nov 2009 05:08:27 -0800 From: Nate To: rxtx at qbang.org Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate ------------------------------ Message: 9 Date: Thu, 26 Nov 2009 16:24:21 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] 64 bit Message-ID: Content-Type: text/plain; charset=koi8-r Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate ------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx End of Rxtx Digest, Vol 27, Issue 7 *********************************** DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From m.kirkland at comcast.net Fri Nov 27 01:56:33 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 27 Nov 2009 00:56:33 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Or you could try the following utility which will modify the native library search path at run time based on the os.name and os.arch system properties. http://hamware.info/tools/LibLoader.zip Read the comments in the code and the properties file for details. Mike -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Ivan Maidanski Sent: Thursday, November 26, 2009 1:53 PM To: rxtx Subject: Re: [Rxtx] 64 bit Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri Nov 27 08:48:41 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 27 Nov 2009 08:48:41 -0700 (MST) Subject: [Rxtx] 64 bit In-Reply-To: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: I've used the native library search path to solve the problem in the past. The 64/32 bit library is one issue. There is also an issue binaries that can run on multiple archs. http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ This can be complicated by libc sources/versions ... At first glance, it would appear reasonable to modify the library name or path. When I think about it, the better approach is to make sure the libraries load in an intuitive way when installed alone for the novice and leave the multiple arch/os support problem as an exercise for the implementor as they will have an advanced skill set (and hopefully a nice wiki page helping them). On Fri, 27 Nov 2009, Mike Kirkland wrote: > Or you could try the following utility which will modify the native library > search path at run time based on the os.name and os.arch system properties. > > http://hamware.info/tools/LibLoader.zip > > Read the comments in the code and the properties file for details. > > Mike > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Ivan Maidanski > Sent: Thursday, November 26, 2009 1:53 PM > To: rxtx > Subject: Re: [Rxtx] 64 bit > > Hi! > Nate wrote: >> Ah, thanks Ivan. >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String > basename) which if sun.arch.data.model property is defined and equals "64" > then first tries to load basename+"64" library otherwize (if not 64 or > failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with > RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" > for 64-bit targets (optionally, if needed). > >> >> -Nate >> >> >> 2009/11/26 Ivan Maidanski : >>> Nate wrote: >>>> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >>>> I see a user has come up with a workaround for 64 bit OS X. Has anyone >>>> done this for Windows? Are there plans to support 64 bit Windows? >>> >>> rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily > rebuild it from the sources using e.g. mingw-w64.) >>> >>>> >>>> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >>>> Other open source projects such as LWJGL (http://lwjgl.org/) include >>>> both 32 and 64 bit native libs and the correct lib is automatically >>>> used. > > Best regards, > Ivan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Fri Nov 27 13:55:55 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Fri, 27 Nov 2009 21:55:55 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved Message-ID: Hi Ivan, Trent, Steffen, Kapil and all :) I have found a method how to close() and reopen RXTX serial port without problems. This is done on the rxtx-2.2pre2 version, but I think that it should work on earlier versions as well. I have tested it on Windows XP, Vista and Linux, Ubuntu distribution. On Windows XP it works on native UART and VCP, on Vista and Ubuntu I haven't native UART, so I have tested it with USB-RS232 VCP from FTDI. There is NO code changes in Java and C, this is only better external service of the processes between Java threads and native interface. I have found it looking in the code and tracing Java in Netbeans 6.7.1. using printouts from C part - #define TRENT_IS_HERE :) Attached file - TwoWaySerialCommMd.java is derived from the original TwoWaySerialComm.java but works a bit better :). Important comments are inside the file. I hope Kapil answers what about Macintosh but it should looks like in Linux. A bit about works of the Ivan and Steffen form last days. I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good idea when RXTXPort is used as a part of the application, but I think that Trent should accept or not this change. In my opinion this change does nothing in this case. If somebody needs serial daemon should do it a level up... Especially to Trent: 1. I have read a lot about synchronisation and in my opinion monThreadMutex in RXTXPort.java should be declared as final, the same with Sync in CommPortIdentifier. 2. Please check this example and, if this is good, add it to official examples of the RXTX. ABOUT EVENTS In my application I have checked events as well, but they works to slow for me - to big delay - I don't know why. Finally, I have decided to generate my own Exception when data from inStream is collected and proper parsed (I need packs of bytes). Exception transfers data to rest of the application. The only disadvantage is ASCII model of the data which may be transferred through Exception, but for me its enough. Therefore I don't know what to do with SerialEvent of the RXTX - I have found questions about the same problem with close() while using Events. Maybe somebody wiil solve this problem using my job. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M+R\F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8-"B\O)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F#0HO+R!(;W<@=&\@=7-E(%)8 M5%A397)I86Q0;W)T#0HO+R!">2!-87)I=7-Z($1E8RP at 4&]L86YD#0HO+R!. M;W9E;6)E5-EB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@<')E<&%R:6YG(&EN4W1R96%M(&%N9"!O M=713=')E86T@=&\@9&5A8W1I=F%T92!B969OF5D*'-T;W!296%D M375T97 at I#0H@(" @(" @(" @(" @>W-T;W!296%D(#T@=')U93M]#0H@(" @ M(" @('-Y;F-H"D-"B @(" @(" @(" @ M("![4]W;F5D M*"D@*0T*(" @(" @("![#0H@(" @(" @(" @("!3>7-T96TN;W5T+G!R:6YT M;&XH(D5R2!I;B!U2P@;&EN92 X-# L M(#@V,0T*+R\@5VEN9&]W7-T96TN;W5T+G!R:6YT;&XH(D5R2!T:&ES(&5X86UP;&4N(BD[#0H@(" @(" @(" @ M("!]#0H@(" @(" @('T@(" @( T*(" @('T-"B\O*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H@(" @+RHJ("HO#0H@(" @<'5B;&EC('-T M871I8R!C;&%SB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@16YA8FQI;F<@=V]R:R!O9B!T:&4@:6Y3 M=')E86T-"@T*(" @(" @(" @(" @('-Y;F-H71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5; M,3 R-%T[#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @ M("!TB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)@T*+R\@0VAE8VMI;F<@:68 at 86)O=70@=&\@8VQO7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@&-E<'1I;VX@ M92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPF5D*'-T;W!70T*(" @(" @(" @(" @>R @(" @(" @(" @(" @(" -"B @(" @ M(" @(" @(" @("!I;G0 at 8R ](# [#0H@(" @(" @(" @(" @(" @=VAI;&4@ M*" H(&,@/2!3>7-T96TN:6XN7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@=W)I=&EN9RXN+B(I.PT*(" @(" @ M(" @(" @(" @(" @(" @(" @8G)E86L[#0H@(" @(" @(" @(" @(" @(" @ M('T-"B @(" @(" @(" @(" @(" @(" @=&AI&-E<'1I;VX at 92 I#0H@(" @ M(" @(" @("![#0H@(" @(" @(" @(" @(" @92YP" H1$(Y M("T@<&EN(#(@8V]N;F5C=&5D('1O(#,I("!D871A('=I;&P@ T*(" @(" @("!3=')I;F<@<&]R=$YA;64@ M/2 B+V1E=B]T='E54T(P(CL-"@T*+R\@36%C#0HO+U-T3\_/S\_/S\_(CL-"@T*(" @(" @("!TPT*(" @(" @(" @(" @5-E2 at I("T at 4G5N=&EM92YG9712=6YT:6UE*"DN9G)E94UE;6]R>2 at I*2D[ M#0H@(" @(" @(" @4WES=&5M+F]U="YPPT*(" @(" @("!3>7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!O M<&5N*"DN+BXB("L@<&]R=$YA;64I.PT*(" @(" @("!T7-T96TN;W5T+G!R:6YT;&XH(E=A:71I;F7-T96TN;W5T+G!R:6YT;&XH92YT M;U-T0T*(" @(" @("![#0H@(" @(" @(" @(" @&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @92YP M&ET*# I.PT*(" @('T-"GT-"@`` ` end From nate at n4te.com Fri Nov 27 17:09:50 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:09:50 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> 2009/11/26 Ivan Maidanski : > Nate wrote: >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). Please see the attached patch for the Java changes. I didn't update the build scripts, I'm fine with just renaming the libs myself for now. After some thought, I decided since the sun.arch.data.model property is unreliable, being Sun JVM specific, so I settled on loading the 32-bit lib by default and trying the 64-bit lib if that fails. The patch also sets "devel" to false in RXTXCommDriver. I strongly believe a third party library should not be hardcoded to dump to System.out, especially when nothing is wrong. If I want to dump the rxtx version to System.out, I can write one line of code to do so (ASCII art is certainly not needed). -Nate -------------- next part -------------- A non-text attachment was scrubbed... Name: nativeLib.patch Type: application/octet-stream Size: 2700 bytes Desc: not available URL: From nate at n4te.com Fri Nov 27 17:12:24 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:12:24 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: <7d6ffee60911271612u4f3830aam295c56fe6c93e277@mail.gmail.com> On Fri, Nov 27, 2009 at 7:48 AM, Trent Jarvi wrote: > The 64/32 bit library is one issue. There is also an issue binaries that > can run on multiple archs. > > http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ > > This can be complicated by libc sources/versions ... > > At first glance, it would appear reasonable to modify the library name or > path. When I think about it, the better approach is to make sure the > libraries load in an intuitive way when installed alone for the novice and > leave the multiple arch/os support problem as an exercise for the > implementor as they will have an advanced skill set (and hopefully a nice > wiki page helping them). Ideally rxtx could be shipped with all the native libs and it would know how to pick the appropriate one. This way it can be kept up to date by the rxtx project rather than each user with this need maintain their own loading code. That said, if no one actually has this need, I don't see a problem with waiting for the first person to implement it, then absorbing it into the rxtx project. IMO, the next best thing is to at least handle the most common case, which is 32/64-bit. -Nate From ivmai at mail.ru Sat Nov 28 00:48:05 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 10:48:05 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: Hi! Nate wrote: > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> What do you think about supporting both 32 bit and 64 bit DLLs, with > >> the correct one chosen at runtime? This way I don't need two separate > >> versions of my app. > > > > I think it would be good. I think this should be implemented as follows: > > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > Please see the attached patch for the Java changes. I didn't update > the build scripts, I'm fine with just renaming the libs myself for > now. After some thought, I decided since the sun.arch.data.model > property is unreliable, being Sun JVM specific, so I settled on > loading the 32-bit lib by default and trying the 64-bit lib if that > fails. I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. > > The patch also sets "devel" to false in RXTXCommDriver. I strongly > believe a third party library should not be hardcoded to dump to > System.out, especially when nothing is wrong. If I want to dump the > rxtx version to System.out, I can write one line of code to do so > (ASCII art is certainly not needed). > > -Nate > > ATTACHMENT: application/x-patch (nativeLib.patch) From nate at n4te.com Sat Nov 28 00:55:59 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 23:55:59 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: <7d6ffee60911272355p73e526a0t5c10a7fc4d0f6663@mail.gmail.com> Hi Ivan, 2009/11/27 Ivan Maidanski : > Hi! > Nate wrote: >> 2009/11/26 Ivan Maidanski : >> > Nate wrote: >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> >> the correct one chosen at runtime? This way I don't need two separate >> >> versions of my app. >> > >> > I think it would be good. I think this should be implemented as follows: >> > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); >> > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); >> > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). >> >> Please see the attached patch for the Java changes. I didn't update >> the build scripts, I'm fine with just renaming the libs myself for >> now. After some thought, I decided since the sun.arch.data.model >> property is unreliable, being Sun JVM specific, so I settled on >> loading the 32-bit lib by default and trying the 64-bit lib if that >> fails. > > I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. I meant unreliable in that the property isn't defined by the JVM spec, so may not be available in all JVMs. This means even if it is false, 64-bit must be tried before absolute failure. > The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. Sure. Here is how I would write it, with clarity in mind: static void loadLibrary (String baseName) { if (System.getProperty("sun.arch.data.model", "").equals("64")) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ex64) { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ignored) { throw ex64; } } } else { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ex32) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ignored) { throw ex32; } } } } -Nate >> >> The patch also sets "devel" to false in RXTXCommDriver. I strongly >> believe a third party library should not be hardcoded to dump to >> System.out, especially when nothing is wrong. If I want to dump the >> rxtx version to System.out, I can write one line of code to do so >> (ASCII art is certainly not needed). >> >> -Nate >> >> ATTACHMENT: application/x-patch (nativeLib.patch) > > From ivmai at mail.ru Sat Nov 28 07:26:43 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 17:26:43 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: References: Message-ID: "M.Dec-GMail" wrote: > Hi Ivan, Trent, Steffen, Kapil and all :) > ... > A bit about works of the Ivan and Steffen from last days. > > I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good > idea when RXTXPort is used as a part of the application, but I think that > Trent should accept or not this change. > In my opinion this change does nothing in this case. > If somebody needs serial daemon should do it a level up... I never claimed setDaemon patch would solve the port close problem. It solves "not exiting" a badly-written application problem (I mean an app is returning from main() without calling close() for ports). > ... > Regards > Mariusz Dec From mariusz.dec at gmail.com Sat Nov 28 09:29:04 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 28 Nov 2009 17:29:04 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <536A5B02D18041459E65A4D1182D1374@mdam2> ----- Original Message ----- From: "Ivan Maidanski" To: "rxtx" Sent: Saturday, November 28, 2009 3:26 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > I never claimed setDaemon patch would solve the port close problem. It > solves "not exiting" a badly-written application problem (I mean an app is > returning from main() without calling close() for ports). It was general notice - not about close - but I am sorry - this is my mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. So - your proposal is good, but I have observed that RXTXPort ends work even without close, if application ends with System.exit(0). But in this case - If you will try my example without System.exit(0), program stays in memory and Netbeans says that application runs... This is the case of baddly written application - what in this case? Something is wrong in my techniuqe of subsequent opens? Variables configuration? No finalize of the RXTX port? Maybe this is it. If yes, everything should be changed and my example is workaround only - all threads disconnections should be done during close, inside RXTXPort.java.. Today I have written serial port scanner which is looking for specific external device checking all system serial ports - opening, sending query, closing (this is why I needed working close()). No memory waste, no lost threads in memory, but my application ends with System.exit(0). Workaround works... Regards Mariusz Dec >> ... >> Regards >> Mariusz Dec > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ivmai at mail.ru Sat Nov 28 09:57:33 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 19:57:33 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: <536A5B02D18041459E65A4D1182D1374@mdam2> References: <536A5B02D18041459E65A4D1182D1374@mdam2> Message-ID: "M.Dec-GMail" wrote: > ----- Original Message ----- > From: "Ivan Maidanski" > Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > > > I never claimed setDaemon patch would solve the port close problem. It > > solves "not exiting" a badly-written application problem (I mean an app is > > returning from main() without calling close() for ports). > > It was general notice - not about close - but I am sorry - this is my > mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. > So - your proposal is good, but I have observed that RXTXPort ends work even > without close, if application ends with System.exit(0). That's how exit works by the definition (contrary to returning from main(String[])). > > But in this case - If you will try my example without System.exit(0), > program stays in memory and Netbeans says that application runs... > This is the case of badly written application - what in this case? No, in my case a "badly-written application" is exiting from an app w/o closing ports - this works with the original Sun Comm API but run into a "not exiting" problem with rxtx (unless System.exit is used, of course). > Something is wrong in my technique of subsequent opens? > Variables configuration? > No finalize of the RXTX port? Maybe this is it. Finalizers are not guaranteed to be ever run. > If yes, everything should be changed and my example is workaround only - all > threads disconnections should be done during close, inside RXTXPort.java.. > > Today I have written serial port scanner which is looking for specific > external device checking all system serial ports - opening, sending query, > closing (this is why I needed working close()). > No memory waste, no lost threads in memory, but my application ends with > System.exit(0). > Workaround works... > > Regards > Mariusz Dec At present, I use System.exit(0) in my app to workaround the absence of setDaemon too. Regards, Ovan From mariusz.dec at gmail.com Sun Nov 29 01:01:28 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 09:01:28 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: Hi all, While googling for something, I have found this site: http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ There is a lot about RXTX, and sample works with Events. It differs from original RXTX samples. The only question is - why original samples doesn't work correct and there is no links to real solutions... RXTX project is great but... Regards Mariusz Dec From tjarvi at qbang.org Sun Nov 29 08:57:08 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 29 Nov 2009 08:57:08 -0700 (MST) Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: On Sun, 29 Nov 2009, M.Dec-Gazeta wrote: > Hi all, > While googling for something, I have found this site: > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. > > The only question is - why original samples doesn't work correct and there > is no links to real solutions... > RXTX project is great but... > Hi Mariusz, The rxtx project is far from perfect and needs help from users as well as developers. As you identify problems such as the original samples not doing what you need and missing links to the one you wanted, please do take a moment to edit the page another user created in hopes of helping you. Just remember that the wiki pages are almost entirely sponsored by individuals taking time to fix what bothered them. In the early stages, the concern was no examples. A positive tone is always appreciated. Posting to the mail-list is also appreciated and will make it more likely to attract a developer to sponsor a fix with their efforts. -- Trent Jarvi tjarvi at qbang.org From mariusz.dec at gmail.com Sun Nov 29 11:39:59 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 19:39:59 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <9732BACF0EFD43F3A6B0396ADF0C7811@mdam2> Hi Jarvi, > ...A positive tone is always appreciated. I am very sorry, that you have received my message as something wrong in my mind about your work in this GREAT project. I am very sorry - belive me please. I hope that my work over this close() problem, ready to use example and published later link, shows my FULL POSITIVE thinking about RXTX. Regards Mariusz Dec > > -- > Trent Jarvi > tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Mon Nov 30 04:06:03 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 12:06:03 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Hi, I could not resist to write about how to use InputStream.read(byte[]) because I think this again is an example showing it wrongly. * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. it contains: 259 private byte[] readBuffer = new byte[400]; (I better don't comment on this one here) 272 try { 273 int availableBytes = inStream.available(); 274 if (availableBytes > 0) { 275 // Read the serial port 276 inStream.read(readBuffer, 0, availableBytes); 277 278 // Print it out 279 System.out.println("Recv :" + 280 new String(readBuffer, 0, availableBytes)); 281 } 282 } catch (IOException e) { 283 } I think this is wrong: - exceptions should be ignored never (without even logging) - when code cannot handle an exception, I think it should not catch it (or catch-log-throw) - it assumes 400 bytes are the maximum a serial link can recveive in a read call, but there is no such guarantee by the API - it assumes that read will read availableBytes but there is no such guarantee by API definition - it assumes availableBytes <= readBuffer.length - The STDOUT output depends on timing details (it could happen that in one situation two Recv: lines are printed but in another arbitrary similar situation just one is printed due to different timing details I think InputStream.read(byte[]) is better to be used in a construction like this (assuming it polls based on an event as in the example): // some doReadFunc(): boolean eof = false; int chunkSize = 128; byte[] readData = new byte[0]; while(eof == false && inStream.available()) { byte[] readBuf = new byte[chunkSize]; // available() guaranteed read will not block, but // we may read more than available bytes here (in case more were // received) or less than (if read returns earlier, which is // allowed by spec) - but at least 1. int thisRead = inStream.read(readBuffer, 0, readBuf.length); if (thisRead == -1) { // Please note that we cannot throw here // if (readData.length() > 0), // because caller would not see the contents of readData. // But we could throw in case readData is empty. eof = true; } else { // Now we need a "readData += readBuffer;". // Don't know if this really is so uncomfortable on Java or if I // just don't know how to do it better. This commonly should be // in some appendBuffer helper function (doing realloc + 2copy) byte[]tmpBuf = new byte[readData.length + thisRead]; // assert(readData.length + thisRead == totalRead); System.arraycopy(readData, 0, tmpBuf, 0, readData.length); System.arraycopy(readBuf, 0, tmpBuf, readData.length, thisRead); readData = tmpBuf; } } // readData contains the data that could be read. It could be empty/zero // in case no bytes available(), but it blocks never. It could be that exactly at the time when inStream.available() returned zero a new byte arrives, so typically someone will need to have a message parsing loop around (or integrated) - usually it is easier to try to read what is needed and timeout otherwise (in contrast to read what is avialable and then guess if could be complete by timing). Simple example could be: // has methods "boolean isComplete()" and "int bytesNeeded()". BinaryMessage message; while(!message.isComplete() && !timer.isExpired() ) { // doRead(InputStream, int len) which does NOT BLOCK but return zero // in case there is no data avialable() byte[] readData = doRead(input, message.bytesNeeded()); // we should not poll. With Java InputStream it is hard to handle, // because avialable() has no timeout parameter. We can use small // delays to convert this spinlock to a 20 ms poll which works when // having a few connections only but wastes resources. Better would // be to synchronize with some events such as // SerialPortEvent.DATA_AVAILABLE, but this makes this code depend // on SerialPort (otherwise, it would work on ANY InputStream which // IMHO should be the reason why InputStream exists, but this is // off-topic here) } if (timer.isExpired()) { // handle timeout } // else assert(message.isComplete()); Exceptions could be handled in a way like: String portName = "/dev/ttyS0"; // pseudo code: SerialPort port = SerialPort.open(portName); try { try { thisRead = port.is.read(); if (thisRead == -1) { if (readData.length == 0) { throw new ConnectionClosedByPeerException(); } } } catch {IOException ioex) { CommException ex = new CommIOException(ioex); ex.appendInfo("while reading"); } } catch (CommException ex) { // Instead of the read call above probably we call a method working // on InputStream. This function cannot know the portName, but for // the user this is very important. Because of this we add the // information. We do this on each level/layer: our caller appends // why the port were read (e.g. "while initilizing modem" or // "quering thermometer sensor") and so on. The user then can get a // message like // unexpected DCD drop (carrier lost) while reading /dev/ttyS0 for // Modem communication while sending file UPLOAD.DAT for module // DataReconciliation triggered by Cron Call "Daily Reconciliation" // by application "My Monitor". // much better than "IOException in IO.java:1234"! // They are intended to include ANY information needed to resolve the // issue (without needing complete logs maybe even with // version-dependent stack dumps, which would be horrible). CommException ex = new CommIOException(ioex); ex.appendInfo(" on port " + portName); } Comments, corrections and critics are appreciated! oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 04:50:40 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 12:50:40 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Message-ID: <17E538BC24EE42EC89F5BB086205F581@mdam2> ----- Original Message ----- From: "Steffen DETTMER" To: "rxtx" Sent: Monday, November 30, 2009 12:06 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > Hi, > > I could not resist to write about how to use InputStream.read(byte[]) > because I think this again is an example showing it wrongly. > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: >> http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ >> >> There is a lot about RXTX, and sample works with Events. >> It differs from original RXTX samples. > I didn't checked this sample befor posting, and I did missusage of the word "works". Sorry, should be "sample prepared for Events". Yesterday afteroon I have checked this technique in XP only, but I have had problems and have switched to other tasks. Steffen, please attach your new complete example to be sure no errors while changing and please let me know in which platform you have tested it. I will check it on my systems. Maybe this is a platform problem? Why I think so: My sample works in Windows and Linux, but in real application I have detected problem with Linux. In old systems we have had hard list of the serial ports, but now user may connect and disconnect USB-Serial dongle while application is running. Effects are clear... We (developers) have to be ready to serve it. And therefore I have an configuration form where user may check device, find it automatically or declare manually COM (dev/tty...) device. Before each auto-looking for my specific device I have (I should) to re-read available ports (I have the button to manually refresh list of the ports as well). In XP and Vista it works very good. No one crash in 5 hours when I was doing that!!! But in Linux (newest Ubuntu) there is a problem. Doing an enumeration of the devices when RXTX driver was previousluy used, places new instance of the RXTXDriver in the memory: CommPortIdentifier.java, line 327. When this action occurs, IOLocked stays 2, previously used device is not visible even if was correctly closed! Application hangs, but I don't know yet where - earlier it was read loop. Now I have to do some other things, later I will go back to problem. Regards Mariusz From oliverhoffmann32 at googlemail.com Mon Nov 30 08:07:31 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 16:07:31 +0100 Subject: [Rxtx] RXTX for ttyACM0 Message-ID: <200911301607.31300.oliverhoffmann32@googlemail.com> Hi RXTX Crew! I'm currently writing a small application which uses RXTX to communicate with an USB device: ... usb 1-10: new full speed USB device using ohci_hcd and address 3 usb 1-10: configuration #1 chosen from 1 choice cdc_acm 1-10:1.0: This device cannot do calls on its own. It is not a modem. cdc_acm 1-10:1.0: ttyACM0: USB ACM device usbcore: registered new interface driver cdc_acm cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters ... If I use cutecom I can open a connection to /dev/ttyACM0 without any problems, but CommPortIdentifier.getPortIdentifiers() from RXTX only lists some ttyS[0-9] devices. The only way I found is symlinking ttyACM0 to for example ttyS3, so i wonder if there's any better way (like if the user doesn't have write-access to /dev). Greatings, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 08:35:56 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:35:56 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <200911301607.31300.oliverhoffmann32@googlemail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> Message-ID: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> 2009/11/30 Oliver Hoffmann > Hi RXTX Crew! > > I'm currently writing a small application which uses RXTX to communicate > with > an USB device: > ... > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > wonder > if there's any better way (like if the user doesn't have write-access to > /dev). > To avoid this naming problem between systems and implementations of the USB-RS naming conventions I did it what you may see below. You may identify system elsewhere (isMac, isWindows, isLinux) and read appriorate prefixes from an INI file etc. So user may change their prefixes without changing application! Note that you have to look for ALL system ports, not serial only and do filtering yourself. In RXTXCommDriver.java you may change port candidates porefixes if you would like to change sources of the RXTX. If not - my example works fine. Regards Mariusz Dec /* * * @author Mariusz Dec * September 2009 */ import gnu.io.CommPortIdentifier; import java.util.Enumeration; import javax.swing.DefaultListModel; public class CommPortLister { public static String comPortsWindows = "COM"; public static String comPortsMacintosh1 = "/dev/tty"; public static String comPortsMacintosh2 = "/dev/cu"; public static String comPortsLinux1 = "/dev/usb/tty"; public static String comPortsLinux2 = "/dev/tty"; public DefaultListModel listCom() { Enumeration ports = CommPortIdentifier.getPortIdentifiers(); DefaultListModel pList = null; String pName = ""; String pStart1 = ""; String pStart2 = ""; pList = new DefaultListModel(); while(ports.hasMoreElements()) { pName = ((CommPortIdentifier)ports.nextElement()).getName(); if (isWindows) { pStart1 = comPortsWindows; pStart2 = "------"; } else if (isMac) { pStart1 = comPortsMacintosh1; pStart2 = comPortsMacintosh2; } else if (isLinux) { pStart1 = comPortsLinux1; pStart2 = comPortsLinux2; } if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) { pList.addElement(pName); } } return pList; } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Nov 30 08:40:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 16:40:13 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <17E538BC24EE42EC89F5BB086205F581@mdam2> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> Message-ID: <20091130154013.GL20226@elberon.bln.de.ingenico.com> * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100: > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > > > > > There is a lot about RXTX, and sample works with Events. > > > It differs from original RXTX samples. > > I didn't checked this sample befor posting, and I did missusage of the word > "works". Sorry, should be "sample prepared for Events". no problem. I did neither intend to critice you nor the example; I did not even read what it demonstrates (I think it is not an example how to use read in best way). Maybe I just wanted to start an example :) Also I think that this example will work (ie. print something) in most cases! I'm just afraid people could start some prototype of their apps based on it, then improve here and there and finally have some server application with rare strange failures. > Steffen, please attach your new complete example to be sure no > errors while changing and please let me know in which platform > you have tested it. I will check it on my systems. You ask me to write a complete compiling example? mmm... maybe I could take some time this week to do so, but first I would like to ensure that it is correct. We had discussions about it in the past and there were many details to consider; easy to fall in a trap. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 08:59:47 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:59:47 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <20091130154013.GL20226@elberon.bln.de.ingenico.com> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> <20091130154013.GL20226@elberon.bln.de.ingenico.com> Message-ID: <73a89f360911300759l63335522sb16bc254a4d0ebb2@mail.gmail.com> 2009/11/30 Steffen DETTMER > * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100:> you have tested > it. I will check it on my systems. > > You ask me to write a complete compiling example? > Yes, if you did it.. BTW: I have analysed your mail and In the meantime I have solved problem in my application on Linux It was a mistake while copying sources between machines... hrrrr.. Returning to your work - like in each realtime and/or physical interfaces, timing may generate problems, especially with USB. Few months ago I have seen time critical application transferred to USB-RS232 dongle. Crazy results... USB is polling data, no interrupts... My new experience: My desktop XP is very fast, Vista and Ubuntu are on slower notebook. For Vista and Win RXTX.dll computer speed is enough but for Linux I have observed that rereshing ports list in the program sequence: disonnect(curPort); porstList = refreshPortsList(); returns portsList WITHOUT curPort... It means that curPort returns on the available ports list in system with delay after close(). This is not big problem, but a bit frustrating - I do not like to add delays everywhere... Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliverhoffmann32 at googlemail.com Mon Nov 30 09:10:15 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 17:10:15 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> Message-ID: <200911301710.16126.oliverhoffmann32@googlemail.com> On Monday 30 November 2009 16:35:56 Mariusz Dec wrote: > 2009/11/30 Oliver Hoffmann > > > Hi RXTX Crew! > > > > I'm currently writing a small application which uses RXTX to communicate > > with > > an USB device: > > ... > > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > > wonder > > if there's any better way (like if the user doesn't have write-access to > > /dev). > > To avoid this naming problem between systems and implementations of the > USB-RS naming conventions I did it what you may see below. > You may identify system elsewhere (isMac, isWindows, isLinux) and read > appriorate prefixes from an INI file etc. > So user may change their prefixes without changing application! > > Note that you have to look for ALL system ports, not serial only and do > filtering yourself. > > In RXTXCommDriver.java you may change port candidates porefixes if you > would like to change sources of the RXTX. > If not - my example works fine. > > Regards > Mariusz Dec > > /* > * > * @author Mariusz Dec > * September 2009 > */ > > import gnu.io.CommPortIdentifier; > > import java.util.Enumeration; > import javax.swing.DefaultListModel; > > public class CommPortLister { > > public static String comPortsWindows = "COM"; > public static String comPortsMacintosh1 = "/dev/tty"; > public static String comPortsMacintosh2 = "/dev/cu"; > public static String comPortsLinux1 = "/dev/usb/tty"; > public static String comPortsLinux2 = "/dev/tty"; > > > public DefaultListModel listCom() { > Enumeration ports = CommPortIdentifier.getPortIdentifiers(); > DefaultListModel pList = null; > String pName = ""; > String pStart1 = ""; > String pStart2 = ""; > pList = new DefaultListModel(); > while(ports.hasMoreElements()) > { > pName = ((CommPortIdentifier)ports.nextElement()).getName(); > > if (isWindows) > { > pStart1 = comPortsWindows; > pStart2 = "------"; > } > else > if (isMac) > { > pStart1 = comPortsMacintosh1; > pStart2 = comPortsMacintosh2; > } > else > if (isLinux) > { > pStart1 = comPortsLinux1; > pStart2 = comPortsLinux2; > } > > if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) > { > pList.addElement(pName); > } > } > return pList; > } > } > This wouldn't work because the list of CommPortIdentifier.getPortIdentifiers() is already filtered, so I would have to change the "CandidatePortPrefixes" list in RXTXCommDriver as you said. But after looking through the sourcecode I found that setting gnu.io.rxtx.SerialPorts to "/dev/ttyACM0" solved the problem. Sure it's not the nicest way but at leats it works. Maybe adding "ttyACM" to the list in RXTXCommDriver.java:521 is a more permanent solution. Regards, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 10:57:04 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 18:57:04 +0100 Subject: [Rxtx] RXTX for ttyACM0 References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> <200911301710.16126.oliverhoffmann32@googlemail.com> Message-ID: <09AC73AA7B22418BBCD1297A2D85A033@mdam2> > > This wouldn't work because the list of > CommPortIdentifier.getPortIdentifiers() > is already filtered, so I would have to change the > "CandidatePortPrefixes" list > in RXTXCommDriver as you said. It works in Windows from several months...., sorry Mariusz From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From nate at n4te.com Thu Nov 26 14:32:21 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 13:32:21 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Ah, thanks Ivan. What do you think about supporting both 32 bit and 64 bit DLLs, with the correct one chosen at runtime? This way I don't need two separate versions of my app. -Nate 2009/11/26 Ivan Maidanski : > Nate wrote: >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >> I see a user has come up with a workaround for 64 bit OS X. Has anyone >> done this for Windows? Are there plans to support 64 bit Windows? > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > >> >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >> Other open source projects such as LWJGL (http://lwjgl.org/) include >> both 32 and 64 bit native libs and the correct lib is automatically >> used. >> >> -Nate > > From ivmai at mail.ru Thu Nov 26 14:52:53 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Fri, 27 Nov 2009 00:52:53 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan From Kapil_Gupta at hcl.in Thu Nov 26 22:47:13 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 27 Nov 2009 11:17:13 +0530 Subject: [Rxtx] Rxtx Digest, Vol 27, Issue 7 In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960FDD2F38A@NDA-HCLT-EVS05.HCLT. CORP.HCL.IN-F0913EFA-B2A5-28E5-3684-11AABE813CF9> Hi, I am also facing the same issue as Mariusz is facing, I am facing it on Intel Mac 10.5.8. I am using RXTX 2.2 Pre binaries. First time I am able to read the data from my device, but second time port open hangs (RXTXPort.java). I am using TI chip set in my device. I created a C sample to test the driver but that works perfectly to read device any number of times. No hangs !! Note: My sample works fine on Windows XP. Please help. Thanks, Kapil -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Thursday, November 26, 2009 6:50 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 27, Issue 7 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! (M.Dec-GMail) 2. Re: Patch adding monThread setDaemon (Steffen DETTMER) 3. Re: Patch adding monThread setDaemon (Ivan Maidanski) 4. Patch for WinCE readArray (Ivan Maidanski) 5. Re: Patch adding monThread setDaemon (Ivan Maidanski) 6. Re: SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! (Ivan Maidanski) 7. Re: Patch adding monThread setDaemon (Trent Jarvi) 8. 64 bit (Nate) 9. Re: 64 bit (Ivan Maidanski) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Nov 2009 20:23:54 +0100 From: "M.Dec-GMail" To: Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2 at mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end ------------------------------ Message: 2 Date: Mon, 23 Nov 2009 22:26:36 +0100 From: "Steffen DETTMER" To: "rxtx" Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset="utf-8" > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail ------------------------------ Message: 3 Date: Tue, 24 Nov 2009 10:36:34 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 4 Date: Tue, 24 Nov 2009 22:26:00 +0300 From: Ivan Maidanski To: rxtx Subject: [Rxtx] Patch for WinCE readArray Message-ID: Content-Type: text/plain; charset="koi8-r" Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: ------------------------------ Message: 5 Date: Tue, 24 Nov 2009 22:33:41 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 6 Date: Tue, 24 Nov 2009 22:38:40 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! Message-ID: Content-Type: text/plain; charset=koi8-r Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) ------------------------------ Message: 7 Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) From: Trent Jarvi To: Ivan Maidanski Cc: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------ Message: 8 Date: Thu, 26 Nov 2009 05:08:27 -0800 From: Nate To: rxtx at qbang.org Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate ------------------------------ Message: 9 Date: Thu, 26 Nov 2009 16:24:21 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] 64 bit Message-ID: Content-Type: text/plain; charset=koi8-r Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate ------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx End of Rxtx Digest, Vol 27, Issue 7 *********************************** DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From m.kirkland at comcast.net Fri Nov 27 01:56:33 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 27 Nov 2009 00:56:33 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Or you could try the following utility which will modify the native library search path at run time based on the os.name and os.arch system properties. http://hamware.info/tools/LibLoader.zip Read the comments in the code and the properties file for details. Mike -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Ivan Maidanski Sent: Thursday, November 26, 2009 1:53 PM To: rxtx Subject: Re: [Rxtx] 64 bit Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri Nov 27 08:48:41 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 27 Nov 2009 08:48:41 -0700 (MST) Subject: [Rxtx] 64 bit In-Reply-To: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: I've used the native library search path to solve the problem in the past. The 64/32 bit library is one issue. There is also an issue binaries that can run on multiple archs. http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ This can be complicated by libc sources/versions ... At first glance, it would appear reasonable to modify the library name or path. When I think about it, the better approach is to make sure the libraries load in an intuitive way when installed alone for the novice and leave the multiple arch/os support problem as an exercise for the implementor as they will have an advanced skill set (and hopefully a nice wiki page helping them). On Fri, 27 Nov 2009, Mike Kirkland wrote: > Or you could try the following utility which will modify the native library > search path at run time based on the os.name and os.arch system properties. > > http://hamware.info/tools/LibLoader.zip > > Read the comments in the code and the properties file for details. > > Mike > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Ivan Maidanski > Sent: Thursday, November 26, 2009 1:53 PM > To: rxtx > Subject: Re: [Rxtx] 64 bit > > Hi! > Nate wrote: >> Ah, thanks Ivan. >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String > basename) which if sun.arch.data.model property is defined and equals "64" > then first tries to load basename+"64" library otherwize (if not 64 or > failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with > RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" > for 64-bit targets (optionally, if needed). > >> >> -Nate >> >> >> 2009/11/26 Ivan Maidanski : >>> Nate wrote: >>>> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >>>> I see a user has come up with a workaround for 64 bit OS X. Has anyone >>>> done this for Windows? Are there plans to support 64 bit Windows? >>> >>> rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily > rebuild it from the sources using e.g. mingw-w64.) >>> >>>> >>>> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >>>> Other open source projects such as LWJGL (http://lwjgl.org/) include >>>> both 32 and 64 bit native libs and the correct lib is automatically >>>> used. > > Best regards, > Ivan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Fri Nov 27 13:55:55 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Fri, 27 Nov 2009 21:55:55 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved Message-ID: Hi Ivan, Trent, Steffen, Kapil and all :) I have found a method how to close() and reopen RXTX serial port without problems. This is done on the rxtx-2.2pre2 version, but I think that it should work on earlier versions as well. I have tested it on Windows XP, Vista and Linux, Ubuntu distribution. On Windows XP it works on native UART and VCP, on Vista and Ubuntu I haven't native UART, so I have tested it with USB-RS232 VCP from FTDI. There is NO code changes in Java and C, this is only better external service of the processes between Java threads and native interface. I have found it looking in the code and tracing Java in Netbeans 6.7.1. using printouts from C part - #define TRENT_IS_HERE :) Attached file - TwoWaySerialCommMd.java is derived from the original TwoWaySerialComm.java but works a bit better :). Important comments are inside the file. I hope Kapil answers what about Macintosh but it should looks like in Linux. A bit about works of the Ivan and Steffen form last days. I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good idea when RXTXPort is used as a part of the application, but I think that Trent should accept or not this change. In my opinion this change does nothing in this case. If somebody needs serial daemon should do it a level up... Especially to Trent: 1. I have read a lot about synchronisation and in my opinion monThreadMutex in RXTXPort.java should be declared as final, the same with Sync in CommPortIdentifier. 2. Please check this example and, if this is good, add it to official examples of the RXTX. ABOUT EVENTS In my application I have checked events as well, but they works to slow for me - to big delay - I don't know why. Finally, I have decided to generate my own Exception when data from inStream is collected and proper parsed (I need packs of bytes). Exception transfers data to rest of the application. The only disadvantage is ASCII model of the data which may be transferred through Exception, but for me its enough. Therefore I don't know what to do with SerialEvent of the RXTX - I have found questions about the same problem with close() while using Events. Maybe somebody wiil solve this problem using my job. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M+R\F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8-"B\O)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F#0HO+R!(;W<@=&\@=7-E(%)8 M5%A397)I86Q0;W)T#0HO+R!">2!-87)I=7-Z($1E8RP at 4&]L86YD#0HO+R!. M;W9E;6)E5-EB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@<')E<&%R:6YG(&EN4W1R96%M(&%N9"!O M=713=')E86T@=&\@9&5A8W1I=F%T92!B969OF5D*'-T;W!296%D M375T97 at I#0H@(" @(" @(" @(" @>W-T;W!296%D(#T@=')U93M]#0H@(" @ M(" @('-Y;F-H"D-"B @(" @(" @(" @ M("![4]W;F5D M*"D@*0T*(" @(" @("![#0H@(" @(" @(" @("!3>7-T96TN;W5T+G!R:6YT M;&XH(D5R2!I;B!U2P@;&EN92 X-# L M(#@V,0T*+R\@5VEN9&]W7-T96TN;W5T+G!R:6YT;&XH(D5R2!T:&ES(&5X86UP;&4N(BD[#0H@(" @(" @(" @ M("!]#0H@(" @(" @('T@(" @( T*(" @('T-"B\O*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H@(" @+RHJ("HO#0H@(" @<'5B;&EC('-T M871I8R!C;&%SB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@16YA8FQI;F<@=V]R:R!O9B!T:&4@:6Y3 M=')E86T-"@T*(" @(" @(" @(" @('-Y;F-H71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5; M,3 R-%T[#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @ M("!TB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)@T*+R\@0VAE8VMI;F<@:68 at 86)O=70@=&\@8VQO7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@&-E<'1I;VX@ M92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPF5D*'-T;W!70T*(" @(" @(" @(" @>R @(" @(" @(" @(" @(" -"B @(" @ M(" @(" @(" @("!I;G0 at 8R ](# [#0H@(" @(" @(" @(" @(" @=VAI;&4@ M*" H(&,@/2!3>7-T96TN:6XN7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@=W)I=&EN9RXN+B(I.PT*(" @(" @ M(" @(" @(" @(" @(" @(" @8G)E86L[#0H@(" @(" @(" @(" @(" @(" @ M('T-"B @(" @(" @(" @(" @(" @(" @=&AI&-E<'1I;VX at 92 I#0H@(" @ M(" @(" @("![#0H@(" @(" @(" @(" @(" @92YP" H1$(Y M("T@<&EN(#(@8V]N;F5C=&5D('1O(#,I("!D871A('=I;&P@ T*(" @(" @("!3=')I;F<@<&]R=$YA;64@ M/2 B+V1E=B]T='E54T(P(CL-"@T*+R\@36%C#0HO+U-T3\_/S\_/S\_(CL-"@T*(" @(" @("!TPT*(" @(" @(" @(" @5-E2 at I("T at 4G5N=&EM92YG9712=6YT:6UE*"DN9G)E94UE;6]R>2 at I*2D[ M#0H@(" @(" @(" @4WES=&5M+F]U="YPPT*(" @(" @("!3>7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!O M<&5N*"DN+BXB("L@<&]R=$YA;64I.PT*(" @(" @("!T7-T96TN;W5T+G!R:6YT;&XH(E=A:71I;F7-T96TN;W5T+G!R:6YT;&XH92YT M;U-T0T*(" @(" @("![#0H@(" @(" @(" @(" @&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @92YP M&ET*# I.PT*(" @('T-"GT-"@`` ` end From nate at n4te.com Fri Nov 27 17:09:50 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:09:50 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> 2009/11/26 Ivan Maidanski : > Nate wrote: >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). Please see the attached patch for the Java changes. I didn't update the build scripts, I'm fine with just renaming the libs myself for now. After some thought, I decided since the sun.arch.data.model property is unreliable, being Sun JVM specific, so I settled on loading the 32-bit lib by default and trying the 64-bit lib if that fails. The patch also sets "devel" to false in RXTXCommDriver. I strongly believe a third party library should not be hardcoded to dump to System.out, especially when nothing is wrong. If I want to dump the rxtx version to System.out, I can write one line of code to do so (ASCII art is certainly not needed). -Nate -------------- next part -------------- A non-text attachment was scrubbed... Name: nativeLib.patch Type: application/octet-stream Size: 2700 bytes Desc: not available URL: From nate at n4te.com Fri Nov 27 17:12:24 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:12:24 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: <7d6ffee60911271612u4f3830aam295c56fe6c93e277@mail.gmail.com> On Fri, Nov 27, 2009 at 7:48 AM, Trent Jarvi wrote: > The 64/32 bit library is one issue. There is also an issue binaries that > can run on multiple archs. > > http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ > > This can be complicated by libc sources/versions ... > > At first glance, it would appear reasonable to modify the library name or > path. When I think about it, the better approach is to make sure the > libraries load in an intuitive way when installed alone for the novice and > leave the multiple arch/os support problem as an exercise for the > implementor as they will have an advanced skill set (and hopefully a nice > wiki page helping them). Ideally rxtx could be shipped with all the native libs and it would know how to pick the appropriate one. This way it can be kept up to date by the rxtx project rather than each user with this need maintain their own loading code. That said, if no one actually has this need, I don't see a problem with waiting for the first person to implement it, then absorbing it into the rxtx project. IMO, the next best thing is to at least handle the most common case, which is 32/64-bit. -Nate From ivmai at mail.ru Sat Nov 28 00:48:05 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 10:48:05 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: Hi! Nate wrote: > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> What do you think about supporting both 32 bit and 64 bit DLLs, with > >> the correct one chosen at runtime? This way I don't need two separate > >> versions of my app. > > > > I think it would be good. I think this should be implemented as follows: > > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > Please see the attached patch for the Java changes. I didn't update > the build scripts, I'm fine with just renaming the libs myself for > now. After some thought, I decided since the sun.arch.data.model > property is unreliable, being Sun JVM specific, so I settled on > loading the 32-bit lib by default and trying the 64-bit lib if that > fails. I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. > > The patch also sets "devel" to false in RXTXCommDriver. I strongly > believe a third party library should not be hardcoded to dump to > System.out, especially when nothing is wrong. If I want to dump the > rxtx version to System.out, I can write one line of code to do so > (ASCII art is certainly not needed). > > -Nate > > ATTACHMENT: application/x-patch (nativeLib.patch) From nate at n4te.com Sat Nov 28 00:55:59 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 23:55:59 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: <7d6ffee60911272355p73e526a0t5c10a7fc4d0f6663@mail.gmail.com> Hi Ivan, 2009/11/27 Ivan Maidanski : > Hi! > Nate wrote: >> 2009/11/26 Ivan Maidanski : >> > Nate wrote: >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> >> the correct one chosen at runtime? This way I don't need two separate >> >> versions of my app. >> > >> > I think it would be good. I think this should be implemented as follows: >> > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); >> > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); >> > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). >> >> Please see the attached patch for the Java changes. I didn't update >> the build scripts, I'm fine with just renaming the libs myself for >> now. After some thought, I decided since the sun.arch.data.model >> property is unreliable, being Sun JVM specific, so I settled on >> loading the 32-bit lib by default and trying the 64-bit lib if that >> fails. > > I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. I meant unreliable in that the property isn't defined by the JVM spec, so may not be available in all JVMs. This means even if it is false, 64-bit must be tried before absolute failure. > The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. Sure. Here is how I would write it, with clarity in mind: static void loadLibrary (String baseName) { if (System.getProperty("sun.arch.data.model", "").equals("64")) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ex64) { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ignored) { throw ex64; } } } else { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ex32) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ignored) { throw ex32; } } } } -Nate >> >> The patch also sets "devel" to false in RXTXCommDriver. I strongly >> believe a third party library should not be hardcoded to dump to >> System.out, especially when nothing is wrong. If I want to dump the >> rxtx version to System.out, I can write one line of code to do so >> (ASCII art is certainly not needed). >> >> -Nate >> >> ATTACHMENT: application/x-patch (nativeLib.patch) > > From ivmai at mail.ru Sat Nov 28 07:26:43 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 17:26:43 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: References: Message-ID: "M.Dec-GMail" wrote: > Hi Ivan, Trent, Steffen, Kapil and all :) > ... > A bit about works of the Ivan and Steffen from last days. > > I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good > idea when RXTXPort is used as a part of the application, but I think that > Trent should accept or not this change. > In my opinion this change does nothing in this case. > If somebody needs serial daemon should do it a level up... I never claimed setDaemon patch would solve the port close problem. It solves "not exiting" a badly-written application problem (I mean an app is returning from main() without calling close() for ports). > ... > Regards > Mariusz Dec From mariusz.dec at gmail.com Sat Nov 28 09:29:04 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 28 Nov 2009 17:29:04 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <536A5B02D18041459E65A4D1182D1374@mdam2> ----- Original Message ----- From: "Ivan Maidanski" To: "rxtx" Sent: Saturday, November 28, 2009 3:26 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > I never claimed setDaemon patch would solve the port close problem. It > solves "not exiting" a badly-written application problem (I mean an app is > returning from main() without calling close() for ports). It was general notice - not about close - but I am sorry - this is my mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. So - your proposal is good, but I have observed that RXTXPort ends work even without close, if application ends with System.exit(0). But in this case - If you will try my example without System.exit(0), program stays in memory and Netbeans says that application runs... This is the case of baddly written application - what in this case? Something is wrong in my techniuqe of subsequent opens? Variables configuration? No finalize of the RXTX port? Maybe this is it. If yes, everything should be changed and my example is workaround only - all threads disconnections should be done during close, inside RXTXPort.java.. Today I have written serial port scanner which is looking for specific external device checking all system serial ports - opening, sending query, closing (this is why I needed working close()). No memory waste, no lost threads in memory, but my application ends with System.exit(0). Workaround works... Regards Mariusz Dec >> ... >> Regards >> Mariusz Dec > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ivmai at mail.ru Sat Nov 28 09:57:33 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 19:57:33 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: <536A5B02D18041459E65A4D1182D1374@mdam2> References: <536A5B02D18041459E65A4D1182D1374@mdam2> Message-ID: "M.Dec-GMail" wrote: > ----- Original Message ----- > From: "Ivan Maidanski" > Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > > > I never claimed setDaemon patch would solve the port close problem. It > > solves "not exiting" a badly-written application problem (I mean an app is > > returning from main() without calling close() for ports). > > It was general notice - not about close - but I am sorry - this is my > mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. > So - your proposal is good, but I have observed that RXTXPort ends work even > without close, if application ends with System.exit(0). That's how exit works by the definition (contrary to returning from main(String[])). > > But in this case - If you will try my example without System.exit(0), > program stays in memory and Netbeans says that application runs... > This is the case of badly written application - what in this case? No, in my case a "badly-written application" is exiting from an app w/o closing ports - this works with the original Sun Comm API but run into a "not exiting" problem with rxtx (unless System.exit is used, of course). > Something is wrong in my technique of subsequent opens? > Variables configuration? > No finalize of the RXTX port? Maybe this is it. Finalizers are not guaranteed to be ever run. > If yes, everything should be changed and my example is workaround only - all > threads disconnections should be done during close, inside RXTXPort.java.. > > Today I have written serial port scanner which is looking for specific > external device checking all system serial ports - opening, sending query, > closing (this is why I needed working close()). > No memory waste, no lost threads in memory, but my application ends with > System.exit(0). > Workaround works... > > Regards > Mariusz Dec At present, I use System.exit(0) in my app to workaround the absence of setDaemon too. Regards, Ovan From mariusz.dec at gmail.com Sun Nov 29 01:01:28 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 09:01:28 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: Hi all, While googling for something, I have found this site: http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ There is a lot about RXTX, and sample works with Events. It differs from original RXTX samples. The only question is - why original samples doesn't work correct and there is no links to real solutions... RXTX project is great but... Regards Mariusz Dec From tjarvi at qbang.org Sun Nov 29 08:57:08 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 29 Nov 2009 08:57:08 -0700 (MST) Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: On Sun, 29 Nov 2009, M.Dec-Gazeta wrote: > Hi all, > While googling for something, I have found this site: > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. > > The only question is - why original samples doesn't work correct and there > is no links to real solutions... > RXTX project is great but... > Hi Mariusz, The rxtx project is far from perfect and needs help from users as well as developers. As you identify problems such as the original samples not doing what you need and missing links to the one you wanted, please do take a moment to edit the page another user created in hopes of helping you. Just remember that the wiki pages are almost entirely sponsored by individuals taking time to fix what bothered them. In the early stages, the concern was no examples. A positive tone is always appreciated. Posting to the mail-list is also appreciated and will make it more likely to attract a developer to sponsor a fix with their efforts. -- Trent Jarvi tjarvi at qbang.org From mariusz.dec at gmail.com Sun Nov 29 11:39:59 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 19:39:59 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <9732BACF0EFD43F3A6B0396ADF0C7811@mdam2> Hi Jarvi, > ...A positive tone is always appreciated. I am very sorry, that you have received my message as something wrong in my mind about your work in this GREAT project. I am very sorry - belive me please. I hope that my work over this close() problem, ready to use example and published later link, shows my FULL POSITIVE thinking about RXTX. Regards Mariusz Dec > > -- > Trent Jarvi > tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Mon Nov 30 04:06:03 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 12:06:03 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Hi, I could not resist to write about how to use InputStream.read(byte[]) because I think this again is an example showing it wrongly. * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. it contains: 259 private byte[] readBuffer = new byte[400]; (I better don't comment on this one here) 272 try { 273 int availableBytes = inStream.available(); 274 if (availableBytes > 0) { 275 // Read the serial port 276 inStream.read(readBuffer, 0, availableBytes); 277 278 // Print it out 279 System.out.println("Recv :" + 280 new String(readBuffer, 0, availableBytes)); 281 } 282 } catch (IOException e) { 283 } I think this is wrong: - exceptions should be ignored never (without even logging) - when code cannot handle an exception, I think it should not catch it (or catch-log-throw) - it assumes 400 bytes are the maximum a serial link can recveive in a read call, but there is no such guarantee by the API - it assumes that read will read availableBytes but there is no such guarantee by API definition - it assumes availableBytes <= readBuffer.length - The STDOUT output depends on timing details (it could happen that in one situation two Recv: lines are printed but in another arbitrary similar situation just one is printed due to different timing details I think InputStream.read(byte[]) is better to be used in a construction like this (assuming it polls based on an event as in the example): // some doReadFunc(): boolean eof = false; int chunkSize = 128; byte[] readData = new byte[0]; while(eof == false && inStream.available()) { byte[] readBuf = new byte[chunkSize]; // available() guaranteed read will not block, but // we may read more than available bytes here (in case more were // received) or less than (if read returns earlier, which is // allowed by spec) - but at least 1. int thisRead = inStream.read(readBuffer, 0, readBuf.length); if (thisRead == -1) { // Please note that we cannot throw here // if (readData.length() > 0), // because caller would not see the contents of readData. // But we could throw in case readData is empty. eof = true; } else { // Now we need a "readData += readBuffer;". // Don't know if this really is so uncomfortable on Java or if I // just don't know how to do it better. This commonly should be // in some appendBuffer helper function (doing realloc + 2copy) byte[]tmpBuf = new byte[readData.length + thisRead]; // assert(readData.length + thisRead == totalRead); System.arraycopy(readData, 0, tmpBuf, 0, readData.length); System.arraycopy(readBuf, 0, tmpBuf, readData.length, thisRead); readData = tmpBuf; } } // readData contains the data that could be read. It could be empty/zero // in case no bytes available(), but it blocks never. It could be that exactly at the time when inStream.available() returned zero a new byte arrives, so typically someone will need to have a message parsing loop around (or integrated) - usually it is easier to try to read what is needed and timeout otherwise (in contrast to read what is avialable and then guess if could be complete by timing). Simple example could be: // has methods "boolean isComplete()" and "int bytesNeeded()". BinaryMessage message; while(!message.isComplete() && !timer.isExpired() ) { // doRead(InputStream, int len) which does NOT BLOCK but return zero // in case there is no data avialable() byte[] readData = doRead(input, message.bytesNeeded()); // we should not poll. With Java InputStream it is hard to handle, // because avialable() has no timeout parameter. We can use small // delays to convert this spinlock to a 20 ms poll which works when // having a few connections only but wastes resources. Better would // be to synchronize with some events such as // SerialPortEvent.DATA_AVAILABLE, but this makes this code depend // on SerialPort (otherwise, it would work on ANY InputStream which // IMHO should be the reason why InputStream exists, but this is // off-topic here) } if (timer.isExpired()) { // handle timeout } // else assert(message.isComplete()); Exceptions could be handled in a way like: String portName = "/dev/ttyS0"; // pseudo code: SerialPort port = SerialPort.open(portName); try { try { thisRead = port.is.read(); if (thisRead == -1) { if (readData.length == 0) { throw new ConnectionClosedByPeerException(); } } } catch {IOException ioex) { CommException ex = new CommIOException(ioex); ex.appendInfo("while reading"); } } catch (CommException ex) { // Instead of the read call above probably we call a method working // on InputStream. This function cannot know the portName, but for // the user this is very important. Because of this we add the // information. We do this on each level/layer: our caller appends // why the port were read (e.g. "while initilizing modem" or // "quering thermometer sensor") and so on. The user then can get a // message like // unexpected DCD drop (carrier lost) while reading /dev/ttyS0 for // Modem communication while sending file UPLOAD.DAT for module // DataReconciliation triggered by Cron Call "Daily Reconciliation" // by application "My Monitor". // much better than "IOException in IO.java:1234"! // They are intended to include ANY information needed to resolve the // issue (without needing complete logs maybe even with // version-dependent stack dumps, which would be horrible). CommException ex = new CommIOException(ioex); ex.appendInfo(" on port " + portName); } Comments, corrections and critics are appreciated! oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 04:50:40 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 12:50:40 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Message-ID: <17E538BC24EE42EC89F5BB086205F581@mdam2> ----- Original Message ----- From: "Steffen DETTMER" To: "rxtx" Sent: Monday, November 30, 2009 12:06 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > Hi, > > I could not resist to write about how to use InputStream.read(byte[]) > because I think this again is an example showing it wrongly. > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: >> http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ >> >> There is a lot about RXTX, and sample works with Events. >> It differs from original RXTX samples. > I didn't checked this sample befor posting, and I did missusage of the word "works". Sorry, should be "sample prepared for Events". Yesterday afteroon I have checked this technique in XP only, but I have had problems and have switched to other tasks. Steffen, please attach your new complete example to be sure no errors while changing and please let me know in which platform you have tested it. I will check it on my systems. Maybe this is a platform problem? Why I think so: My sample works in Windows and Linux, but in real application I have detected problem with Linux. In old systems we have had hard list of the serial ports, but now user may connect and disconnect USB-Serial dongle while application is running. Effects are clear... We (developers) have to be ready to serve it. And therefore I have an configuration form where user may check device, find it automatically or declare manually COM (dev/tty...) device. Before each auto-looking for my specific device I have (I should) to re-read available ports (I have the button to manually refresh list of the ports as well). In XP and Vista it works very good. No one crash in 5 hours when I was doing that!!! But in Linux (newest Ubuntu) there is a problem. Doing an enumeration of the devices when RXTX driver was previousluy used, places new instance of the RXTXDriver in the memory: CommPortIdentifier.java, line 327. When this action occurs, IOLocked stays 2, previously used device is not visible even if was correctly closed! Application hangs, but I don't know yet where - earlier it was read loop. Now I have to do some other things, later I will go back to problem. Regards Mariusz From oliverhoffmann32 at googlemail.com Mon Nov 30 08:07:31 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 16:07:31 +0100 Subject: [Rxtx] RXTX for ttyACM0 Message-ID: <200911301607.31300.oliverhoffmann32@googlemail.com> Hi RXTX Crew! I'm currently writing a small application which uses RXTX to communicate with an USB device: ... usb 1-10: new full speed USB device using ohci_hcd and address 3 usb 1-10: configuration #1 chosen from 1 choice cdc_acm 1-10:1.0: This device cannot do calls on its own. It is not a modem. cdc_acm 1-10:1.0: ttyACM0: USB ACM device usbcore: registered new interface driver cdc_acm cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters ... If I use cutecom I can open a connection to /dev/ttyACM0 without any problems, but CommPortIdentifier.getPortIdentifiers() from RXTX only lists some ttyS[0-9] devices. The only way I found is symlinking ttyACM0 to for example ttyS3, so i wonder if there's any better way (like if the user doesn't have write-access to /dev). Greatings, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 08:35:56 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:35:56 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <200911301607.31300.oliverhoffmann32@googlemail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> Message-ID: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> 2009/11/30 Oliver Hoffmann > Hi RXTX Crew! > > I'm currently writing a small application which uses RXTX to communicate > with > an USB device: > ... > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > wonder > if there's any better way (like if the user doesn't have write-access to > /dev). > To avoid this naming problem between systems and implementations of the USB-RS naming conventions I did it what you may see below. You may identify system elsewhere (isMac, isWindows, isLinux) and read appriorate prefixes from an INI file etc. So user may change their prefixes without changing application! Note that you have to look for ALL system ports, not serial only and do filtering yourself. In RXTXCommDriver.java you may change port candidates porefixes if you would like to change sources of the RXTX. If not - my example works fine. Regards Mariusz Dec /* * * @author Mariusz Dec * September 2009 */ import gnu.io.CommPortIdentifier; import java.util.Enumeration; import javax.swing.DefaultListModel; public class CommPortLister { public static String comPortsWindows = "COM"; public static String comPortsMacintosh1 = "/dev/tty"; public static String comPortsMacintosh2 = "/dev/cu"; public static String comPortsLinux1 = "/dev/usb/tty"; public static String comPortsLinux2 = "/dev/tty"; public DefaultListModel listCom() { Enumeration ports = CommPortIdentifier.getPortIdentifiers(); DefaultListModel pList = null; String pName = ""; String pStart1 = ""; String pStart2 = ""; pList = new DefaultListModel(); while(ports.hasMoreElements()) { pName = ((CommPortIdentifier)ports.nextElement()).getName(); if (isWindows) { pStart1 = comPortsWindows; pStart2 = "------"; } else if (isMac) { pStart1 = comPortsMacintosh1; pStart2 = comPortsMacintosh2; } else if (isLinux) { pStart1 = comPortsLinux1; pStart2 = comPortsLinux2; } if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) { pList.addElement(pName); } } return pList; } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Nov 30 08:40:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 16:40:13 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <17E538BC24EE42EC89F5BB086205F581@mdam2> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> Message-ID: <20091130154013.GL20226@elberon.bln.de.ingenico.com> * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100: > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > > > > > There is a lot about RXTX, and sample works with Events. > > > It differs from original RXTX samples. > > I didn't checked this sample befor posting, and I did missusage of the word > "works". Sorry, should be "sample prepared for Events". no problem. I did neither intend to critice you nor the example; I did not even read what it demonstrates (I think it is not an example how to use read in best way). Maybe I just wanted to start an example :) Also I think that this example will work (ie. print something) in most cases! I'm just afraid people could start some prototype of their apps based on it, then improve here and there and finally have some server application with rare strange failures. > Steffen, please attach your new complete example to be sure no > errors while changing and please let me know in which platform > you have tested it. I will check it on my systems. You ask me to write a complete compiling example? mmm... maybe I could take some time this week to do so, but first I would like to ensure that it is correct. We had discussions about it in the past and there were many details to consider; easy to fall in a trap. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 08:59:47 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:59:47 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <20091130154013.GL20226@elberon.bln.de.ingenico.com> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> <20091130154013.GL20226@elberon.bln.de.ingenico.com> Message-ID: <73a89f360911300759l63335522sb16bc254a4d0ebb2@mail.gmail.com> 2009/11/30 Steffen DETTMER > * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100:> you have tested > it. I will check it on my systems. > > You ask me to write a complete compiling example? > Yes, if you did it.. BTW: I have analysed your mail and In the meantime I have solved problem in my application on Linux It was a mistake while copying sources between machines... hrrrr.. Returning to your work - like in each realtime and/or physical interfaces, timing may generate problems, especially with USB. Few months ago I have seen time critical application transferred to USB-RS232 dongle. Crazy results... USB is polling data, no interrupts... My new experience: My desktop XP is very fast, Vista and Ubuntu are on slower notebook. For Vista and Win RXTX.dll computer speed is enough but for Linux I have observed that rereshing ports list in the program sequence: disonnect(curPort); porstList = refreshPortsList(); returns portsList WITHOUT curPort... It means that curPort returns on the available ports list in system with delay after close(). This is not big problem, but a bit frustrating - I do not like to add delays everywhere... Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliverhoffmann32 at googlemail.com Mon Nov 30 09:10:15 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 17:10:15 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> Message-ID: <200911301710.16126.oliverhoffmann32@googlemail.com> On Monday 30 November 2009 16:35:56 Mariusz Dec wrote: > 2009/11/30 Oliver Hoffmann > > > Hi RXTX Crew! > > > > I'm currently writing a small application which uses RXTX to communicate > > with > > an USB device: > > ... > > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > > wonder > > if there's any better way (like if the user doesn't have write-access to > > /dev). > > To avoid this naming problem between systems and implementations of the > USB-RS naming conventions I did it what you may see below. > You may identify system elsewhere (isMac, isWindows, isLinux) and read > appriorate prefixes from an INI file etc. > So user may change their prefixes without changing application! > > Note that you have to look for ALL system ports, not serial only and do > filtering yourself. > > In RXTXCommDriver.java you may change port candidates porefixes if you > would like to change sources of the RXTX. > If not - my example works fine. > > Regards > Mariusz Dec > > /* > * > * @author Mariusz Dec > * September 2009 > */ > > import gnu.io.CommPortIdentifier; > > import java.util.Enumeration; > import javax.swing.DefaultListModel; > > public class CommPortLister { > > public static String comPortsWindows = "COM"; > public static String comPortsMacintosh1 = "/dev/tty"; > public static String comPortsMacintosh2 = "/dev/cu"; > public static String comPortsLinux1 = "/dev/usb/tty"; > public static String comPortsLinux2 = "/dev/tty"; > > > public DefaultListModel listCom() { > Enumeration ports = CommPortIdentifier.getPortIdentifiers(); > DefaultListModel pList = null; > String pName = ""; > String pStart1 = ""; > String pStart2 = ""; > pList = new DefaultListModel(); > while(ports.hasMoreElements()) > { > pName = ((CommPortIdentifier)ports.nextElement()).getName(); > > if (isWindows) > { > pStart1 = comPortsWindows; > pStart2 = "------"; > } > else > if (isMac) > { > pStart1 = comPortsMacintosh1; > pStart2 = comPortsMacintosh2; > } > else > if (isLinux) > { > pStart1 = comPortsLinux1; > pStart2 = comPortsLinux2; > } > > if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) > { > pList.addElement(pName); > } > } > return pList; > } > } > This wouldn't work because the list of CommPortIdentifier.getPortIdentifiers() is already filtered, so I would have to change the "CandidatePortPrefixes" list in RXTXCommDriver as you said. But after looking through the sourcecode I found that setting gnu.io.rxtx.SerialPorts to "/dev/ttyACM0" solved the problem. Sure it's not the nicest way but at leats it works. Maybe adding "ttyACM" to the list in RXTXCommDriver.java:521 is a more permanent solution. Regards, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 10:57:04 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 18:57:04 +0100 Subject: [Rxtx] RXTX for ttyACM0 References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> <200911301710.16126.oliverhoffmann32@googlemail.com> Message-ID: <09AC73AA7B22418BBCD1297A2D85A033@mdam2> > > This wouldn't work because the list of > CommPortIdentifier.getPortIdentifiers() > is already filtered, so I would have to change the > "CandidatePortPrefixes" list > in RXTXCommDriver as you said. It works in Windows from several months...., sorry Mariusz From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From nate at n4te.com Thu Nov 26 14:32:21 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 13:32:21 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Ah, thanks Ivan. What do you think about supporting both 32 bit and 64 bit DLLs, with the correct one chosen at runtime? This way I don't need two separate versions of my app. -Nate 2009/11/26 Ivan Maidanski : > Nate wrote: >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >> I see a user has come up with a workaround for 64 bit OS X. Has anyone >> done this for Windows? Are there plans to support 64 bit Windows? > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > >> >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >> Other open source projects such as LWJGL (http://lwjgl.org/) include >> both 32 and 64 bit native libs and the correct lib is automatically >> used. >> >> -Nate > > From ivmai at mail.ru Thu Nov 26 14:52:53 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Fri, 27 Nov 2009 00:52:53 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan From Kapil_Gupta at hcl.in Thu Nov 26 22:47:13 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 27 Nov 2009 11:17:13 +0530 Subject: [Rxtx] Rxtx Digest, Vol 27, Issue 7 In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960FDD2F38A@NDA-HCLT-EVS05.HCLT. CORP.HCL.IN-F0913EFA-B2A5-28E5-3684-11AABE813CF9> Hi, I am also facing the same issue as Mariusz is facing, I am facing it on Intel Mac 10.5.8. I am using RXTX 2.2 Pre binaries. First time I am able to read the data from my device, but second time port open hangs (RXTXPort.java). I am using TI chip set in my device. I created a C sample to test the driver but that works perfectly to read device any number of times. No hangs !! Note: My sample works fine on Windows XP. Please help. Thanks, Kapil -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Thursday, November 26, 2009 6:50 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 27, Issue 7 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! (M.Dec-GMail) 2. Re: Patch adding monThread setDaemon (Steffen DETTMER) 3. Re: Patch adding monThread setDaemon (Ivan Maidanski) 4. Patch for WinCE readArray (Ivan Maidanski) 5. Re: Patch adding monThread setDaemon (Ivan Maidanski) 6. Re: SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! (Ivan Maidanski) 7. Re: Patch adding monThread setDaemon (Trent Jarvi) 8. 64 bit (Nate) 9. Re: 64 bit (Ivan Maidanski) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Nov 2009 20:23:54 +0100 From: "M.Dec-GMail" To: Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2 at mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end ------------------------------ Message: 2 Date: Mon, 23 Nov 2009 22:26:36 +0100 From: "Steffen DETTMER" To: "rxtx" Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset="utf-8" > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail ------------------------------ Message: 3 Date: Tue, 24 Nov 2009 10:36:34 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 4 Date: Tue, 24 Nov 2009 22:26:00 +0300 From: Ivan Maidanski To: rxtx Subject: [Rxtx] Patch for WinCE readArray Message-ID: Content-Type: text/plain; charset="koi8-r" Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: ------------------------------ Message: 5 Date: Tue, 24 Nov 2009 22:33:41 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 6 Date: Tue, 24 Nov 2009 22:38:40 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! Message-ID: Content-Type: text/plain; charset=koi8-r Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) ------------------------------ Message: 7 Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) From: Trent Jarvi To: Ivan Maidanski Cc: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------ Message: 8 Date: Thu, 26 Nov 2009 05:08:27 -0800 From: Nate To: rxtx at qbang.org Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate ------------------------------ Message: 9 Date: Thu, 26 Nov 2009 16:24:21 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] 64 bit Message-ID: Content-Type: text/plain; charset=koi8-r Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate ------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx End of Rxtx Digest, Vol 27, Issue 7 *********************************** DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From m.kirkland at comcast.net Fri Nov 27 01:56:33 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 27 Nov 2009 00:56:33 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Or you could try the following utility which will modify the native library search path at run time based on the os.name and os.arch system properties. http://hamware.info/tools/LibLoader.zip Read the comments in the code and the properties file for details. Mike -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Ivan Maidanski Sent: Thursday, November 26, 2009 1:53 PM To: rxtx Subject: Re: [Rxtx] 64 bit Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri Nov 27 08:48:41 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 27 Nov 2009 08:48:41 -0700 (MST) Subject: [Rxtx] 64 bit In-Reply-To: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: I've used the native library search path to solve the problem in the past. The 64/32 bit library is one issue. There is also an issue binaries that can run on multiple archs. http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ This can be complicated by libc sources/versions ... At first glance, it would appear reasonable to modify the library name or path. When I think about it, the better approach is to make sure the libraries load in an intuitive way when installed alone for the novice and leave the multiple arch/os support problem as an exercise for the implementor as they will have an advanced skill set (and hopefully a nice wiki page helping them). On Fri, 27 Nov 2009, Mike Kirkland wrote: > Or you could try the following utility which will modify the native library > search path at run time based on the os.name and os.arch system properties. > > http://hamware.info/tools/LibLoader.zip > > Read the comments in the code and the properties file for details. > > Mike > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Ivan Maidanski > Sent: Thursday, November 26, 2009 1:53 PM > To: rxtx > Subject: Re: [Rxtx] 64 bit > > Hi! > Nate wrote: >> Ah, thanks Ivan. >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String > basename) which if sun.arch.data.model property is defined and equals "64" > then first tries to load basename+"64" library otherwize (if not 64 or > failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with > RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" > for 64-bit targets (optionally, if needed). > >> >> -Nate >> >> >> 2009/11/26 Ivan Maidanski : >>> Nate wrote: >>>> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >>>> I see a user has come up with a workaround for 64 bit OS X. Has anyone >>>> done this for Windows? Are there plans to support 64 bit Windows? >>> >>> rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily > rebuild it from the sources using e.g. mingw-w64.) >>> >>>> >>>> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >>>> Other open source projects such as LWJGL (http://lwjgl.org/) include >>>> both 32 and 64 bit native libs and the correct lib is automatically >>>> used. > > Best regards, > Ivan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Fri Nov 27 13:55:55 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Fri, 27 Nov 2009 21:55:55 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved Message-ID: Hi Ivan, Trent, Steffen, Kapil and all :) I have found a method how to close() and reopen RXTX serial port without problems. This is done on the rxtx-2.2pre2 version, but I think that it should work on earlier versions as well. I have tested it on Windows XP, Vista and Linux, Ubuntu distribution. On Windows XP it works on native UART and VCP, on Vista and Ubuntu I haven't native UART, so I have tested it with USB-RS232 VCP from FTDI. There is NO code changes in Java and C, this is only better external service of the processes between Java threads and native interface. I have found it looking in the code and tracing Java in Netbeans 6.7.1. using printouts from C part - #define TRENT_IS_HERE :) Attached file - TwoWaySerialCommMd.java is derived from the original TwoWaySerialComm.java but works a bit better :). Important comments are inside the file. I hope Kapil answers what about Macintosh but it should looks like in Linux. A bit about works of the Ivan and Steffen form last days. I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good idea when RXTXPort is used as a part of the application, but I think that Trent should accept or not this change. In my opinion this change does nothing in this case. If somebody needs serial daemon should do it a level up... Especially to Trent: 1. I have read a lot about synchronisation and in my opinion monThreadMutex in RXTXPort.java should be declared as final, the same with Sync in CommPortIdentifier. 2. Please check this example and, if this is good, add it to official examples of the RXTX. ABOUT EVENTS In my application I have checked events as well, but they works to slow for me - to big delay - I don't know why. Finally, I have decided to generate my own Exception when data from inStream is collected and proper parsed (I need packs of bytes). Exception transfers data to rest of the application. The only disadvantage is ASCII model of the data which may be transferred through Exception, but for me its enough. Therefore I don't know what to do with SerialEvent of the RXTX - I have found questions about the same problem with close() while using Events. Maybe somebody wiil solve this problem using my job. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M+R\F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8-"B\O)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F#0HO+R!(;W<@=&\@=7-E(%)8 M5%A397)I86Q0;W)T#0HO+R!">2!-87)I=7-Z($1E8RP at 4&]L86YD#0HO+R!. M;W9E;6)E5-EB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@<')E<&%R:6YG(&EN4W1R96%M(&%N9"!O M=713=')E86T@=&\@9&5A8W1I=F%T92!B969OF5D*'-T;W!296%D M375T97 at I#0H@(" @(" @(" @(" @>W-T;W!296%D(#T@=')U93M]#0H@(" @ M(" @('-Y;F-H"D-"B @(" @(" @(" @ M("![4]W;F5D M*"D@*0T*(" @(" @("![#0H@(" @(" @(" @("!3>7-T96TN;W5T+G!R:6YT M;&XH(D5R2!I;B!U2P@;&EN92 X-# L M(#@V,0T*+R\@5VEN9&]W7-T96TN;W5T+G!R:6YT;&XH(D5R2!T:&ES(&5X86UP;&4N(BD[#0H@(" @(" @(" @ M("!]#0H@(" @(" @('T@(" @( T*(" @('T-"B\O*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H@(" @+RHJ("HO#0H@(" @<'5B;&EC('-T M871I8R!C;&%SB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@16YA8FQI;F<@=V]R:R!O9B!T:&4@:6Y3 M=')E86T-"@T*(" @(" @(" @(" @('-Y;F-H71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5; M,3 R-%T[#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @ M("!TB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)@T*+R\@0VAE8VMI;F<@:68 at 86)O=70@=&\@8VQO7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@&-E<'1I;VX@ M92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPF5D*'-T;W!70T*(" @(" @(" @(" @>R @(" @(" @(" @(" @(" -"B @(" @ M(" @(" @(" @("!I;G0 at 8R ](# [#0H@(" @(" @(" @(" @(" @=VAI;&4@ M*" H(&,@/2!3>7-T96TN:6XN7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@=W)I=&EN9RXN+B(I.PT*(" @(" @ M(" @(" @(" @(" @(" @(" @8G)E86L[#0H@(" @(" @(" @(" @(" @(" @ M('T-"B @(" @(" @(" @(" @(" @(" @=&AI&-E<'1I;VX at 92 I#0H@(" @ M(" @(" @("![#0H@(" @(" @(" @(" @(" @92YP" H1$(Y M("T@<&EN(#(@8V]N;F5C=&5D('1O(#,I("!D871A('=I;&P@ T*(" @(" @("!3=')I;F<@<&]R=$YA;64@ M/2 B+V1E=B]T='E54T(P(CL-"@T*+R\@36%C#0HO+U-T3\_/S\_/S\_(CL-"@T*(" @(" @("!TPT*(" @(" @(" @(" @5-E2 at I("T at 4G5N=&EM92YG9712=6YT:6UE*"DN9G)E94UE;6]R>2 at I*2D[ M#0H@(" @(" @(" @4WES=&5M+F]U="YPPT*(" @(" @("!3>7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!O M<&5N*"DN+BXB("L@<&]R=$YA;64I.PT*(" @(" @("!T7-T96TN;W5T+G!R:6YT;&XH(E=A:71I;F7-T96TN;W5T+G!R:6YT;&XH92YT M;U-T0T*(" @(" @("![#0H@(" @(" @(" @(" @&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @92YP M&ET*# I.PT*(" @('T-"GT-"@`` ` end From nate at n4te.com Fri Nov 27 17:09:50 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:09:50 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> 2009/11/26 Ivan Maidanski : > Nate wrote: >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). Please see the attached patch for the Java changes. I didn't update the build scripts, I'm fine with just renaming the libs myself for now. After some thought, I decided since the sun.arch.data.model property is unreliable, being Sun JVM specific, so I settled on loading the 32-bit lib by default and trying the 64-bit lib if that fails. The patch also sets "devel" to false in RXTXCommDriver. I strongly believe a third party library should not be hardcoded to dump to System.out, especially when nothing is wrong. If I want to dump the rxtx version to System.out, I can write one line of code to do so (ASCII art is certainly not needed). -Nate -------------- next part -------------- A non-text attachment was scrubbed... Name: nativeLib.patch Type: application/octet-stream Size: 2700 bytes Desc: not available URL: From nate at n4te.com Fri Nov 27 17:12:24 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:12:24 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: <7d6ffee60911271612u4f3830aam295c56fe6c93e277@mail.gmail.com> On Fri, Nov 27, 2009 at 7:48 AM, Trent Jarvi wrote: > The 64/32 bit library is one issue. There is also an issue binaries that > can run on multiple archs. > > http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ > > This can be complicated by libc sources/versions ... > > At first glance, it would appear reasonable to modify the library name or > path. When I think about it, the better approach is to make sure the > libraries load in an intuitive way when installed alone for the novice and > leave the multiple arch/os support problem as an exercise for the > implementor as they will have an advanced skill set (and hopefully a nice > wiki page helping them). Ideally rxtx could be shipped with all the native libs and it would know how to pick the appropriate one. This way it can be kept up to date by the rxtx project rather than each user with this need maintain their own loading code. That said, if no one actually has this need, I don't see a problem with waiting for the first person to implement it, then absorbing it into the rxtx project. IMO, the next best thing is to at least handle the most common case, which is 32/64-bit. -Nate From ivmai at mail.ru Sat Nov 28 00:48:05 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 10:48:05 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: Hi! Nate wrote: > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> What do you think about supporting both 32 bit and 64 bit DLLs, with > >> the correct one chosen at runtime? This way I don't need two separate > >> versions of my app. > > > > I think it would be good. I think this should be implemented as follows: > > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > Please see the attached patch for the Java changes. I didn't update > the build scripts, I'm fine with just renaming the libs myself for > now. After some thought, I decided since the sun.arch.data.model > property is unreliable, being Sun JVM specific, so I settled on > loading the 32-bit lib by default and trying the 64-bit lib if that > fails. I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. > > The patch also sets "devel" to false in RXTXCommDriver. I strongly > believe a third party library should not be hardcoded to dump to > System.out, especially when nothing is wrong. If I want to dump the > rxtx version to System.out, I can write one line of code to do so > (ASCII art is certainly not needed). > > -Nate > > ATTACHMENT: application/x-patch (nativeLib.patch) From nate at n4te.com Sat Nov 28 00:55:59 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 23:55:59 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: <7d6ffee60911272355p73e526a0t5c10a7fc4d0f6663@mail.gmail.com> Hi Ivan, 2009/11/27 Ivan Maidanski : > Hi! > Nate wrote: >> 2009/11/26 Ivan Maidanski : >> > Nate wrote: >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> >> the correct one chosen at runtime? This way I don't need two separate >> >> versions of my app. >> > >> > I think it would be good. I think this should be implemented as follows: >> > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); >> > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); >> > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). >> >> Please see the attached patch for the Java changes. I didn't update >> the build scripts, I'm fine with just renaming the libs myself for >> now. After some thought, I decided since the sun.arch.data.model >> property is unreliable, being Sun JVM specific, so I settled on >> loading the 32-bit lib by default and trying the 64-bit lib if that >> fails. > > I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. I meant unreliable in that the property isn't defined by the JVM spec, so may not be available in all JVMs. This means even if it is false, 64-bit must be tried before absolute failure. > The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. Sure. Here is how I would write it, with clarity in mind: static void loadLibrary (String baseName) { if (System.getProperty("sun.arch.data.model", "").equals("64")) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ex64) { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ignored) { throw ex64; } } } else { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ex32) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ignored) { throw ex32; } } } } -Nate >> >> The patch also sets "devel" to false in RXTXCommDriver. I strongly >> believe a third party library should not be hardcoded to dump to >> System.out, especially when nothing is wrong. If I want to dump the >> rxtx version to System.out, I can write one line of code to do so >> (ASCII art is certainly not needed). >> >> -Nate >> >> ATTACHMENT: application/x-patch (nativeLib.patch) > > From ivmai at mail.ru Sat Nov 28 07:26:43 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 17:26:43 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: References: Message-ID: "M.Dec-GMail" wrote: > Hi Ivan, Trent, Steffen, Kapil and all :) > ... > A bit about works of the Ivan and Steffen from last days. > > I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good > idea when RXTXPort is used as a part of the application, but I think that > Trent should accept or not this change. > In my opinion this change does nothing in this case. > If somebody needs serial daemon should do it a level up... I never claimed setDaemon patch would solve the port close problem. It solves "not exiting" a badly-written application problem (I mean an app is returning from main() without calling close() for ports). > ... > Regards > Mariusz Dec From mariusz.dec at gmail.com Sat Nov 28 09:29:04 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 28 Nov 2009 17:29:04 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <536A5B02D18041459E65A4D1182D1374@mdam2> ----- Original Message ----- From: "Ivan Maidanski" To: "rxtx" Sent: Saturday, November 28, 2009 3:26 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > I never claimed setDaemon patch would solve the port close problem. It > solves "not exiting" a badly-written application problem (I mean an app is > returning from main() without calling close() for ports). It was general notice - not about close - but I am sorry - this is my mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. So - your proposal is good, but I have observed that RXTXPort ends work even without close, if application ends with System.exit(0). But in this case - If you will try my example without System.exit(0), program stays in memory and Netbeans says that application runs... This is the case of baddly written application - what in this case? Something is wrong in my techniuqe of subsequent opens? Variables configuration? No finalize of the RXTX port? Maybe this is it. If yes, everything should be changed and my example is workaround only - all threads disconnections should be done during close, inside RXTXPort.java.. Today I have written serial port scanner which is looking for specific external device checking all system serial ports - opening, sending query, closing (this is why I needed working close()). No memory waste, no lost threads in memory, but my application ends with System.exit(0). Workaround works... Regards Mariusz Dec >> ... >> Regards >> Mariusz Dec > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ivmai at mail.ru Sat Nov 28 09:57:33 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 19:57:33 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: <536A5B02D18041459E65A4D1182D1374@mdam2> References: <536A5B02D18041459E65A4D1182D1374@mdam2> Message-ID: "M.Dec-GMail" wrote: > ----- Original Message ----- > From: "Ivan Maidanski" > Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > > > I never claimed setDaemon patch would solve the port close problem. It > > solves "not exiting" a badly-written application problem (I mean an app is > > returning from main() without calling close() for ports). > > It was general notice - not about close - but I am sorry - this is my > mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. > So - your proposal is good, but I have observed that RXTXPort ends work even > without close, if application ends with System.exit(0). That's how exit works by the definition (contrary to returning from main(String[])). > > But in this case - If you will try my example without System.exit(0), > program stays in memory and Netbeans says that application runs... > This is the case of badly written application - what in this case? No, in my case a "badly-written application" is exiting from an app w/o closing ports - this works with the original Sun Comm API but run into a "not exiting" problem with rxtx (unless System.exit is used, of course). > Something is wrong in my technique of subsequent opens? > Variables configuration? > No finalize of the RXTX port? Maybe this is it. Finalizers are not guaranteed to be ever run. > If yes, everything should be changed and my example is workaround only - all > threads disconnections should be done during close, inside RXTXPort.java.. > > Today I have written serial port scanner which is looking for specific > external device checking all system serial ports - opening, sending query, > closing (this is why I needed working close()). > No memory waste, no lost threads in memory, but my application ends with > System.exit(0). > Workaround works... > > Regards > Mariusz Dec At present, I use System.exit(0) in my app to workaround the absence of setDaemon too. Regards, Ovan From mariusz.dec at gmail.com Sun Nov 29 01:01:28 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 09:01:28 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: Hi all, While googling for something, I have found this site: http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ There is a lot about RXTX, and sample works with Events. It differs from original RXTX samples. The only question is - why original samples doesn't work correct and there is no links to real solutions... RXTX project is great but... Regards Mariusz Dec From tjarvi at qbang.org Sun Nov 29 08:57:08 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 29 Nov 2009 08:57:08 -0700 (MST) Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: On Sun, 29 Nov 2009, M.Dec-Gazeta wrote: > Hi all, > While googling for something, I have found this site: > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. > > The only question is - why original samples doesn't work correct and there > is no links to real solutions... > RXTX project is great but... > Hi Mariusz, The rxtx project is far from perfect and needs help from users as well as developers. As you identify problems such as the original samples not doing what you need and missing links to the one you wanted, please do take a moment to edit the page another user created in hopes of helping you. Just remember that the wiki pages are almost entirely sponsored by individuals taking time to fix what bothered them. In the early stages, the concern was no examples. A positive tone is always appreciated. Posting to the mail-list is also appreciated and will make it more likely to attract a developer to sponsor a fix with their efforts. -- Trent Jarvi tjarvi at qbang.org From mariusz.dec at gmail.com Sun Nov 29 11:39:59 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 19:39:59 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <9732BACF0EFD43F3A6B0396ADF0C7811@mdam2> Hi Jarvi, > ...A positive tone is always appreciated. I am very sorry, that you have received my message as something wrong in my mind about your work in this GREAT project. I am very sorry - belive me please. I hope that my work over this close() problem, ready to use example and published later link, shows my FULL POSITIVE thinking about RXTX. Regards Mariusz Dec > > -- > Trent Jarvi > tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Mon Nov 30 04:06:03 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 12:06:03 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Hi, I could not resist to write about how to use InputStream.read(byte[]) because I think this again is an example showing it wrongly. * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. it contains: 259 private byte[] readBuffer = new byte[400]; (I better don't comment on this one here) 272 try { 273 int availableBytes = inStream.available(); 274 if (availableBytes > 0) { 275 // Read the serial port 276 inStream.read(readBuffer, 0, availableBytes); 277 278 // Print it out 279 System.out.println("Recv :" + 280 new String(readBuffer, 0, availableBytes)); 281 } 282 } catch (IOException e) { 283 } I think this is wrong: - exceptions should be ignored never (without even logging) - when code cannot handle an exception, I think it should not catch it (or catch-log-throw) - it assumes 400 bytes are the maximum a serial link can recveive in a read call, but there is no such guarantee by the API - it assumes that read will read availableBytes but there is no such guarantee by API definition - it assumes availableBytes <= readBuffer.length - The STDOUT output depends on timing details (it could happen that in one situation two Recv: lines are printed but in another arbitrary similar situation just one is printed due to different timing details I think InputStream.read(byte[]) is better to be used in a construction like this (assuming it polls based on an event as in the example): // some doReadFunc(): boolean eof = false; int chunkSize = 128; byte[] readData = new byte[0]; while(eof == false && inStream.available()) { byte[] readBuf = new byte[chunkSize]; // available() guaranteed read will not block, but // we may read more than available bytes here (in case more were // received) or less than (if read returns earlier, which is // allowed by spec) - but at least 1. int thisRead = inStream.read(readBuffer, 0, readBuf.length); if (thisRead == -1) { // Please note that we cannot throw here // if (readData.length() > 0), // because caller would not see the contents of readData. // But we could throw in case readData is empty. eof = true; } else { // Now we need a "readData += readBuffer;". // Don't know if this really is so uncomfortable on Java or if I // just don't know how to do it better. This commonly should be // in some appendBuffer helper function (doing realloc + 2copy) byte[]tmpBuf = new byte[readData.length + thisRead]; // assert(readData.length + thisRead == totalRead); System.arraycopy(readData, 0, tmpBuf, 0, readData.length); System.arraycopy(readBuf, 0, tmpBuf, readData.length, thisRead); readData = tmpBuf; } } // readData contains the data that could be read. It could be empty/zero // in case no bytes available(), but it blocks never. It could be that exactly at the time when inStream.available() returned zero a new byte arrives, so typically someone will need to have a message parsing loop around (or integrated) - usually it is easier to try to read what is needed and timeout otherwise (in contrast to read what is avialable and then guess if could be complete by timing). Simple example could be: // has methods "boolean isComplete()" and "int bytesNeeded()". BinaryMessage message; while(!message.isComplete() && !timer.isExpired() ) { // doRead(InputStream, int len) which does NOT BLOCK but return zero // in case there is no data avialable() byte[] readData = doRead(input, message.bytesNeeded()); // we should not poll. With Java InputStream it is hard to handle, // because avialable() has no timeout parameter. We can use small // delays to convert this spinlock to a 20 ms poll which works when // having a few connections only but wastes resources. Better would // be to synchronize with some events such as // SerialPortEvent.DATA_AVAILABLE, but this makes this code depend // on SerialPort (otherwise, it would work on ANY InputStream which // IMHO should be the reason why InputStream exists, but this is // off-topic here) } if (timer.isExpired()) { // handle timeout } // else assert(message.isComplete()); Exceptions could be handled in a way like: String portName = "/dev/ttyS0"; // pseudo code: SerialPort port = SerialPort.open(portName); try { try { thisRead = port.is.read(); if (thisRead == -1) { if (readData.length == 0) { throw new ConnectionClosedByPeerException(); } } } catch {IOException ioex) { CommException ex = new CommIOException(ioex); ex.appendInfo("while reading"); } } catch (CommException ex) { // Instead of the read call above probably we call a method working // on InputStream. This function cannot know the portName, but for // the user this is very important. Because of this we add the // information. We do this on each level/layer: our caller appends // why the port were read (e.g. "while initilizing modem" or // "quering thermometer sensor") and so on. The user then can get a // message like // unexpected DCD drop (carrier lost) while reading /dev/ttyS0 for // Modem communication while sending file UPLOAD.DAT for module // DataReconciliation triggered by Cron Call "Daily Reconciliation" // by application "My Monitor". // much better than "IOException in IO.java:1234"! // They are intended to include ANY information needed to resolve the // issue (without needing complete logs maybe even with // version-dependent stack dumps, which would be horrible). CommException ex = new CommIOException(ioex); ex.appendInfo(" on port " + portName); } Comments, corrections and critics are appreciated! oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 04:50:40 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 12:50:40 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Message-ID: <17E538BC24EE42EC89F5BB086205F581@mdam2> ----- Original Message ----- From: "Steffen DETTMER" To: "rxtx" Sent: Monday, November 30, 2009 12:06 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > Hi, > > I could not resist to write about how to use InputStream.read(byte[]) > because I think this again is an example showing it wrongly. > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: >> http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ >> >> There is a lot about RXTX, and sample works with Events. >> It differs from original RXTX samples. > I didn't checked this sample befor posting, and I did missusage of the word "works". Sorry, should be "sample prepared for Events". Yesterday afteroon I have checked this technique in XP only, but I have had problems and have switched to other tasks. Steffen, please attach your new complete example to be sure no errors while changing and please let me know in which platform you have tested it. I will check it on my systems. Maybe this is a platform problem? Why I think so: My sample works in Windows and Linux, but in real application I have detected problem with Linux. In old systems we have had hard list of the serial ports, but now user may connect and disconnect USB-Serial dongle while application is running. Effects are clear... We (developers) have to be ready to serve it. And therefore I have an configuration form where user may check device, find it automatically or declare manually COM (dev/tty...) device. Before each auto-looking for my specific device I have (I should) to re-read available ports (I have the button to manually refresh list of the ports as well). In XP and Vista it works very good. No one crash in 5 hours when I was doing that!!! But in Linux (newest Ubuntu) there is a problem. Doing an enumeration of the devices when RXTX driver was previousluy used, places new instance of the RXTXDriver in the memory: CommPortIdentifier.java, line 327. When this action occurs, IOLocked stays 2, previously used device is not visible even if was correctly closed! Application hangs, but I don't know yet where - earlier it was read loop. Now I have to do some other things, later I will go back to problem. Regards Mariusz From oliverhoffmann32 at googlemail.com Mon Nov 30 08:07:31 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 16:07:31 +0100 Subject: [Rxtx] RXTX for ttyACM0 Message-ID: <200911301607.31300.oliverhoffmann32@googlemail.com> Hi RXTX Crew! I'm currently writing a small application which uses RXTX to communicate with an USB device: ... usb 1-10: new full speed USB device using ohci_hcd and address 3 usb 1-10: configuration #1 chosen from 1 choice cdc_acm 1-10:1.0: This device cannot do calls on its own. It is not a modem. cdc_acm 1-10:1.0: ttyACM0: USB ACM device usbcore: registered new interface driver cdc_acm cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters ... If I use cutecom I can open a connection to /dev/ttyACM0 without any problems, but CommPortIdentifier.getPortIdentifiers() from RXTX only lists some ttyS[0-9] devices. The only way I found is symlinking ttyACM0 to for example ttyS3, so i wonder if there's any better way (like if the user doesn't have write-access to /dev). Greatings, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 08:35:56 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:35:56 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <200911301607.31300.oliverhoffmann32@googlemail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> Message-ID: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> 2009/11/30 Oliver Hoffmann > Hi RXTX Crew! > > I'm currently writing a small application which uses RXTX to communicate > with > an USB device: > ... > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > wonder > if there's any better way (like if the user doesn't have write-access to > /dev). > To avoid this naming problem between systems and implementations of the USB-RS naming conventions I did it what you may see below. You may identify system elsewhere (isMac, isWindows, isLinux) and read appriorate prefixes from an INI file etc. So user may change their prefixes without changing application! Note that you have to look for ALL system ports, not serial only and do filtering yourself. In RXTXCommDriver.java you may change port candidates porefixes if you would like to change sources of the RXTX. If not - my example works fine. Regards Mariusz Dec /* * * @author Mariusz Dec * September 2009 */ import gnu.io.CommPortIdentifier; import java.util.Enumeration; import javax.swing.DefaultListModel; public class CommPortLister { public static String comPortsWindows = "COM"; public static String comPortsMacintosh1 = "/dev/tty"; public static String comPortsMacintosh2 = "/dev/cu"; public static String comPortsLinux1 = "/dev/usb/tty"; public static String comPortsLinux2 = "/dev/tty"; public DefaultListModel listCom() { Enumeration ports = CommPortIdentifier.getPortIdentifiers(); DefaultListModel pList = null; String pName = ""; String pStart1 = ""; String pStart2 = ""; pList = new DefaultListModel(); while(ports.hasMoreElements()) { pName = ((CommPortIdentifier)ports.nextElement()).getName(); if (isWindows) { pStart1 = comPortsWindows; pStart2 = "------"; } else if (isMac) { pStart1 = comPortsMacintosh1; pStart2 = comPortsMacintosh2; } else if (isLinux) { pStart1 = comPortsLinux1; pStart2 = comPortsLinux2; } if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) { pList.addElement(pName); } } return pList; } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Nov 30 08:40:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 16:40:13 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <17E538BC24EE42EC89F5BB086205F581@mdam2> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> Message-ID: <20091130154013.GL20226@elberon.bln.de.ingenico.com> * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100: > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > > > > > There is a lot about RXTX, and sample works with Events. > > > It differs from original RXTX samples. > > I didn't checked this sample befor posting, and I did missusage of the word > "works". Sorry, should be "sample prepared for Events". no problem. I did neither intend to critice you nor the example; I did not even read what it demonstrates (I think it is not an example how to use read in best way). Maybe I just wanted to start an example :) Also I think that this example will work (ie. print something) in most cases! I'm just afraid people could start some prototype of their apps based on it, then improve here and there and finally have some server application with rare strange failures. > Steffen, please attach your new complete example to be sure no > errors while changing and please let me know in which platform > you have tested it. I will check it on my systems. You ask me to write a complete compiling example? mmm... maybe I could take some time this week to do so, but first I would like to ensure that it is correct. We had discussions about it in the past and there were many details to consider; easy to fall in a trap. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 08:59:47 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:59:47 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <20091130154013.GL20226@elberon.bln.de.ingenico.com> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> <20091130154013.GL20226@elberon.bln.de.ingenico.com> Message-ID: <73a89f360911300759l63335522sb16bc254a4d0ebb2@mail.gmail.com> 2009/11/30 Steffen DETTMER > * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100:> you have tested > it. I will check it on my systems. > > You ask me to write a complete compiling example? > Yes, if you did it.. BTW: I have analysed your mail and In the meantime I have solved problem in my application on Linux It was a mistake while copying sources between machines... hrrrr.. Returning to your work - like in each realtime and/or physical interfaces, timing may generate problems, especially with USB. Few months ago I have seen time critical application transferred to USB-RS232 dongle. Crazy results... USB is polling data, no interrupts... My new experience: My desktop XP is very fast, Vista and Ubuntu are on slower notebook. For Vista and Win RXTX.dll computer speed is enough but for Linux I have observed that rereshing ports list in the program sequence: disonnect(curPort); porstList = refreshPortsList(); returns portsList WITHOUT curPort... It means that curPort returns on the available ports list in system with delay after close(). This is not big problem, but a bit frustrating - I do not like to add delays everywhere... Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliverhoffmann32 at googlemail.com Mon Nov 30 09:10:15 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 17:10:15 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> Message-ID: <200911301710.16126.oliverhoffmann32@googlemail.com> On Monday 30 November 2009 16:35:56 Mariusz Dec wrote: > 2009/11/30 Oliver Hoffmann > > > Hi RXTX Crew! > > > > I'm currently writing a small application which uses RXTX to communicate > > with > > an USB device: > > ... > > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > > wonder > > if there's any better way (like if the user doesn't have write-access to > > /dev). > > To avoid this naming problem between systems and implementations of the > USB-RS naming conventions I did it what you may see below. > You may identify system elsewhere (isMac, isWindows, isLinux) and read > appriorate prefixes from an INI file etc. > So user may change their prefixes without changing application! > > Note that you have to look for ALL system ports, not serial only and do > filtering yourself. > > In RXTXCommDriver.java you may change port candidates porefixes if you > would like to change sources of the RXTX. > If not - my example works fine. > > Regards > Mariusz Dec > > /* > * > * @author Mariusz Dec > * September 2009 > */ > > import gnu.io.CommPortIdentifier; > > import java.util.Enumeration; > import javax.swing.DefaultListModel; > > public class CommPortLister { > > public static String comPortsWindows = "COM"; > public static String comPortsMacintosh1 = "/dev/tty"; > public static String comPortsMacintosh2 = "/dev/cu"; > public static String comPortsLinux1 = "/dev/usb/tty"; > public static String comPortsLinux2 = "/dev/tty"; > > > public DefaultListModel listCom() { > Enumeration ports = CommPortIdentifier.getPortIdentifiers(); > DefaultListModel pList = null; > String pName = ""; > String pStart1 = ""; > String pStart2 = ""; > pList = new DefaultListModel(); > while(ports.hasMoreElements()) > { > pName = ((CommPortIdentifier)ports.nextElement()).getName(); > > if (isWindows) > { > pStart1 = comPortsWindows; > pStart2 = "------"; > } > else > if (isMac) > { > pStart1 = comPortsMacintosh1; > pStart2 = comPortsMacintosh2; > } > else > if (isLinux) > { > pStart1 = comPortsLinux1; > pStart2 = comPortsLinux2; > } > > if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) > { > pList.addElement(pName); > } > } > return pList; > } > } > This wouldn't work because the list of CommPortIdentifier.getPortIdentifiers() is already filtered, so I would have to change the "CandidatePortPrefixes" list in RXTXCommDriver as you said. But after looking through the sourcecode I found that setting gnu.io.rxtx.SerialPorts to "/dev/ttyACM0" solved the problem. Sure it's not the nicest way but at leats it works. Maybe adding "ttyACM" to the list in RXTXCommDriver.java:521 is a more permanent solution. Regards, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 10:57:04 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 18:57:04 +0100 Subject: [Rxtx] RXTX for ttyACM0 References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> <200911301710.16126.oliverhoffmann32@googlemail.com> Message-ID: <09AC73AA7B22418BBCD1297A2D85A033@mdam2> > > This wouldn't work because the list of > CommPortIdentifier.getPortIdentifiers() > is already filtered, so I would have to change the > "CandidatePortPrefixes" list > in RXTXCommDriver as you said. It works in Windows from several months...., sorry Mariusz From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From nate at n4te.com Thu Nov 26 14:32:21 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 13:32:21 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Ah, thanks Ivan. What do you think about supporting both 32 bit and 64 bit DLLs, with the correct one chosen at runtime? This way I don't need two separate versions of my app. -Nate 2009/11/26 Ivan Maidanski : > Nate wrote: >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >> I see a user has come up with a workaround for 64 bit OS X. Has anyone >> done this for Windows? Are there plans to support 64 bit Windows? > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > >> >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >> Other open source projects such as LWJGL (http://lwjgl.org/) include >> both 32 and 64 bit native libs and the correct lib is automatically >> used. >> >> -Nate > > From ivmai at mail.ru Thu Nov 26 14:52:53 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Fri, 27 Nov 2009 00:52:53 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan From Kapil_Gupta at hcl.in Thu Nov 26 22:47:13 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 27 Nov 2009 11:17:13 +0530 Subject: [Rxtx] Rxtx Digest, Vol 27, Issue 7 In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960FDD2F38A@NDA-HCLT-EVS05.HCLT. CORP.HCL.IN-F0913EFA-B2A5-28E5-3684-11AABE813CF9> Hi, I am also facing the same issue as Mariusz is facing, I am facing it on Intel Mac 10.5.8. I am using RXTX 2.2 Pre binaries. First time I am able to read the data from my device, but second time port open hangs (RXTXPort.java). I am using TI chip set in my device. I created a C sample to test the driver but that works perfectly to read device any number of times. No hangs !! Note: My sample works fine on Windows XP. Please help. Thanks, Kapil -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Thursday, November 26, 2009 6:50 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 27, Issue 7 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! (M.Dec-GMail) 2. Re: Patch adding monThread setDaemon (Steffen DETTMER) 3. Re: Patch adding monThread setDaemon (Ivan Maidanski) 4. Patch for WinCE readArray (Ivan Maidanski) 5. Re: Patch adding monThread setDaemon (Ivan Maidanski) 6. Re: SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! (Ivan Maidanski) 7. Re: Patch adding monThread setDaemon (Trent Jarvi) 8. 64 bit (Nate) 9. Re: 64 bit (Ivan Maidanski) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Nov 2009 20:23:54 +0100 From: "M.Dec-GMail" To: Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2 at mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end ------------------------------ Message: 2 Date: Mon, 23 Nov 2009 22:26:36 +0100 From: "Steffen DETTMER" To: "rxtx" Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset="utf-8" > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail ------------------------------ Message: 3 Date: Tue, 24 Nov 2009 10:36:34 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 4 Date: Tue, 24 Nov 2009 22:26:00 +0300 From: Ivan Maidanski To: rxtx Subject: [Rxtx] Patch for WinCE readArray Message-ID: Content-Type: text/plain; charset="koi8-r" Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: ------------------------------ Message: 5 Date: Tue, 24 Nov 2009 22:33:41 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 6 Date: Tue, 24 Nov 2009 22:38:40 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! Message-ID: Content-Type: text/plain; charset=koi8-r Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) ------------------------------ Message: 7 Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) From: Trent Jarvi To: Ivan Maidanski Cc: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------ Message: 8 Date: Thu, 26 Nov 2009 05:08:27 -0800 From: Nate To: rxtx at qbang.org Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate ------------------------------ Message: 9 Date: Thu, 26 Nov 2009 16:24:21 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] 64 bit Message-ID: Content-Type: text/plain; charset=koi8-r Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate ------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx End of Rxtx Digest, Vol 27, Issue 7 *********************************** DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From m.kirkland at comcast.net Fri Nov 27 01:56:33 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 27 Nov 2009 00:56:33 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Or you could try the following utility which will modify the native library search path at run time based on the os.name and os.arch system properties. http://hamware.info/tools/LibLoader.zip Read the comments in the code and the properties file for details. Mike -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Ivan Maidanski Sent: Thursday, November 26, 2009 1:53 PM To: rxtx Subject: Re: [Rxtx] 64 bit Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri Nov 27 08:48:41 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 27 Nov 2009 08:48:41 -0700 (MST) Subject: [Rxtx] 64 bit In-Reply-To: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: I've used the native library search path to solve the problem in the past. The 64/32 bit library is one issue. There is also an issue binaries that can run on multiple archs. http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ This can be complicated by libc sources/versions ... At first glance, it would appear reasonable to modify the library name or path. When I think about it, the better approach is to make sure the libraries load in an intuitive way when installed alone for the novice and leave the multiple arch/os support problem as an exercise for the implementor as they will have an advanced skill set (and hopefully a nice wiki page helping them). On Fri, 27 Nov 2009, Mike Kirkland wrote: > Or you could try the following utility which will modify the native library > search path at run time based on the os.name and os.arch system properties. > > http://hamware.info/tools/LibLoader.zip > > Read the comments in the code and the properties file for details. > > Mike > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Ivan Maidanski > Sent: Thursday, November 26, 2009 1:53 PM > To: rxtx > Subject: Re: [Rxtx] 64 bit > > Hi! > Nate wrote: >> Ah, thanks Ivan. >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String > basename) which if sun.arch.data.model property is defined and equals "64" > then first tries to load basename+"64" library otherwize (if not 64 or > failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with > RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" > for 64-bit targets (optionally, if needed). > >> >> -Nate >> >> >> 2009/11/26 Ivan Maidanski : >>> Nate wrote: >>>> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >>>> I see a user has come up with a workaround for 64 bit OS X. Has anyone >>>> done this for Windows? Are there plans to support 64 bit Windows? >>> >>> rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily > rebuild it from the sources using e.g. mingw-w64.) >>> >>>> >>>> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >>>> Other open source projects such as LWJGL (http://lwjgl.org/) include >>>> both 32 and 64 bit native libs and the correct lib is automatically >>>> used. > > Best regards, > Ivan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Fri Nov 27 13:55:55 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Fri, 27 Nov 2009 21:55:55 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved Message-ID: Hi Ivan, Trent, Steffen, Kapil and all :) I have found a method how to close() and reopen RXTX serial port without problems. This is done on the rxtx-2.2pre2 version, but I think that it should work on earlier versions as well. I have tested it on Windows XP, Vista and Linux, Ubuntu distribution. On Windows XP it works on native UART and VCP, on Vista and Ubuntu I haven't native UART, so I have tested it with USB-RS232 VCP from FTDI. There is NO code changes in Java and C, this is only better external service of the processes between Java threads and native interface. I have found it looking in the code and tracing Java in Netbeans 6.7.1. using printouts from C part - #define TRENT_IS_HERE :) Attached file - TwoWaySerialCommMd.java is derived from the original TwoWaySerialComm.java but works a bit better :). Important comments are inside the file. I hope Kapil answers what about Macintosh but it should looks like in Linux. A bit about works of the Ivan and Steffen form last days. I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good idea when RXTXPort is used as a part of the application, but I think that Trent should accept or not this change. In my opinion this change does nothing in this case. If somebody needs serial daemon should do it a level up... Especially to Trent: 1. I have read a lot about synchronisation and in my opinion monThreadMutex in RXTXPort.java should be declared as final, the same with Sync in CommPortIdentifier. 2. Please check this example and, if this is good, add it to official examples of the RXTX. ABOUT EVENTS In my application I have checked events as well, but they works to slow for me - to big delay - I don't know why. Finally, I have decided to generate my own Exception when data from inStream is collected and proper parsed (I need packs of bytes). Exception transfers data to rest of the application. The only disadvantage is ASCII model of the data which may be transferred through Exception, but for me its enough. Therefore I don't know what to do with SerialEvent of the RXTX - I have found questions about the same problem with close() while using Events. Maybe somebody wiil solve this problem using my job. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M+R\F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8-"B\O)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F#0HO+R!(;W<@=&\@=7-E(%)8 M5%A397)I86Q0;W)T#0HO+R!">2!-87)I=7-Z($1E8RP at 4&]L86YD#0HO+R!. M;W9E;6)E5-EB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@<')E<&%R:6YG(&EN4W1R96%M(&%N9"!O M=713=')E86T@=&\@9&5A8W1I=F%T92!B969OF5D*'-T;W!296%D M375T97 at I#0H@(" @(" @(" @(" @>W-T;W!296%D(#T@=')U93M]#0H@(" @ M(" @('-Y;F-H"D-"B @(" @(" @(" @ M("![4]W;F5D M*"D@*0T*(" @(" @("![#0H@(" @(" @(" @("!3>7-T96TN;W5T+G!R:6YT M;&XH(D5R2!I;B!U2P@;&EN92 X-# L M(#@V,0T*+R\@5VEN9&]W7-T96TN;W5T+G!R:6YT;&XH(D5R2!T:&ES(&5X86UP;&4N(BD[#0H@(" @(" @(" @ M("!]#0H@(" @(" @('T@(" @( T*(" @('T-"B\O*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H@(" @+RHJ("HO#0H@(" @<'5B;&EC('-T M871I8R!C;&%SB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@16YA8FQI;F<@=V]R:R!O9B!T:&4@:6Y3 M=')E86T-"@T*(" @(" @(" @(" @('-Y;F-H71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5; M,3 R-%T[#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @ M("!TB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)@T*+R\@0VAE8VMI;F<@:68 at 86)O=70@=&\@8VQO7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@&-E<'1I;VX@ M92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPF5D*'-T;W!70T*(" @(" @(" @(" @>R @(" @(" @(" @(" @(" -"B @(" @ M(" @(" @(" @("!I;G0 at 8R ](# [#0H@(" @(" @(" @(" @(" @=VAI;&4@ M*" H(&,@/2!3>7-T96TN:6XN7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@=W)I=&EN9RXN+B(I.PT*(" @(" @ M(" @(" @(" @(" @(" @(" @8G)E86L[#0H@(" @(" @(" @(" @(" @(" @ M('T-"B @(" @(" @(" @(" @(" @(" @=&AI&-E<'1I;VX at 92 I#0H@(" @ M(" @(" @("![#0H@(" @(" @(" @(" @(" @92YP" H1$(Y M("T@<&EN(#(@8V]N;F5C=&5D('1O(#,I("!D871A('=I;&P@ T*(" @(" @("!3=')I;F<@<&]R=$YA;64@ M/2 B+V1E=B]T='E54T(P(CL-"@T*+R\@36%C#0HO+U-T3\_/S\_/S\_(CL-"@T*(" @(" @("!TPT*(" @(" @(" @(" @5-E2 at I("T at 4G5N=&EM92YG9712=6YT:6UE*"DN9G)E94UE;6]R>2 at I*2D[ M#0H@(" @(" @(" @4WES=&5M+F]U="YPPT*(" @(" @("!3>7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!O M<&5N*"DN+BXB("L@<&]R=$YA;64I.PT*(" @(" @("!T7-T96TN;W5T+G!R:6YT;&XH(E=A:71I;F7-T96TN;W5T+G!R:6YT;&XH92YT M;U-T0T*(" @(" @("![#0H@(" @(" @(" @(" @&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @92YP M&ET*# I.PT*(" @('T-"GT-"@`` ` end From nate at n4te.com Fri Nov 27 17:09:50 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:09:50 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> 2009/11/26 Ivan Maidanski : > Nate wrote: >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). Please see the attached patch for the Java changes. I didn't update the build scripts, I'm fine with just renaming the libs myself for now. After some thought, I decided since the sun.arch.data.model property is unreliable, being Sun JVM specific, so I settled on loading the 32-bit lib by default and trying the 64-bit lib if that fails. The patch also sets "devel" to false in RXTXCommDriver. I strongly believe a third party library should not be hardcoded to dump to System.out, especially when nothing is wrong. If I want to dump the rxtx version to System.out, I can write one line of code to do so (ASCII art is certainly not needed). -Nate -------------- next part -------------- A non-text attachment was scrubbed... Name: nativeLib.patch Type: application/octet-stream Size: 2700 bytes Desc: not available URL: From nate at n4te.com Fri Nov 27 17:12:24 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:12:24 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: <7d6ffee60911271612u4f3830aam295c56fe6c93e277@mail.gmail.com> On Fri, Nov 27, 2009 at 7:48 AM, Trent Jarvi wrote: > The 64/32 bit library is one issue. There is also an issue binaries that > can run on multiple archs. > > http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ > > This can be complicated by libc sources/versions ... > > At first glance, it would appear reasonable to modify the library name or > path. When I think about it, the better approach is to make sure the > libraries load in an intuitive way when installed alone for the novice and > leave the multiple arch/os support problem as an exercise for the > implementor as they will have an advanced skill set (and hopefully a nice > wiki page helping them). Ideally rxtx could be shipped with all the native libs and it would know how to pick the appropriate one. This way it can be kept up to date by the rxtx project rather than each user with this need maintain their own loading code. That said, if no one actually has this need, I don't see a problem with waiting for the first person to implement it, then absorbing it into the rxtx project. IMO, the next best thing is to at least handle the most common case, which is 32/64-bit. -Nate From ivmai at mail.ru Sat Nov 28 00:48:05 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 10:48:05 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: Hi! Nate wrote: > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> What do you think about supporting both 32 bit and 64 bit DLLs, with > >> the correct one chosen at runtime? This way I don't need two separate > >> versions of my app. > > > > I think it would be good. I think this should be implemented as follows: > > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > Please see the attached patch for the Java changes. I didn't update > the build scripts, I'm fine with just renaming the libs myself for > now. After some thought, I decided since the sun.arch.data.model > property is unreliable, being Sun JVM specific, so I settled on > loading the 32-bit lib by default and trying the 64-bit lib if that > fails. I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. > > The patch also sets "devel" to false in RXTXCommDriver. I strongly > believe a third party library should not be hardcoded to dump to > System.out, especially when nothing is wrong. If I want to dump the > rxtx version to System.out, I can write one line of code to do so > (ASCII art is certainly not needed). > > -Nate > > ATTACHMENT: application/x-patch (nativeLib.patch) From nate at n4te.com Sat Nov 28 00:55:59 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 23:55:59 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: <7d6ffee60911272355p73e526a0t5c10a7fc4d0f6663@mail.gmail.com> Hi Ivan, 2009/11/27 Ivan Maidanski : > Hi! > Nate wrote: >> 2009/11/26 Ivan Maidanski : >> > Nate wrote: >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> >> the correct one chosen at runtime? This way I don't need two separate >> >> versions of my app. >> > >> > I think it would be good. I think this should be implemented as follows: >> > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); >> > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); >> > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). >> >> Please see the attached patch for the Java changes. I didn't update >> the build scripts, I'm fine with just renaming the libs myself for >> now. After some thought, I decided since the sun.arch.data.model >> property is unreliable, being Sun JVM specific, so I settled on >> loading the 32-bit lib by default and trying the 64-bit lib if that >> fails. > > I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. I meant unreliable in that the property isn't defined by the JVM spec, so may not be available in all JVMs. This means even if it is false, 64-bit must be tried before absolute failure. > The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. Sure. Here is how I would write it, with clarity in mind: static void loadLibrary (String baseName) { if (System.getProperty("sun.arch.data.model", "").equals("64")) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ex64) { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ignored) { throw ex64; } } } else { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ex32) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ignored) { throw ex32; } } } } -Nate >> >> The patch also sets "devel" to false in RXTXCommDriver. I strongly >> believe a third party library should not be hardcoded to dump to >> System.out, especially when nothing is wrong. If I want to dump the >> rxtx version to System.out, I can write one line of code to do so >> (ASCII art is certainly not needed). >> >> -Nate >> >> ATTACHMENT: application/x-patch (nativeLib.patch) > > From ivmai at mail.ru Sat Nov 28 07:26:43 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 17:26:43 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: References: Message-ID: "M.Dec-GMail" wrote: > Hi Ivan, Trent, Steffen, Kapil and all :) > ... > A bit about works of the Ivan and Steffen from last days. > > I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good > idea when RXTXPort is used as a part of the application, but I think that > Trent should accept or not this change. > In my opinion this change does nothing in this case. > If somebody needs serial daemon should do it a level up... I never claimed setDaemon patch would solve the port close problem. It solves "not exiting" a badly-written application problem (I mean an app is returning from main() without calling close() for ports). > ... > Regards > Mariusz Dec From mariusz.dec at gmail.com Sat Nov 28 09:29:04 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 28 Nov 2009 17:29:04 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <536A5B02D18041459E65A4D1182D1374@mdam2> ----- Original Message ----- From: "Ivan Maidanski" To: "rxtx" Sent: Saturday, November 28, 2009 3:26 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > I never claimed setDaemon patch would solve the port close problem. It > solves "not exiting" a badly-written application problem (I mean an app is > returning from main() without calling close() for ports). It was general notice - not about close - but I am sorry - this is my mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. So - your proposal is good, but I have observed that RXTXPort ends work even without close, if application ends with System.exit(0). But in this case - If you will try my example without System.exit(0), program stays in memory and Netbeans says that application runs... This is the case of baddly written application - what in this case? Something is wrong in my techniuqe of subsequent opens? Variables configuration? No finalize of the RXTX port? Maybe this is it. If yes, everything should be changed and my example is workaround only - all threads disconnections should be done during close, inside RXTXPort.java.. Today I have written serial port scanner which is looking for specific external device checking all system serial ports - opening, sending query, closing (this is why I needed working close()). No memory waste, no lost threads in memory, but my application ends with System.exit(0). Workaround works... Regards Mariusz Dec >> ... >> Regards >> Mariusz Dec > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ivmai at mail.ru Sat Nov 28 09:57:33 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 19:57:33 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: <536A5B02D18041459E65A4D1182D1374@mdam2> References: <536A5B02D18041459E65A4D1182D1374@mdam2> Message-ID: "M.Dec-GMail" wrote: > ----- Original Message ----- > From: "Ivan Maidanski" > Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > > > I never claimed setDaemon patch would solve the port close problem. It > > solves "not exiting" a badly-written application problem (I mean an app is > > returning from main() without calling close() for ports). > > It was general notice - not about close - but I am sorry - this is my > mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. > So - your proposal is good, but I have observed that RXTXPort ends work even > without close, if application ends with System.exit(0). That's how exit works by the definition (contrary to returning from main(String[])). > > But in this case - If you will try my example without System.exit(0), > program stays in memory and Netbeans says that application runs... > This is the case of badly written application - what in this case? No, in my case a "badly-written application" is exiting from an app w/o closing ports - this works with the original Sun Comm API but run into a "not exiting" problem with rxtx (unless System.exit is used, of course). > Something is wrong in my technique of subsequent opens? > Variables configuration? > No finalize of the RXTX port? Maybe this is it. Finalizers are not guaranteed to be ever run. > If yes, everything should be changed and my example is workaround only - all > threads disconnections should be done during close, inside RXTXPort.java.. > > Today I have written serial port scanner which is looking for specific > external device checking all system serial ports - opening, sending query, > closing (this is why I needed working close()). > No memory waste, no lost threads in memory, but my application ends with > System.exit(0). > Workaround works... > > Regards > Mariusz Dec At present, I use System.exit(0) in my app to workaround the absence of setDaemon too. Regards, Ovan From mariusz.dec at gmail.com Sun Nov 29 01:01:28 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 09:01:28 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: Hi all, While googling for something, I have found this site: http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ There is a lot about RXTX, and sample works with Events. It differs from original RXTX samples. The only question is - why original samples doesn't work correct and there is no links to real solutions... RXTX project is great but... Regards Mariusz Dec From tjarvi at qbang.org Sun Nov 29 08:57:08 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 29 Nov 2009 08:57:08 -0700 (MST) Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: On Sun, 29 Nov 2009, M.Dec-Gazeta wrote: > Hi all, > While googling for something, I have found this site: > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. > > The only question is - why original samples doesn't work correct and there > is no links to real solutions... > RXTX project is great but... > Hi Mariusz, The rxtx project is far from perfect and needs help from users as well as developers. As you identify problems such as the original samples not doing what you need and missing links to the one you wanted, please do take a moment to edit the page another user created in hopes of helping you. Just remember that the wiki pages are almost entirely sponsored by individuals taking time to fix what bothered them. In the early stages, the concern was no examples. A positive tone is always appreciated. Posting to the mail-list is also appreciated and will make it more likely to attract a developer to sponsor a fix with their efforts. -- Trent Jarvi tjarvi at qbang.org From mariusz.dec at gmail.com Sun Nov 29 11:39:59 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 19:39:59 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <9732BACF0EFD43F3A6B0396ADF0C7811@mdam2> Hi Jarvi, > ...A positive tone is always appreciated. I am very sorry, that you have received my message as something wrong in my mind about your work in this GREAT project. I am very sorry - belive me please. I hope that my work over this close() problem, ready to use example and published later link, shows my FULL POSITIVE thinking about RXTX. Regards Mariusz Dec > > -- > Trent Jarvi > tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Mon Nov 30 04:06:03 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 12:06:03 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Hi, I could not resist to write about how to use InputStream.read(byte[]) because I think this again is an example showing it wrongly. * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. it contains: 259 private byte[] readBuffer = new byte[400]; (I better don't comment on this one here) 272 try { 273 int availableBytes = inStream.available(); 274 if (availableBytes > 0) { 275 // Read the serial port 276 inStream.read(readBuffer, 0, availableBytes); 277 278 // Print it out 279 System.out.println("Recv :" + 280 new String(readBuffer, 0, availableBytes)); 281 } 282 } catch (IOException e) { 283 } I think this is wrong: - exceptions should be ignored never (without even logging) - when code cannot handle an exception, I think it should not catch it (or catch-log-throw) - it assumes 400 bytes are the maximum a serial link can recveive in a read call, but there is no such guarantee by the API - it assumes that read will read availableBytes but there is no such guarantee by API definition - it assumes availableBytes <= readBuffer.length - The STDOUT output depends on timing details (it could happen that in one situation two Recv: lines are printed but in another arbitrary similar situation just one is printed due to different timing details I think InputStream.read(byte[]) is better to be used in a construction like this (assuming it polls based on an event as in the example): // some doReadFunc(): boolean eof = false; int chunkSize = 128; byte[] readData = new byte[0]; while(eof == false && inStream.available()) { byte[] readBuf = new byte[chunkSize]; // available() guaranteed read will not block, but // we may read more than available bytes here (in case more were // received) or less than (if read returns earlier, which is // allowed by spec) - but at least 1. int thisRead = inStream.read(readBuffer, 0, readBuf.length); if (thisRead == -1) { // Please note that we cannot throw here // if (readData.length() > 0), // because caller would not see the contents of readData. // But we could throw in case readData is empty. eof = true; } else { // Now we need a "readData += readBuffer;". // Don't know if this really is so uncomfortable on Java or if I // just don't know how to do it better. This commonly should be // in some appendBuffer helper function (doing realloc + 2copy) byte[]tmpBuf = new byte[readData.length + thisRead]; // assert(readData.length + thisRead == totalRead); System.arraycopy(readData, 0, tmpBuf, 0, readData.length); System.arraycopy(readBuf, 0, tmpBuf, readData.length, thisRead); readData = tmpBuf; } } // readData contains the data that could be read. It could be empty/zero // in case no bytes available(), but it blocks never. It could be that exactly at the time when inStream.available() returned zero a new byte arrives, so typically someone will need to have a message parsing loop around (or integrated) - usually it is easier to try to read what is needed and timeout otherwise (in contrast to read what is avialable and then guess if could be complete by timing). Simple example could be: // has methods "boolean isComplete()" and "int bytesNeeded()". BinaryMessage message; while(!message.isComplete() && !timer.isExpired() ) { // doRead(InputStream, int len) which does NOT BLOCK but return zero // in case there is no data avialable() byte[] readData = doRead(input, message.bytesNeeded()); // we should not poll. With Java InputStream it is hard to handle, // because avialable() has no timeout parameter. We can use small // delays to convert this spinlock to a 20 ms poll which works when // having a few connections only but wastes resources. Better would // be to synchronize with some events such as // SerialPortEvent.DATA_AVAILABLE, but this makes this code depend // on SerialPort (otherwise, it would work on ANY InputStream which // IMHO should be the reason why InputStream exists, but this is // off-topic here) } if (timer.isExpired()) { // handle timeout } // else assert(message.isComplete()); Exceptions could be handled in a way like: String portName = "/dev/ttyS0"; // pseudo code: SerialPort port = SerialPort.open(portName); try { try { thisRead = port.is.read(); if (thisRead == -1) { if (readData.length == 0) { throw new ConnectionClosedByPeerException(); } } } catch {IOException ioex) { CommException ex = new CommIOException(ioex); ex.appendInfo("while reading"); } } catch (CommException ex) { // Instead of the read call above probably we call a method working // on InputStream. This function cannot know the portName, but for // the user this is very important. Because of this we add the // information. We do this on each level/layer: our caller appends // why the port were read (e.g. "while initilizing modem" or // "quering thermometer sensor") and so on. The user then can get a // message like // unexpected DCD drop (carrier lost) while reading /dev/ttyS0 for // Modem communication while sending file UPLOAD.DAT for module // DataReconciliation triggered by Cron Call "Daily Reconciliation" // by application "My Monitor". // much better than "IOException in IO.java:1234"! // They are intended to include ANY information needed to resolve the // issue (without needing complete logs maybe even with // version-dependent stack dumps, which would be horrible). CommException ex = new CommIOException(ioex); ex.appendInfo(" on port " + portName); } Comments, corrections and critics are appreciated! oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 04:50:40 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 12:50:40 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Message-ID: <17E538BC24EE42EC89F5BB086205F581@mdam2> ----- Original Message ----- From: "Steffen DETTMER" To: "rxtx" Sent: Monday, November 30, 2009 12:06 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > Hi, > > I could not resist to write about how to use InputStream.read(byte[]) > because I think this again is an example showing it wrongly. > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: >> http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ >> >> There is a lot about RXTX, and sample works with Events. >> It differs from original RXTX samples. > I didn't checked this sample befor posting, and I did missusage of the word "works". Sorry, should be "sample prepared for Events". Yesterday afteroon I have checked this technique in XP only, but I have had problems and have switched to other tasks. Steffen, please attach your new complete example to be sure no errors while changing and please let me know in which platform you have tested it. I will check it on my systems. Maybe this is a platform problem? Why I think so: My sample works in Windows and Linux, but in real application I have detected problem with Linux. In old systems we have had hard list of the serial ports, but now user may connect and disconnect USB-Serial dongle while application is running. Effects are clear... We (developers) have to be ready to serve it. And therefore I have an configuration form where user may check device, find it automatically or declare manually COM (dev/tty...) device. Before each auto-looking for my specific device I have (I should) to re-read available ports (I have the button to manually refresh list of the ports as well). In XP and Vista it works very good. No one crash in 5 hours when I was doing that!!! But in Linux (newest Ubuntu) there is a problem. Doing an enumeration of the devices when RXTX driver was previousluy used, places new instance of the RXTXDriver in the memory: CommPortIdentifier.java, line 327. When this action occurs, IOLocked stays 2, previously used device is not visible even if was correctly closed! Application hangs, but I don't know yet where - earlier it was read loop. Now I have to do some other things, later I will go back to problem. Regards Mariusz From oliverhoffmann32 at googlemail.com Mon Nov 30 08:07:31 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 16:07:31 +0100 Subject: [Rxtx] RXTX for ttyACM0 Message-ID: <200911301607.31300.oliverhoffmann32@googlemail.com> Hi RXTX Crew! I'm currently writing a small application which uses RXTX to communicate with an USB device: ... usb 1-10: new full speed USB device using ohci_hcd and address 3 usb 1-10: configuration #1 chosen from 1 choice cdc_acm 1-10:1.0: This device cannot do calls on its own. It is not a modem. cdc_acm 1-10:1.0: ttyACM0: USB ACM device usbcore: registered new interface driver cdc_acm cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters ... If I use cutecom I can open a connection to /dev/ttyACM0 without any problems, but CommPortIdentifier.getPortIdentifiers() from RXTX only lists some ttyS[0-9] devices. The only way I found is symlinking ttyACM0 to for example ttyS3, so i wonder if there's any better way (like if the user doesn't have write-access to /dev). Greatings, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 08:35:56 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:35:56 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <200911301607.31300.oliverhoffmann32@googlemail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> Message-ID: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> 2009/11/30 Oliver Hoffmann > Hi RXTX Crew! > > I'm currently writing a small application which uses RXTX to communicate > with > an USB device: > ... > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > wonder > if there's any better way (like if the user doesn't have write-access to > /dev). > To avoid this naming problem between systems and implementations of the USB-RS naming conventions I did it what you may see below. You may identify system elsewhere (isMac, isWindows, isLinux) and read appriorate prefixes from an INI file etc. So user may change their prefixes without changing application! Note that you have to look for ALL system ports, not serial only and do filtering yourself. In RXTXCommDriver.java you may change port candidates porefixes if you would like to change sources of the RXTX. If not - my example works fine. Regards Mariusz Dec /* * * @author Mariusz Dec * September 2009 */ import gnu.io.CommPortIdentifier; import java.util.Enumeration; import javax.swing.DefaultListModel; public class CommPortLister { public static String comPortsWindows = "COM"; public static String comPortsMacintosh1 = "/dev/tty"; public static String comPortsMacintosh2 = "/dev/cu"; public static String comPortsLinux1 = "/dev/usb/tty"; public static String comPortsLinux2 = "/dev/tty"; public DefaultListModel listCom() { Enumeration ports = CommPortIdentifier.getPortIdentifiers(); DefaultListModel pList = null; String pName = ""; String pStart1 = ""; String pStart2 = ""; pList = new DefaultListModel(); while(ports.hasMoreElements()) { pName = ((CommPortIdentifier)ports.nextElement()).getName(); if (isWindows) { pStart1 = comPortsWindows; pStart2 = "------"; } else if (isMac) { pStart1 = comPortsMacintosh1; pStart2 = comPortsMacintosh2; } else if (isLinux) { pStart1 = comPortsLinux1; pStart2 = comPortsLinux2; } if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) { pList.addElement(pName); } } return pList; } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Nov 30 08:40:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 16:40:13 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <17E538BC24EE42EC89F5BB086205F581@mdam2> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> Message-ID: <20091130154013.GL20226@elberon.bln.de.ingenico.com> * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100: > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > > > > > There is a lot about RXTX, and sample works with Events. > > > It differs from original RXTX samples. > > I didn't checked this sample befor posting, and I did missusage of the word > "works". Sorry, should be "sample prepared for Events". no problem. I did neither intend to critice you nor the example; I did not even read what it demonstrates (I think it is not an example how to use read in best way). Maybe I just wanted to start an example :) Also I think that this example will work (ie. print something) in most cases! I'm just afraid people could start some prototype of their apps based on it, then improve here and there and finally have some server application with rare strange failures. > Steffen, please attach your new complete example to be sure no > errors while changing and please let me know in which platform > you have tested it. I will check it on my systems. You ask me to write a complete compiling example? mmm... maybe I could take some time this week to do so, but first I would like to ensure that it is correct. We had discussions about it in the past and there were many details to consider; easy to fall in a trap. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 08:59:47 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:59:47 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <20091130154013.GL20226@elberon.bln.de.ingenico.com> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> <20091130154013.GL20226@elberon.bln.de.ingenico.com> Message-ID: <73a89f360911300759l63335522sb16bc254a4d0ebb2@mail.gmail.com> 2009/11/30 Steffen DETTMER > * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100:> you have tested > it. I will check it on my systems. > > You ask me to write a complete compiling example? > Yes, if you did it.. BTW: I have analysed your mail and In the meantime I have solved problem in my application on Linux It was a mistake while copying sources between machines... hrrrr.. Returning to your work - like in each realtime and/or physical interfaces, timing may generate problems, especially with USB. Few months ago I have seen time critical application transferred to USB-RS232 dongle. Crazy results... USB is polling data, no interrupts... My new experience: My desktop XP is very fast, Vista and Ubuntu are on slower notebook. For Vista and Win RXTX.dll computer speed is enough but for Linux I have observed that rereshing ports list in the program sequence: disonnect(curPort); porstList = refreshPortsList(); returns portsList WITHOUT curPort... It means that curPort returns on the available ports list in system with delay after close(). This is not big problem, but a bit frustrating - I do not like to add delays everywhere... Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliverhoffmann32 at googlemail.com Mon Nov 30 09:10:15 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 17:10:15 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> Message-ID: <200911301710.16126.oliverhoffmann32@googlemail.com> On Monday 30 November 2009 16:35:56 Mariusz Dec wrote: > 2009/11/30 Oliver Hoffmann > > > Hi RXTX Crew! > > > > I'm currently writing a small application which uses RXTX to communicate > > with > > an USB device: > > ... > > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > > wonder > > if there's any better way (like if the user doesn't have write-access to > > /dev). > > To avoid this naming problem between systems and implementations of the > USB-RS naming conventions I did it what you may see below. > You may identify system elsewhere (isMac, isWindows, isLinux) and read > appriorate prefixes from an INI file etc. > So user may change their prefixes without changing application! > > Note that you have to look for ALL system ports, not serial only and do > filtering yourself. > > In RXTXCommDriver.java you may change port candidates porefixes if you > would like to change sources of the RXTX. > If not - my example works fine. > > Regards > Mariusz Dec > > /* > * > * @author Mariusz Dec > * September 2009 > */ > > import gnu.io.CommPortIdentifier; > > import java.util.Enumeration; > import javax.swing.DefaultListModel; > > public class CommPortLister { > > public static String comPortsWindows = "COM"; > public static String comPortsMacintosh1 = "/dev/tty"; > public static String comPortsMacintosh2 = "/dev/cu"; > public static String comPortsLinux1 = "/dev/usb/tty"; > public static String comPortsLinux2 = "/dev/tty"; > > > public DefaultListModel listCom() { > Enumeration ports = CommPortIdentifier.getPortIdentifiers(); > DefaultListModel pList = null; > String pName = ""; > String pStart1 = ""; > String pStart2 = ""; > pList = new DefaultListModel(); > while(ports.hasMoreElements()) > { > pName = ((CommPortIdentifier)ports.nextElement()).getName(); > > if (isWindows) > { > pStart1 = comPortsWindows; > pStart2 = "------"; > } > else > if (isMac) > { > pStart1 = comPortsMacintosh1; > pStart2 = comPortsMacintosh2; > } > else > if (isLinux) > { > pStart1 = comPortsLinux1; > pStart2 = comPortsLinux2; > } > > if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) > { > pList.addElement(pName); > } > } > return pList; > } > } > This wouldn't work because the list of CommPortIdentifier.getPortIdentifiers() is already filtered, so I would have to change the "CandidatePortPrefixes" list in RXTXCommDriver as you said. But after looking through the sourcecode I found that setting gnu.io.rxtx.SerialPorts to "/dev/ttyACM0" solved the problem. Sure it's not the nicest way but at leats it works. Maybe adding "ttyACM" to the list in RXTXCommDriver.java:521 is a more permanent solution. Regards, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 10:57:04 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 18:57:04 +0100 Subject: [Rxtx] RXTX for ttyACM0 References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> <200911301710.16126.oliverhoffmann32@googlemail.com> Message-ID: <09AC73AA7B22418BBCD1297A2D85A033@mdam2> > > This wouldn't work because the list of > CommPortIdentifier.getPortIdentifiers() > is already filtered, so I would have to change the > "CandidatePortPrefixes" list > in RXTXCommDriver as you said. It works in Windows from several months...., sorry Mariusz From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From nate at n4te.com Thu Nov 26 14:32:21 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 13:32:21 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Ah, thanks Ivan. What do you think about supporting both 32 bit and 64 bit DLLs, with the correct one chosen at runtime? This way I don't need two separate versions of my app. -Nate 2009/11/26 Ivan Maidanski : > Nate wrote: >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >> I see a user has come up with a workaround for 64 bit OS X. Has anyone >> done this for Windows? Are there plans to support 64 bit Windows? > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > >> >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >> Other open source projects such as LWJGL (http://lwjgl.org/) include >> both 32 and 64 bit native libs and the correct lib is automatically >> used. >> >> -Nate > > From ivmai at mail.ru Thu Nov 26 14:52:53 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Fri, 27 Nov 2009 00:52:53 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan From Kapil_Gupta at hcl.in Thu Nov 26 22:47:13 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 27 Nov 2009 11:17:13 +0530 Subject: [Rxtx] Rxtx Digest, Vol 27, Issue 7 In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960FDD2F38A@NDA-HCLT-EVS05.HCLT. CORP.HCL.IN-F0913EFA-B2A5-28E5-3684-11AABE813CF9> Hi, I am also facing the same issue as Mariusz is facing, I am facing it on Intel Mac 10.5.8. I am using RXTX 2.2 Pre binaries. First time I am able to read the data from my device, but second time port open hangs (RXTXPort.java). I am using TI chip set in my device. I created a C sample to test the driver but that works perfectly to read device any number of times. No hangs !! Note: My sample works fine on Windows XP. Please help. Thanks, Kapil -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Thursday, November 26, 2009 6:50 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 27, Issue 7 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! (M.Dec-GMail) 2. Re: Patch adding monThread setDaemon (Steffen DETTMER) 3. Re: Patch adding monThread setDaemon (Ivan Maidanski) 4. Patch for WinCE readArray (Ivan Maidanski) 5. Re: Patch adding monThread setDaemon (Ivan Maidanski) 6. Re: SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! (Ivan Maidanski) 7. Re: Patch adding monThread setDaemon (Trent Jarvi) 8. 64 bit (Nate) 9. Re: 64 bit (Ivan Maidanski) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Nov 2009 20:23:54 +0100 From: "M.Dec-GMail" To: Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2 at mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end ------------------------------ Message: 2 Date: Mon, 23 Nov 2009 22:26:36 +0100 From: "Steffen DETTMER" To: "rxtx" Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset="utf-8" > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail ------------------------------ Message: 3 Date: Tue, 24 Nov 2009 10:36:34 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 4 Date: Tue, 24 Nov 2009 22:26:00 +0300 From: Ivan Maidanski To: rxtx Subject: [Rxtx] Patch for WinCE readArray Message-ID: Content-Type: text/plain; charset="koi8-r" Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: ------------------------------ Message: 5 Date: Tue, 24 Nov 2009 22:33:41 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 6 Date: Tue, 24 Nov 2009 22:38:40 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! Message-ID: Content-Type: text/plain; charset=koi8-r Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) ------------------------------ Message: 7 Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) From: Trent Jarvi To: Ivan Maidanski Cc: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------ Message: 8 Date: Thu, 26 Nov 2009 05:08:27 -0800 From: Nate To: rxtx at qbang.org Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate ------------------------------ Message: 9 Date: Thu, 26 Nov 2009 16:24:21 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] 64 bit Message-ID: Content-Type: text/plain; charset=koi8-r Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate ------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx End of Rxtx Digest, Vol 27, Issue 7 *********************************** DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From m.kirkland at comcast.net Fri Nov 27 01:56:33 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 27 Nov 2009 00:56:33 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Or you could try the following utility which will modify the native library search path at run time based on the os.name and os.arch system properties. http://hamware.info/tools/LibLoader.zip Read the comments in the code and the properties file for details. Mike -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Ivan Maidanski Sent: Thursday, November 26, 2009 1:53 PM To: rxtx Subject: Re: [Rxtx] 64 bit Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri Nov 27 08:48:41 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 27 Nov 2009 08:48:41 -0700 (MST) Subject: [Rxtx] 64 bit In-Reply-To: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: I've used the native library search path to solve the problem in the past. The 64/32 bit library is one issue. There is also an issue binaries that can run on multiple archs. http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ This can be complicated by libc sources/versions ... At first glance, it would appear reasonable to modify the library name or path. When I think about it, the better approach is to make sure the libraries load in an intuitive way when installed alone for the novice and leave the multiple arch/os support problem as an exercise for the implementor as they will have an advanced skill set (and hopefully a nice wiki page helping them). On Fri, 27 Nov 2009, Mike Kirkland wrote: > Or you could try the following utility which will modify the native library > search path at run time based on the os.name and os.arch system properties. > > http://hamware.info/tools/LibLoader.zip > > Read the comments in the code and the properties file for details. > > Mike > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Ivan Maidanski > Sent: Thursday, November 26, 2009 1:53 PM > To: rxtx > Subject: Re: [Rxtx] 64 bit > > Hi! > Nate wrote: >> Ah, thanks Ivan. >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String > basename) which if sun.arch.data.model property is defined and equals "64" > then first tries to load basename+"64" library otherwize (if not 64 or > failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with > RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" > for 64-bit targets (optionally, if needed). > >> >> -Nate >> >> >> 2009/11/26 Ivan Maidanski : >>> Nate wrote: >>>> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >>>> I see a user has come up with a workaround for 64 bit OS X. Has anyone >>>> done this for Windows? Are there plans to support 64 bit Windows? >>> >>> rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily > rebuild it from the sources using e.g. mingw-w64.) >>> >>>> >>>> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >>>> Other open source projects such as LWJGL (http://lwjgl.org/) include >>>> both 32 and 64 bit native libs and the correct lib is automatically >>>> used. > > Best regards, > Ivan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Fri Nov 27 13:55:55 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Fri, 27 Nov 2009 21:55:55 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved Message-ID: Hi Ivan, Trent, Steffen, Kapil and all :) I have found a method how to close() and reopen RXTX serial port without problems. This is done on the rxtx-2.2pre2 version, but I think that it should work on earlier versions as well. I have tested it on Windows XP, Vista and Linux, Ubuntu distribution. On Windows XP it works on native UART and VCP, on Vista and Ubuntu I haven't native UART, so I have tested it with USB-RS232 VCP from FTDI. There is NO code changes in Java and C, this is only better external service of the processes between Java threads and native interface. I have found it looking in the code and tracing Java in Netbeans 6.7.1. using printouts from C part - #define TRENT_IS_HERE :) Attached file - TwoWaySerialCommMd.java is derived from the original TwoWaySerialComm.java but works a bit better :). Important comments are inside the file. I hope Kapil answers what about Macintosh but it should looks like in Linux. A bit about works of the Ivan and Steffen form last days. I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good idea when RXTXPort is used as a part of the application, but I think that Trent should accept or not this change. In my opinion this change does nothing in this case. If somebody needs serial daemon should do it a level up... Especially to Trent: 1. I have read a lot about synchronisation and in my opinion monThreadMutex in RXTXPort.java should be declared as final, the same with Sync in CommPortIdentifier. 2. Please check this example and, if this is good, add it to official examples of the RXTX. ABOUT EVENTS In my application I have checked events as well, but they works to slow for me - to big delay - I don't know why. Finally, I have decided to generate my own Exception when data from inStream is collected and proper parsed (I need packs of bytes). Exception transfers data to rest of the application. The only disadvantage is ASCII model of the data which may be transferred through Exception, but for me its enough. Therefore I don't know what to do with SerialEvent of the RXTX - I have found questions about the same problem with close() while using Events. Maybe somebody wiil solve this problem using my job. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M+R\F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8-"B\O)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F#0HO+R!(;W<@=&\@=7-E(%)8 M5%A397)I86Q0;W)T#0HO+R!">2!-87)I=7-Z($1E8RP at 4&]L86YD#0HO+R!. M;W9E;6)E5-EB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@<')E<&%R:6YG(&EN4W1R96%M(&%N9"!O M=713=')E86T@=&\@9&5A8W1I=F%T92!B969OF5D*'-T;W!296%D M375T97 at I#0H@(" @(" @(" @(" @>W-T;W!296%D(#T@=')U93M]#0H@(" @ M(" @('-Y;F-H"D-"B @(" @(" @(" @ M("![4]W;F5D M*"D@*0T*(" @(" @("![#0H@(" @(" @(" @("!3>7-T96TN;W5T+G!R:6YT M;&XH(D5R2!I;B!U2P@;&EN92 X-# L M(#@V,0T*+R\@5VEN9&]W7-T96TN;W5T+G!R:6YT;&XH(D5R2!T:&ES(&5X86UP;&4N(BD[#0H@(" @(" @(" @ M("!]#0H@(" @(" @('T@(" @( T*(" @('T-"B\O*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H@(" @+RHJ("HO#0H@(" @<'5B;&EC('-T M871I8R!C;&%SB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@16YA8FQI;F<@=V]R:R!O9B!T:&4@:6Y3 M=')E86T-"@T*(" @(" @(" @(" @('-Y;F-H71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5; M,3 R-%T[#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @ M("!TB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)@T*+R\@0VAE8VMI;F<@:68 at 86)O=70@=&\@8VQO7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@&-E<'1I;VX@ M92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPF5D*'-T;W!70T*(" @(" @(" @(" @>R @(" @(" @(" @(" @(" -"B @(" @ M(" @(" @(" @("!I;G0 at 8R ](# [#0H@(" @(" @(" @(" @(" @=VAI;&4@ M*" H(&,@/2!3>7-T96TN:6XN7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@=W)I=&EN9RXN+B(I.PT*(" @(" @ M(" @(" @(" @(" @(" @(" @8G)E86L[#0H@(" @(" @(" @(" @(" @(" @ M('T-"B @(" @(" @(" @(" @(" @(" @=&AI&-E<'1I;VX at 92 I#0H@(" @ M(" @(" @("![#0H@(" @(" @(" @(" @(" @92YP" H1$(Y M("T@<&EN(#(@8V]N;F5C=&5D('1O(#,I("!D871A('=I;&P@ T*(" @(" @("!3=')I;F<@<&]R=$YA;64@ M/2 B+V1E=B]T='E54T(P(CL-"@T*+R\@36%C#0HO+U-T3\_/S\_/S\_(CL-"@T*(" @(" @("!TPT*(" @(" @(" @(" @5-E2 at I("T at 4G5N=&EM92YG9712=6YT:6UE*"DN9G)E94UE;6]R>2 at I*2D[ M#0H@(" @(" @(" @4WES=&5M+F]U="YPPT*(" @(" @("!3>7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!O M<&5N*"DN+BXB("L@<&]R=$YA;64I.PT*(" @(" @("!T7-T96TN;W5T+G!R:6YT;&XH(E=A:71I;F7-T96TN;W5T+G!R:6YT;&XH92YT M;U-T0T*(" @(" @("![#0H@(" @(" @(" @(" @&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @92YP M&ET*# I.PT*(" @('T-"GT-"@`` ` end From nate at n4te.com Fri Nov 27 17:09:50 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:09:50 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> 2009/11/26 Ivan Maidanski : > Nate wrote: >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). Please see the attached patch for the Java changes. I didn't update the build scripts, I'm fine with just renaming the libs myself for now. After some thought, I decided since the sun.arch.data.model property is unreliable, being Sun JVM specific, so I settled on loading the 32-bit lib by default and trying the 64-bit lib if that fails. The patch also sets "devel" to false in RXTXCommDriver. I strongly believe a third party library should not be hardcoded to dump to System.out, especially when nothing is wrong. If I want to dump the rxtx version to System.out, I can write one line of code to do so (ASCII art is certainly not needed). -Nate -------------- next part -------------- A non-text attachment was scrubbed... Name: nativeLib.patch Type: application/octet-stream Size: 2700 bytes Desc: not available URL: From nate at n4te.com Fri Nov 27 17:12:24 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:12:24 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: <7d6ffee60911271612u4f3830aam295c56fe6c93e277@mail.gmail.com> On Fri, Nov 27, 2009 at 7:48 AM, Trent Jarvi wrote: > The 64/32 bit library is one issue. There is also an issue binaries that > can run on multiple archs. > > http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ > > This can be complicated by libc sources/versions ... > > At first glance, it would appear reasonable to modify the library name or > path. When I think about it, the better approach is to make sure the > libraries load in an intuitive way when installed alone for the novice and > leave the multiple arch/os support problem as an exercise for the > implementor as they will have an advanced skill set (and hopefully a nice > wiki page helping them). Ideally rxtx could be shipped with all the native libs and it would know how to pick the appropriate one. This way it can be kept up to date by the rxtx project rather than each user with this need maintain their own loading code. That said, if no one actually has this need, I don't see a problem with waiting for the first person to implement it, then absorbing it into the rxtx project. IMO, the next best thing is to at least handle the most common case, which is 32/64-bit. -Nate From ivmai at mail.ru Sat Nov 28 00:48:05 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 10:48:05 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: Hi! Nate wrote: > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> What do you think about supporting both 32 bit and 64 bit DLLs, with > >> the correct one chosen at runtime? This way I don't need two separate > >> versions of my app. > > > > I think it would be good. I think this should be implemented as follows: > > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > Please see the attached patch for the Java changes. I didn't update > the build scripts, I'm fine with just renaming the libs myself for > now. After some thought, I decided since the sun.arch.data.model > property is unreliable, being Sun JVM specific, so I settled on > loading the 32-bit lib by default and trying the 64-bit lib if that > fails. I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. > > The patch also sets "devel" to false in RXTXCommDriver. I strongly > believe a third party library should not be hardcoded to dump to > System.out, especially when nothing is wrong. If I want to dump the > rxtx version to System.out, I can write one line of code to do so > (ASCII art is certainly not needed). > > -Nate > > ATTACHMENT: application/x-patch (nativeLib.patch) From nate at n4te.com Sat Nov 28 00:55:59 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 23:55:59 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: <7d6ffee60911272355p73e526a0t5c10a7fc4d0f6663@mail.gmail.com> Hi Ivan, 2009/11/27 Ivan Maidanski : > Hi! > Nate wrote: >> 2009/11/26 Ivan Maidanski : >> > Nate wrote: >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> >> the correct one chosen at runtime? This way I don't need two separate >> >> versions of my app. >> > >> > I think it would be good. I think this should be implemented as follows: >> > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); >> > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); >> > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). >> >> Please see the attached patch for the Java changes. I didn't update >> the build scripts, I'm fine with just renaming the libs myself for >> now. After some thought, I decided since the sun.arch.data.model >> property is unreliable, being Sun JVM specific, so I settled on >> loading the 32-bit lib by default and trying the 64-bit lib if that >> fails. > > I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. I meant unreliable in that the property isn't defined by the JVM spec, so may not be available in all JVMs. This means even if it is false, 64-bit must be tried before absolute failure. > The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. Sure. Here is how I would write it, with clarity in mind: static void loadLibrary (String baseName) { if (System.getProperty("sun.arch.data.model", "").equals("64")) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ex64) { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ignored) { throw ex64; } } } else { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ex32) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ignored) { throw ex32; } } } } -Nate >> >> The patch also sets "devel" to false in RXTXCommDriver. I strongly >> believe a third party library should not be hardcoded to dump to >> System.out, especially when nothing is wrong. If I want to dump the >> rxtx version to System.out, I can write one line of code to do so >> (ASCII art is certainly not needed). >> >> -Nate >> >> ATTACHMENT: application/x-patch (nativeLib.patch) > > From ivmai at mail.ru Sat Nov 28 07:26:43 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 17:26:43 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: References: Message-ID: "M.Dec-GMail" wrote: > Hi Ivan, Trent, Steffen, Kapil and all :) > ... > A bit about works of the Ivan and Steffen from last days. > > I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good > idea when RXTXPort is used as a part of the application, but I think that > Trent should accept or not this change. > In my opinion this change does nothing in this case. > If somebody needs serial daemon should do it a level up... I never claimed setDaemon patch would solve the port close problem. It solves "not exiting" a badly-written application problem (I mean an app is returning from main() without calling close() for ports). > ... > Regards > Mariusz Dec From mariusz.dec at gmail.com Sat Nov 28 09:29:04 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 28 Nov 2009 17:29:04 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <536A5B02D18041459E65A4D1182D1374@mdam2> ----- Original Message ----- From: "Ivan Maidanski" To: "rxtx" Sent: Saturday, November 28, 2009 3:26 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > I never claimed setDaemon patch would solve the port close problem. It > solves "not exiting" a badly-written application problem (I mean an app is > returning from main() without calling close() for ports). It was general notice - not about close - but I am sorry - this is my mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. So - your proposal is good, but I have observed that RXTXPort ends work even without close, if application ends with System.exit(0). But in this case - If you will try my example without System.exit(0), program stays in memory and Netbeans says that application runs... This is the case of baddly written application - what in this case? Something is wrong in my techniuqe of subsequent opens? Variables configuration? No finalize of the RXTX port? Maybe this is it. If yes, everything should be changed and my example is workaround only - all threads disconnections should be done during close, inside RXTXPort.java.. Today I have written serial port scanner which is looking for specific external device checking all system serial ports - opening, sending query, closing (this is why I needed working close()). No memory waste, no lost threads in memory, but my application ends with System.exit(0). Workaround works... Regards Mariusz Dec >> ... >> Regards >> Mariusz Dec > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ivmai at mail.ru Sat Nov 28 09:57:33 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 19:57:33 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: <536A5B02D18041459E65A4D1182D1374@mdam2> References: <536A5B02D18041459E65A4D1182D1374@mdam2> Message-ID: "M.Dec-GMail" wrote: > ----- Original Message ----- > From: "Ivan Maidanski" > Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > > > I never claimed setDaemon patch would solve the port close problem. It > > solves "not exiting" a badly-written application problem (I mean an app is > > returning from main() without calling close() for ports). > > It was general notice - not about close - but I am sorry - this is my > mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. > So - your proposal is good, but I have observed that RXTXPort ends work even > without close, if application ends with System.exit(0). That's how exit works by the definition (contrary to returning from main(String[])). > > But in this case - If you will try my example without System.exit(0), > program stays in memory and Netbeans says that application runs... > This is the case of badly written application - what in this case? No, in my case a "badly-written application" is exiting from an app w/o closing ports - this works with the original Sun Comm API but run into a "not exiting" problem with rxtx (unless System.exit is used, of course). > Something is wrong in my technique of subsequent opens? > Variables configuration? > No finalize of the RXTX port? Maybe this is it. Finalizers are not guaranteed to be ever run. > If yes, everything should be changed and my example is workaround only - all > threads disconnections should be done during close, inside RXTXPort.java.. > > Today I have written serial port scanner which is looking for specific > external device checking all system serial ports - opening, sending query, > closing (this is why I needed working close()). > No memory waste, no lost threads in memory, but my application ends with > System.exit(0). > Workaround works... > > Regards > Mariusz Dec At present, I use System.exit(0) in my app to workaround the absence of setDaemon too. Regards, Ovan From mariusz.dec at gmail.com Sun Nov 29 01:01:28 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 09:01:28 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: Hi all, While googling for something, I have found this site: http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ There is a lot about RXTX, and sample works with Events. It differs from original RXTX samples. The only question is - why original samples doesn't work correct and there is no links to real solutions... RXTX project is great but... Regards Mariusz Dec From tjarvi at qbang.org Sun Nov 29 08:57:08 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 29 Nov 2009 08:57:08 -0700 (MST) Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: On Sun, 29 Nov 2009, M.Dec-Gazeta wrote: > Hi all, > While googling for something, I have found this site: > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. > > The only question is - why original samples doesn't work correct and there > is no links to real solutions... > RXTX project is great but... > Hi Mariusz, The rxtx project is far from perfect and needs help from users as well as developers. As you identify problems such as the original samples not doing what you need and missing links to the one you wanted, please do take a moment to edit the page another user created in hopes of helping you. Just remember that the wiki pages are almost entirely sponsored by individuals taking time to fix what bothered them. In the early stages, the concern was no examples. A positive tone is always appreciated. Posting to the mail-list is also appreciated and will make it more likely to attract a developer to sponsor a fix with their efforts. -- Trent Jarvi tjarvi at qbang.org From mariusz.dec at gmail.com Sun Nov 29 11:39:59 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 19:39:59 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <9732BACF0EFD43F3A6B0396ADF0C7811@mdam2> Hi Jarvi, > ...A positive tone is always appreciated. I am very sorry, that you have received my message as something wrong in my mind about your work in this GREAT project. I am very sorry - belive me please. I hope that my work over this close() problem, ready to use example and published later link, shows my FULL POSITIVE thinking about RXTX. Regards Mariusz Dec > > -- > Trent Jarvi > tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Mon Nov 30 04:06:03 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 12:06:03 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Hi, I could not resist to write about how to use InputStream.read(byte[]) because I think this again is an example showing it wrongly. * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. it contains: 259 private byte[] readBuffer = new byte[400]; (I better don't comment on this one here) 272 try { 273 int availableBytes = inStream.available(); 274 if (availableBytes > 0) { 275 // Read the serial port 276 inStream.read(readBuffer, 0, availableBytes); 277 278 // Print it out 279 System.out.println("Recv :" + 280 new String(readBuffer, 0, availableBytes)); 281 } 282 } catch (IOException e) { 283 } I think this is wrong: - exceptions should be ignored never (without even logging) - when code cannot handle an exception, I think it should not catch it (or catch-log-throw) - it assumes 400 bytes are the maximum a serial link can recveive in a read call, but there is no such guarantee by the API - it assumes that read will read availableBytes but there is no such guarantee by API definition - it assumes availableBytes <= readBuffer.length - The STDOUT output depends on timing details (it could happen that in one situation two Recv: lines are printed but in another arbitrary similar situation just one is printed due to different timing details I think InputStream.read(byte[]) is better to be used in a construction like this (assuming it polls based on an event as in the example): // some doReadFunc(): boolean eof = false; int chunkSize = 128; byte[] readData = new byte[0]; while(eof == false && inStream.available()) { byte[] readBuf = new byte[chunkSize]; // available() guaranteed read will not block, but // we may read more than available bytes here (in case more were // received) or less than (if read returns earlier, which is // allowed by spec) - but at least 1. int thisRead = inStream.read(readBuffer, 0, readBuf.length); if (thisRead == -1) { // Please note that we cannot throw here // if (readData.length() > 0), // because caller would not see the contents of readData. // But we could throw in case readData is empty. eof = true; } else { // Now we need a "readData += readBuffer;". // Don't know if this really is so uncomfortable on Java or if I // just don't know how to do it better. This commonly should be // in some appendBuffer helper function (doing realloc + 2copy) byte[]tmpBuf = new byte[readData.length + thisRead]; // assert(readData.length + thisRead == totalRead); System.arraycopy(readData, 0, tmpBuf, 0, readData.length); System.arraycopy(readBuf, 0, tmpBuf, readData.length, thisRead); readData = tmpBuf; } } // readData contains the data that could be read. It could be empty/zero // in case no bytes available(), but it blocks never. It could be that exactly at the time when inStream.available() returned zero a new byte arrives, so typically someone will need to have a message parsing loop around (or integrated) - usually it is easier to try to read what is needed and timeout otherwise (in contrast to read what is avialable and then guess if could be complete by timing). Simple example could be: // has methods "boolean isComplete()" and "int bytesNeeded()". BinaryMessage message; while(!message.isComplete() && !timer.isExpired() ) { // doRead(InputStream, int len) which does NOT BLOCK but return zero // in case there is no data avialable() byte[] readData = doRead(input, message.bytesNeeded()); // we should not poll. With Java InputStream it is hard to handle, // because avialable() has no timeout parameter. We can use small // delays to convert this spinlock to a 20 ms poll which works when // having a few connections only but wastes resources. Better would // be to synchronize with some events such as // SerialPortEvent.DATA_AVAILABLE, but this makes this code depend // on SerialPort (otherwise, it would work on ANY InputStream which // IMHO should be the reason why InputStream exists, but this is // off-topic here) } if (timer.isExpired()) { // handle timeout } // else assert(message.isComplete()); Exceptions could be handled in a way like: String portName = "/dev/ttyS0"; // pseudo code: SerialPort port = SerialPort.open(portName); try { try { thisRead = port.is.read(); if (thisRead == -1) { if (readData.length == 0) { throw new ConnectionClosedByPeerException(); } } } catch {IOException ioex) { CommException ex = new CommIOException(ioex); ex.appendInfo("while reading"); } } catch (CommException ex) { // Instead of the read call above probably we call a method working // on InputStream. This function cannot know the portName, but for // the user this is very important. Because of this we add the // information. We do this on each level/layer: our caller appends // why the port were read (e.g. "while initilizing modem" or // "quering thermometer sensor") and so on. The user then can get a // message like // unexpected DCD drop (carrier lost) while reading /dev/ttyS0 for // Modem communication while sending file UPLOAD.DAT for module // DataReconciliation triggered by Cron Call "Daily Reconciliation" // by application "My Monitor". // much better than "IOException in IO.java:1234"! // They are intended to include ANY information needed to resolve the // issue (without needing complete logs maybe even with // version-dependent stack dumps, which would be horrible). CommException ex = new CommIOException(ioex); ex.appendInfo(" on port " + portName); } Comments, corrections and critics are appreciated! oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 04:50:40 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 12:50:40 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Message-ID: <17E538BC24EE42EC89F5BB086205F581@mdam2> ----- Original Message ----- From: "Steffen DETTMER" To: "rxtx" Sent: Monday, November 30, 2009 12:06 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > Hi, > > I could not resist to write about how to use InputStream.read(byte[]) > because I think this again is an example showing it wrongly. > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: >> http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ >> >> There is a lot about RXTX, and sample works with Events. >> It differs from original RXTX samples. > I didn't checked this sample befor posting, and I did missusage of the word "works". Sorry, should be "sample prepared for Events". Yesterday afteroon I have checked this technique in XP only, but I have had problems and have switched to other tasks. Steffen, please attach your new complete example to be sure no errors while changing and please let me know in which platform you have tested it. I will check it on my systems. Maybe this is a platform problem? Why I think so: My sample works in Windows and Linux, but in real application I have detected problem with Linux. In old systems we have had hard list of the serial ports, but now user may connect and disconnect USB-Serial dongle while application is running. Effects are clear... We (developers) have to be ready to serve it. And therefore I have an configuration form where user may check device, find it automatically or declare manually COM (dev/tty...) device. Before each auto-looking for my specific device I have (I should) to re-read available ports (I have the button to manually refresh list of the ports as well). In XP and Vista it works very good. No one crash in 5 hours when I was doing that!!! But in Linux (newest Ubuntu) there is a problem. Doing an enumeration of the devices when RXTX driver was previousluy used, places new instance of the RXTXDriver in the memory: CommPortIdentifier.java, line 327. When this action occurs, IOLocked stays 2, previously used device is not visible even if was correctly closed! Application hangs, but I don't know yet where - earlier it was read loop. Now I have to do some other things, later I will go back to problem. Regards Mariusz From oliverhoffmann32 at googlemail.com Mon Nov 30 08:07:31 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 16:07:31 +0100 Subject: [Rxtx] RXTX for ttyACM0 Message-ID: <200911301607.31300.oliverhoffmann32@googlemail.com> Hi RXTX Crew! I'm currently writing a small application which uses RXTX to communicate with an USB device: ... usb 1-10: new full speed USB device using ohci_hcd and address 3 usb 1-10: configuration #1 chosen from 1 choice cdc_acm 1-10:1.0: This device cannot do calls on its own. It is not a modem. cdc_acm 1-10:1.0: ttyACM0: USB ACM device usbcore: registered new interface driver cdc_acm cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters ... If I use cutecom I can open a connection to /dev/ttyACM0 without any problems, but CommPortIdentifier.getPortIdentifiers() from RXTX only lists some ttyS[0-9] devices. The only way I found is symlinking ttyACM0 to for example ttyS3, so i wonder if there's any better way (like if the user doesn't have write-access to /dev). Greatings, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 08:35:56 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:35:56 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <200911301607.31300.oliverhoffmann32@googlemail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> Message-ID: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> 2009/11/30 Oliver Hoffmann > Hi RXTX Crew! > > I'm currently writing a small application which uses RXTX to communicate > with > an USB device: > ... > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > wonder > if there's any better way (like if the user doesn't have write-access to > /dev). > To avoid this naming problem between systems and implementations of the USB-RS naming conventions I did it what you may see below. You may identify system elsewhere (isMac, isWindows, isLinux) and read appriorate prefixes from an INI file etc. So user may change their prefixes without changing application! Note that you have to look for ALL system ports, not serial only and do filtering yourself. In RXTXCommDriver.java you may change port candidates porefixes if you would like to change sources of the RXTX. If not - my example works fine. Regards Mariusz Dec /* * * @author Mariusz Dec * September 2009 */ import gnu.io.CommPortIdentifier; import java.util.Enumeration; import javax.swing.DefaultListModel; public class CommPortLister { public static String comPortsWindows = "COM"; public static String comPortsMacintosh1 = "/dev/tty"; public static String comPortsMacintosh2 = "/dev/cu"; public static String comPortsLinux1 = "/dev/usb/tty"; public static String comPortsLinux2 = "/dev/tty"; public DefaultListModel listCom() { Enumeration ports = CommPortIdentifier.getPortIdentifiers(); DefaultListModel pList = null; String pName = ""; String pStart1 = ""; String pStart2 = ""; pList = new DefaultListModel(); while(ports.hasMoreElements()) { pName = ((CommPortIdentifier)ports.nextElement()).getName(); if (isWindows) { pStart1 = comPortsWindows; pStart2 = "------"; } else if (isMac) { pStart1 = comPortsMacintosh1; pStart2 = comPortsMacintosh2; } else if (isLinux) { pStart1 = comPortsLinux1; pStart2 = comPortsLinux2; } if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) { pList.addElement(pName); } } return pList; } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Nov 30 08:40:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 16:40:13 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <17E538BC24EE42EC89F5BB086205F581@mdam2> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> Message-ID: <20091130154013.GL20226@elberon.bln.de.ingenico.com> * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100: > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > > > > > There is a lot about RXTX, and sample works with Events. > > > It differs from original RXTX samples. > > I didn't checked this sample befor posting, and I did missusage of the word > "works". Sorry, should be "sample prepared for Events". no problem. I did neither intend to critice you nor the example; I did not even read what it demonstrates (I think it is not an example how to use read in best way). Maybe I just wanted to start an example :) Also I think that this example will work (ie. print something) in most cases! I'm just afraid people could start some prototype of their apps based on it, then improve here and there and finally have some server application with rare strange failures. > Steffen, please attach your new complete example to be sure no > errors while changing and please let me know in which platform > you have tested it. I will check it on my systems. You ask me to write a complete compiling example? mmm... maybe I could take some time this week to do so, but first I would like to ensure that it is correct. We had discussions about it in the past and there were many details to consider; easy to fall in a trap. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 08:59:47 2009 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Mon, 30 Nov 2009 16:59:47 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: <20091130154013.GL20226@elberon.bln.de.ingenico.com> References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> <17E538BC24EE42EC89F5BB086205F581@mdam2> <20091130154013.GL20226@elberon.bln.de.ingenico.com> Message-ID: <73a89f360911300759l63335522sb16bc254a4d0ebb2@mail.gmail.com> 2009/11/30 Steffen DETTMER > * M.Dec-Gazeta wrote on Mon, Nov 30, 2009 at 12:50 +0100:> you have tested > it. I will check it on my systems. > > You ask me to write a complete compiling example? > Yes, if you did it.. BTW: I have analysed your mail and In the meantime I have solved problem in my application on Linux It was a mistake while copying sources between machines... hrrrr.. Returning to your work - like in each realtime and/or physical interfaces, timing may generate problems, especially with USB. Few months ago I have seen time critical application transferred to USB-RS232 dongle. Crazy results... USB is polling data, no interrupts... My new experience: My desktop XP is very fast, Vista and Ubuntu are on slower notebook. For Vista and Win RXTX.dll computer speed is enough but for Linux I have observed that rereshing ports list in the program sequence: disonnect(curPort); porstList = refreshPortsList(); returns portsList WITHOUT curPort... It means that curPort returns on the available ports list in system with delay after close(). This is not big problem, but a bit frustrating - I do not like to add delays everywhere... Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliverhoffmann32 at googlemail.com Mon Nov 30 09:10:15 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 17:10:15 +0100 Subject: [Rxtx] RXTX for ttyACM0 In-Reply-To: <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> Message-ID: <200911301710.16126.oliverhoffmann32@googlemail.com> On Monday 30 November 2009 16:35:56 Mariusz Dec wrote: > 2009/11/30 Oliver Hoffmann > > > Hi RXTX Crew! > > > > I'm currently writing a small application which uses RXTX to communicate > > with > > an USB device: > > ... > > The only way I found is symlinking ttyACM0 to for example ttyS3, so i > > wonder > > if there's any better way (like if the user doesn't have write-access to > > /dev). > > To avoid this naming problem between systems and implementations of the > USB-RS naming conventions I did it what you may see below. > You may identify system elsewhere (isMac, isWindows, isLinux) and read > appriorate prefixes from an INI file etc. > So user may change their prefixes without changing application! > > Note that you have to look for ALL system ports, not serial only and do > filtering yourself. > > In RXTXCommDriver.java you may change port candidates porefixes if you > would like to change sources of the RXTX. > If not - my example works fine. > > Regards > Mariusz Dec > > /* > * > * @author Mariusz Dec > * September 2009 > */ > > import gnu.io.CommPortIdentifier; > > import java.util.Enumeration; > import javax.swing.DefaultListModel; > > public class CommPortLister { > > public static String comPortsWindows = "COM"; > public static String comPortsMacintosh1 = "/dev/tty"; > public static String comPortsMacintosh2 = "/dev/cu"; > public static String comPortsLinux1 = "/dev/usb/tty"; > public static String comPortsLinux2 = "/dev/tty"; > > > public DefaultListModel listCom() { > Enumeration ports = CommPortIdentifier.getPortIdentifiers(); > DefaultListModel pList = null; > String pName = ""; > String pStart1 = ""; > String pStart2 = ""; > pList = new DefaultListModel(); > while(ports.hasMoreElements()) > { > pName = ((CommPortIdentifier)ports.nextElement()).getName(); > > if (isWindows) > { > pStart1 = comPortsWindows; > pStart2 = "------"; > } > else > if (isMac) > { > pStart1 = comPortsMacintosh1; > pStart2 = comPortsMacintosh2; > } > else > if (isLinux) > { > pStart1 = comPortsLinux1; > pStart2 = comPortsLinux2; > } > > if (pName.startsWith(pStart1) || pName.startsWith(pStart2)) > { > pList.addElement(pName); > } > } > return pList; > } > } > This wouldn't work because the list of CommPortIdentifier.getPortIdentifiers() is already filtered, so I would have to change the "CandidatePortPrefixes" list in RXTXCommDriver as you said. But after looking through the sourcecode I found that setting gnu.io.rxtx.SerialPorts to "/dev/ttyACM0" solved the problem. Sure it's not the nicest way but at leats it works. Maybe adding "ttyACM" to the list in RXTXCommDriver.java:521 is a more permanent solution. Regards, Oliver Hoffmann From mariusz.dec at gmail.com Mon Nov 30 10:57:04 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 18:57:04 +0100 Subject: [Rxtx] RXTX for ttyACM0 References: <200911301607.31300.oliverhoffmann32@googlemail.com> <73a89f360911300735g77f6411cq58bcca2ea7c069d0@mail.gmail.com> <200911301710.16126.oliverhoffmann32@googlemail.com> Message-ID: <09AC73AA7B22418BBCD1297A2D85A033@mdam2> > > This wouldn't work because the list of > CommPortIdentifier.getPortIdentifiers() > is already filtered, so I would have to change the > "CandidatePortPrefixes" list > in RXTXCommDriver as you said. It works in Windows from several months...., sorry Mariusz From daniel.armbrust.list at gmail.com Sun Nov 1 10:17:50 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Sun, 1 Nov 2009 11:17:50 -0600 Subject: [Rxtx] Problem with USB Serial adapter Message-ID: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> I'm not sure if I have an issue with linux and this 'startech' usb serial adapter, or if it is possibly an rxtx issue. Maybe someone on this list can point out something I'm doing wrong. Background: I have a rather 'simple' use of the serial port - I have some custom hardware than sends my java application signals by connecting and disconnecting the following pins 4 -> 1 == CD state change 4 -> 6 == DSR state change 4 -> 8 == CTS state change 4 -> 9 == RI state change When things are working, I see 6 Volts on Pin 4. Using a motherboard serial port, my application works fine on both windows and linux. Using a startech "ICUSB2321X" USB to Serial adapater (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) - it works fine for me under windows. However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any state changes on the serial port. I've enabled the serial port like so: modprobe usbserial vendor=0x14b0 product=0x3410 dmesg shows it: 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 And rxtx lets me open it: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(listenPortName); listenPort = (SerialPort)portId.open("test", 2000); But every operation such as "isDTR" simply returns false - no matter if I connect pins or not. I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. Can anyone give me any tips? Thanks, Dan From mailinglist at neneko.nl Mon Nov 2 00:35:09 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Mon, 02 Nov 2009 08:35:09 +0100 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> Message-ID: <4AEE8BAD.5030000@neneko.nl> Dan Armbrust schreef: > I'm not sure if I have an issue with linux and this 'startech' usb > serial adapter, or if it is possibly an rxtx issue. > > Maybe someone on this list can point out something I'm doing wrong. > > Background: > > I have a rather 'simple' use of the serial port - I have some custom > hardware than sends my java application signals by connecting and > disconnecting the following pins > > 4 -> 1 == CD state change > 4 -> 6 == DSR state change > 4 -> 8 == CTS state change > 4 -> 9 == RI state change > > When things are working, I see 6 Volts on Pin 4. > > Using a motherboard serial port, my application works fine on both > windows and linux. > > Using a startech "ICUSB2321X" USB to Serial adapater > (http://www.startech.com/item/ICUSB2321X-Professional-USB-to-RS-232-Serial-Adapter.aspx) > - it works fine for me under windows. > > However, on Ubuntu (kernel 2.6.24-24), I can't seem to detect any > state changes on the serial port. > > I've enabled the serial port like so: > > modprobe usbserial vendor=0x14b0 product=0x3410 > > dmesg shows it: > 885.663156] usb 1-5.1.3: new full speed USB device using ehci_hcd and address 7 > [ 885.788972] usb 1-5.1.3: configuration #1 chosen from 1 choice > [ 885.792018] usbserial_generic 1-5.1.3:1.0: generic converter detected > [ 885.792077] usb 1-5.1.3: generic converter now attached to ttyUSB0 > > And rxtx lets me open it: > > CommPortIdentifier portId = > CommPortIdentifier.getPortIdentifier(listenPortName); > listenPort = (SerialPort)portId.open("test", 2000); > > But every operation such as "isDTR" simply returns false - no matter > if I connect pins or not. > > I also noted that I get -6 Volts on Pin 4, instead of positive 6 volts. > > Can anyone give me any tips? > > Thanks, > > Dan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > Hello Dan, First of are you sure your USB to serial adapter supports the use of the hardware flow control lines? To my knowledge not all USB adapter support this. From HowardZ at howardz.com Mon Nov 2 12:51:29 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 02 Nov 2009 14:51:29 -0500 Subject: [Rxtx] Why use javac.exe with version 1.2 option? Message-ID: <4AEF3841.5000508@howardz.com> I am wondering why we compile the java code using javac -source 1.2 -target 1.2 -g Why are we using a compatibility mode for java 1.2 ? Is this necessary? Howard From daniel.armbrust.list at gmail.com Mon Nov 2 18:12:53 2009 From: daniel.armbrust.list at gmail.com (Dan Armbrust) Date: Mon, 2 Nov 2009 19:12:53 -0600 Subject: [Rxtx] Problem with USB Serial adapter In-Reply-To: <4AEE8BAD.5030000@neneko.nl> References: <82f04dc40911010917w4d912e4bub276d3794516c09e@mail.gmail.com> <4AEE8BAD.5030000@neneko.nl> Message-ID: <82f04dc40911021712n728b3da7jac97912bd658dab8@mail.gmail.com> On Mon, Nov 2, 2009 at 1:35 AM, Tim Bakker wrote: > Hello Dan, > > First of are you sure your USB to serial adapter supports the use of the > hardware flow control lines? To my knowledge not all USB adapter support > this. > It works as I expect it to when I boot over to my windows partition. So I know something is amok with the Linux support - but I don't know if it is rxtx, or perhaps the linux driver not supporting this device properly. From Kapil_Gupta at hcl.in Tue Nov 3 05:36:57 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Tue, 3 Nov 2009 18:06:57 +0530 Subject: [Rxtx] Using RXTX 2.2Pre binaries on macintosh In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9E03876@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Everyone, Anyone having problem with RXTX on IMac 10.5.8 ? We are using RXTX2.2Pre binaries on Macintosh(10.5.8 Intel),with java 1.5 and observing some strange behavior. The application communicates to the serial port and reads the data perfectly first time but it hangs on second time. We debugged and get to know that it hangs in open(portname) call in RXTX. The same code works fine on Windows. I am attaching a sample code that demonstrate/replicates the problem. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Sample.java Type: application/octet-stream Size: 3529 bytes Desc: Sample.java URL: From george.dma at gmail.com Tue Nov 3 09:04:12 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 18:04:12 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected Message-ID: Hi, I been using the rxtxcomm library for a while now and it's working well. I have event based communications working and I am connecting to a serial printer. I can send the serial printer command and receive events. A problem occurs when there is nothing connected to the serial port, rxtx will still successfully connect to the port and I can send bytes without errors (unlike sockets you get an IOException if you send something to a socket that's connected to nothing.) So I can have no printers connected and my program will happily send bytes to the serial port without complaints. I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? Thanks. -- George H george.dma at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Tue Nov 3 09:49:33 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 3 Nov 2009 18:49:33 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: Message-ID: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> > >I want to be able to know if there is a device connected to the port or not, is there some trick or something I can do? By the very nature of the serial communication there is no direct way of knowing if anything is connected or not. You need to figure out some sort of 'ping' system yourself. Find out something that you can send safely to the printer that will not interfere with / cause printing and to which the printer will in respond sending something back. If you don't get the response back in timely manner you can assume that the printer is not attached. Maybe repeat one or two times just to make sure. Another possibility is that if you can figure out the state of one of the control lines CTS/RTS etc which, by luck, is different weather or not the printer is connected. At best this tell you that something is connected, so this is long shot so I would try the first method first. What sort printer it is? br Kusti From george.dma at gmail.com Tue Nov 3 13:33:44 2009 From: george.dma at gmail.com (George H) Date: Tue, 3 Nov 2009 22:33:44 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: Thanks for the info Kusti and Gregg. I am using an Epson TM T88IV receipt printer. I have a command that I send that returns some info. To which rxtx even "DATA_AVAILABLE" is flagged. I could put that on a timer and if I don't get a reply within 2-3 seconds that I can safely assume it's dead. I believe I send an "auto status back" signal to the printer via ESCPOS protocol. I will have to try out that CTS/DSR signaling. I haven't actually turned the printer on while rxtx is attached to the printer. Thanks for the info, you've given me some extra ideas to play with. -- George H george.dma at gmail.com On Tue, Nov 3, 2009 at 6:49 PM, Kustaa Nyholm wrote: > > > >I want to be able to know if there is a device connected to the port or > not, is there some trick or something I can do? > > By the very nature of the serial communication there is no direct way of > knowing if anything is connected or not. > > You need to figure out some sort of 'ping' system yourself. Find out > something that you can send safely to the printer > that will not interfere with / cause printing and to which the printer will > in respond sending something back. > If you don't get the response back in timely manner you can assume that the > printer is not attached. > > Maybe repeat one or two times just to make sure. > > Another possibility is that if you can figure out the state of one of the > control lines CTS/RTS etc which, by luck, > is different weather or not the printer is connected. At best this tell you > that something is connected, so > this is long shot so I would try the first method first. > > What sort printer it is? > > br Kusti > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Nov 3 19:11:44 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 03 Nov 2009 21:11:44 -0500 Subject: [Rxtx] mingw gcc options don't exist? Message-ID: <4AF0E2E0.7010401@howardz.com> I was looking over the gcc documentation at http://gcc.gnu.org/onlinedocs/ I can't find any mention of most of the flags being used with mingw gcc. I can find: -O2 -mno-cygwin and -Wall I can't find any of the others. What's up? CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long long" -mno-fp-ret-in-387 -Wall Howard From michael.erskine at ketech.com Wed Nov 4 02:15:46 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 4 Nov 2009 09:15:46 +0000 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> Message-ID: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> > I will have to try out that CTS/DSR signaling. I haven't actually turned the > printer on while rxtx is attached to the printer. Why not use Carrier Detect? You could rig the plug if the CD pin doesn't get raised by the printer. Regards, Michael Erskine. From george.dma at gmail.com Wed Nov 4 02:26:29 2009 From: george.dma at gmail.com (George H) Date: Wed, 4 Nov 2009 11:26:29 +0200 Subject: [Rxtx] Event based comm, when a serial port is not connected In-Reply-To: <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> References: <5D23E5B41156B646B2E1A7C2BBA916F3223DF4CA46@SRVFIHKIEXB01.pmgroup.local> <06BA3262D918014F9183B66425D5A8D4661C7D9F88@no-sv-03.ketech.local> Message-ID: On Wed, Nov 4, 2009 at 11:15 AM, Michael Erskine wrote: > > I will have to try out that CTS/DSR signaling. I haven't actually turned > the > > printer on while rxtx is attached to the printer. > > Why not use Carrier Detect? You could rig the plug if the CD pin doesn't > get raised by the printer. > Regards, > Michael Erskine. > > ah I am not that much of an expert on these things, though a friend of mine is but he lives very far away. I do not get any CD signals, but I am getting CTS and DSR when the printer is turned ON and OF and when the Feed button is pressed. So this is useful to me. But people may turn on the printer before running my program... so I figured the only good way to do this (at least the way I can get done) is to send an ASB (Auto Status Back) command to the printer and expect a response within a max of 3000ms. If I don't get any response by then, I just assume nothing is connected. The ASB command is always supposed to return a response. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Wed Nov 4 06:38:46 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 4 Nov 2009 14:38:46 +0100 Subject: [Rxtx] mingw gcc options don't exist? In-Reply-To: <4AF0E2E0.7010401@howardz.com> References: <4AF0E2E0.7010401@howardz.com> Message-ID: <20091104133846.GD1719@elberon.bln.de.ingenico.com> * HowardZ at howardz.com wrote on Tue, Nov 03, 2009 at 21:11 -0500: > I was looking over the gcc documentation at > http://gcc.gnu.org/onlinedocs/ [-O2 -mno-cygwin -Wall found... but ...] > I can't find any of the others. > > What's up? > > CFLAGS= -O2 -mno-cygwin -DWIN32 -D_JNI_IMPLEMENTATION_ -D __int64="long > long" -mno-fp-ret-in-387 -Wall so you miss -D and -mno-fp-ret-in-387? http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Option-Summary.html#Option-Summary has `-mno-fp-ret-in-387' leading to http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86_002d64-Options.html which tells: > -mno-fp-ret-in-387 > Do not use the FPU registers for return values of > functions. > > The usual calling convention has functions return values of > types float and double in an FPU register, even if there is > no FPU. The idea is that the operating system should > emulate an FPU. > > The option -mno-fp-ret-in-387 causes such values to be > returned in ordinary CPU registers instead. well -D surely is clear (otherwise see http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Preprocessor-Options.html) Maybe except `-D __int64="long long"'? It supplies an __int64 type. __int64 is a Microsoft specific extension often found in Windows applications to make them harder to port. A kind of workaround is #defining __int64 to long long either by some `#define __int64 long long' in a common header or by such a -D __int64="long long". oki, Steffen --[end of message]------------------------------------------------->8======= About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Martin.Oberhuber at windriver.com Fri Nov 13 10:03:12 2009 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 13 Nov 2009 18:03:12 +0100 Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Hi Trent, On this page: http://users.frii.com/jarvi/rxtx/download.html There are two hyperlinks for Eclipse downloads, they point to http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads But it looks like rxtx.qbang.org is dead ... Is there a new Place for what used to be there? Thanks, Martin mnmbh From tjarvi at qbang.org Sun Nov 15 13:30:43 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 15 Nov 2009 13:30:43 -0700 (MST) Subject: [Rxtx] RXTX Eclipse Plugins Download gone missing ?? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> References: <4AE7F64A.6010305@lfarkas.org> <460801A4097E3D4CA04CC64EE64858480B457C6F@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, The router died and I'm getting a new one going remotely. I'll follow up with another email. The material you are interested in is moving to a cloud server in the long run to help avoid this. Sadly, that was only half way complete when the router died and the DNS was not transfered yet. On Fri, 13 Nov 2009, Oberhuber, Martin wrote: > Hi Trent, > > On this page: http://users.frii.com/jarvi/rxtx/download.html > There are two hyperlinks for Eclipse downloads, they point to > > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads > > But it looks like rxtx.qbang.org is dead ... Is there a new > Place for what used to be there? > > Thanks, > Martin > > mnmbh > From mail4ng at gmail.com Mon Nov 16 07:29:05 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 15:29:05 +0100 Subject: [Rxtx] UART_DISCONNECT event? Message-ID: <4B0161B1.3090407@gmail.com> Hello, is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source and add the patch from the mailing list? is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how to build to get it running on windows and linux too. a binary distibution or help in this place would be nice. regards Daniel From ilkka at myller.com Mon Nov 16 07:51:05 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 16 Nov 2009 16:51:05 +0200 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <4B0161B1.3090407@gmail.com> References: <4B0161B1.3090407@gmail.com> Message-ID: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. Otherwise, no one has reported any problems with the patch so far. I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. Thanks, I Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > Hello, > > is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source > and add the patch from the mailing list? > > is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how > to build to get it running on windows and linux too. > > a binary distibution or help in this place would be nice. > > regards > > Daniel > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail4ng at gmail.com Mon Nov 16 08:19:24 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:19:24 +0100 Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: <4B016D7C.9010409@gmail.com> the question should be: has anybody tested the patch? if so did anybody test the patch on windows? would be great to have the binaries. at the moment i'm not able to build the source. getting make errors. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) but my box is a Win 7 Ultimate x64. so it would not be surprising to me if something isn't working in this environment. can you or the someone else provide a binary build for windows and linux? Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mail4ng at gmail.com Mon Nov 16 08:21:59 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Mon, 16 Nov 2009 16:21:59 +0100 Subject: [Rxtx] Mailing list web interface isn't working Message-ID: <4B016E17.9070705@gmail.com> Looks like the web interface is down. Neither the archive can be viewed nor messages can be canceled. Please cancel my message sent from the wrong mail adress. guid: 6aaa2abee9ed472ff2625c06f330bd3d50325b69 From tjarvi at qbang.org Mon Nov 16 13:14:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 13:14:04 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: <4B016E17.9070705@gmail.com> References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Daniel Weinand wrote: > Looks like the web interface is down. Neither the archive can be viewed nor > messages can be canceled. > Please cancel my message sent from the wrong mail adress. > Thanks Daniel, I thought all the web sites had moved to the cloud services but missed that one. I'll resolve the problem after work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 16 19:34:23 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Nov 2009 19:34:23 -0700 (MST) Subject: [Rxtx] Mailing list web interface isn't working In-Reply-To: References: <4B016E17.9070705@gmail.com> Message-ID: On Mon, 16 Nov 2009, Trent Jarvi wrote: > > > On Mon, 16 Nov 2009, Daniel Weinand wrote: > >> Looks like the web interface is down. Neither the archive can be viewed nor >> messages can be canceled. >> Please cancel my message sent from the wrong mail adress. >> > > Thanks Daniel, > > I thought all the web sites had moved to the cloud services but missed that > one. I'll resolve the problem after work. All set. -- Trent Jarvi tjarvi at qbang.org From mail4ng at gmail.com Tue Nov 17 05:54:55 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 13:54:55 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? Message-ID: <4B029D1F.8040001@gmail.com> Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not able to build on my Win 7 box. i'd like to see if i can get rid of the standby problem with this new event. Dev build binaries for Win/Linux would be great. From brito.pro at gmail.com Tue Nov 17 07:30:03 2009 From: brito.pro at gmail.com (Wellington Brito de Carvalho) Date: Tue, 17 Nov 2009 12:30:03 -0200 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <4B029D1F.8040001@gmail.com> References: <4B029D1F.8040001@gmail.com> Message-ID: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> I don't know what's the UART_DISCONNECT event. Your rxtx is not working on windows 7? I still don't try it. On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand wrote: > Can somebody provide a Win32 build with the UART_DISCONNECT event? i'm not > able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this new > event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Wellington B. de Carvalho -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail4ng at gmail.com Tue Nov 17 07:48:54 2009 From: mail4ng at gmail.com (Daniel Weinand) Date: Tue, 17 Nov 2009 15:48:54 +0100 Subject: [Rxtx] Win32/Linux build with UART_DISCONNECT event? In-Reply-To: <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> References: <4B029D1F.8040001@gmail.com> <2ac0ae440911170630v7c94844bg194ac665d470ad26@mail.gmail.com> Message-ID: <4B02B7D6.6050308@gmail.com> it's working fine on Win 7. at least the 2.2pre2 as far i can tell. i can't compile the sources on my box. my actual problem is that the lib crashes after a computer goes to standby and wakes up again. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207026.html Ilkka submitted a patch that provides an event if this occurs. with this event i'd like to try to reset everything, and try to get rxtx running from standby. see here: http://mailman.qbang.org/pipermail/rxtx/2009-September/5207051.html but i cant compile the current cvs code. so i asked here if somebody can provide builds with the patch applied. if i try to compile the cvs code i'll get an Exception and i don't know how to fix it. #>dir #>16.11.2009 16:01 9.246 Makefile #>mingw32-make install #>mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421aa2) everything should be in place but it will not compile. Wellington Brito de Carvalho wrote: > I don't know what's the UART_DISCONNECT event. > Your rxtx is not working on windows 7? I still don't try it. > > On Tue, Nov 17, 2009 at 10:54 AM, Daniel Weinand > wrote: > > Can somebody provide a Win32 build with the UART_DISCONNECT event? > i'm not able to build on my Win 7 box. > > i'd like to see if i can get rid of the standby problem with this > new event. Dev build binaries for Win/Linux would be great. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Wellington B. de Carvalho From HowardZ at howardz.com Tue Nov 17 07:57:14 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 17 Nov 2009 09:57:14 -0500 Subject: [Rxtx] windows 64bit compile problem Message-ID: <4B02B9CA.9020608@howardz.com> Hi, In the past I built the jar file in Netbeans. Now, I have managed to build the dll files for win32 and win64 in Netbeans using mingw. I ran into a fatal build error message about the structure "timespec" in win32termios.h I looked around and only _sun_ seemed to use it. So, I modified win32termios.h to look like this: #if defined (__sun__ ) struct timespec { time_t tv_sec; long tv_nsec; }; #endif If you think this is appropriate, maybe you can incorporate it into the official source code as I am not using SVN yet. This elminated the build error. I have not yet tested the win64 dll file. My daughter's laptop has 64bit vista and I need to wait for her to bring it here some day for a test. Howard From tjarvi at qbang.org Tue Nov 17 19:16:28 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Nov 2009 19:16:28 -0700 (MST) Subject: [Rxtx] UART_DISCONNECT event? In-Reply-To: <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> References: <4B0161B1.3090407@gmail.com> <2E98ED0B-A1C5-45F4-8605-07F225236D99@myller.com> Message-ID: The patch should be fine after the minor refactor. We did give people plenty of time for additional comments. On Mon, 16 Nov 2009, Ilkka Myller wrote: > The UART_DISCONNECT patch I posted earlier needs some code refactoring to improve backwards compatibility (as suggested by Trent) before committing to CVS. > Otherwise, no one has reported any problems with the patch so far. > I'll try to take time to implement the necessary fixes and commit the updated patch to repository later this week. > > Thanks, > I > > Daniel Weinand kirjoitti 16.11.2009 kello 16.29: > >> Hello, >> >> is the code for the UART_DISCONNECT event in the repository? or do i have to checkout the current source >> and add the patch from the mailing list? >> >> is there a current binary version of the lib for windows? i don't have the build environment in place and don't really know how >> to build to get it running on windows and linux too. >> >> a binary distibution or help in this place would be nice. >> >> regards >> >> Daniel >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From j_jpg at hotmail.com Thu Nov 19 09:58:42 2009 From: j_jpg at hotmail.com (Javi P) Date: Thu, 19 Nov 2009 17:58:42 +0100 Subject: [Rxtx] Use in Firefox Debian Message-ID: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? From george.dma at gmail.com Thu Nov 19 22:52:09 2009 From: george.dma at gmail.com (George H) Date: Fri, 20 Nov 2009 07:52:09 +0200 Subject: [Rxtx] Use in Firefox Debian In-Reply-To: References: Message-ID: Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: > Hi everybody, > > I develop a simply applet to read a Barcode in a web page, first I proved > in Windows and all works fine. > Now I'm trying with linux, I have a machine with debian 5, I download > rxtx-2.1-7-bins and follow the steps in INSTALL, > I copy > cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext > cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so > a /usr/java/jre1.6.0_17/lib/i386 > cp > /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a > /usr/java/jre1.6.0_17/lib/i386 > > After I try to follow the steps in the web > Method 2: Adding to your path > Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. > Add the jar to your CLASSPATH, specifying the absolute path to the > JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh > syntax: > setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar > export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar > Add the folder containing the native library to the LD_LIBRARY_PATH, > for example if it is in /home/myuser/lib > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ > Note, that since the atcual library has a version in its name, you > should ensure that a symbolic link is made to the library using an > unversioned name, in the same folder. For example: > ln -s librxtxSerial-2.1-7.so librxtxSerial.so > > But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have > to modify the file /etc/profile and add: > CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar > LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 > > I also installed NetBeans and I can compile the project but when I try > under the web and error happen and it doesn?t work, under the Error Console > I don't see any message, only it is show in the Status Bar but it disappear > very quickly and it is impossible to read. > > Anyone knows the solution? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_jpg at hotmail.com Fri Nov 20 07:28:50 2009 From: j_jpg at hotmail.com (Javi P) Date: Fri, 20 Nov 2009 15:28:50 +0100 Subject: [Rxtx] Use in Firefox Debian References: Message-ID: Hello, I follow the instructions of Johnny Loung and I try to debug with appletviewer, this is the response: debian:/usr/jdk1.6.0_17/bin# ./appletviewer -debug /root/Desktop/Pruebas_Javi/SerialRxTx2.html Initializing jdb ... > run run sun.applet.Main /root/Desktop/Pruebas_Javi/SerialRxTx2.html Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:209) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:654) at sun.applet.AppletPanel.createApplet(AppletPanel.java:785) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: gnu.io.SerialPortEventListener at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 12 more I think like George H that it is a problem with the paths, but I don't know how to what he explain me, I want to put the applet in a web and run over my intranet. By the way U'm using Debian Lenny Thank you ----- Original Message ----- From: George H To: rxtx at qbang.org Sent: Friday, November 20, 2009 6:52 AM Subject: Re: [Rxtx] Use in Firefox Debian Hello, It seems you need to do some class path mangling on your end. Personally I always place the native libs in a folder near where my program jar files are and I load them into my class path like so from the command line. java -Djava.library.path=/home/george/myprogram/native/linux/i686-unknown-linux-gnu -cp $CLASSPATH MyJavaProgram And inside my program the first thing to do is to load the native libraries using System.load(); method. Hope this helps. -- George H george.dma at gmail.com On Thu, Nov 19, 2009 at 6:58 PM, Javi P wrote: Hi everybody, I develop a simply applet to read a Barcode in a web page, first I proved in Windows and all works fine. Now I'm trying with linux, I have a machine with debian 5, I download rxtx-2.1-7-bins and follow the steps in INSTALL, I copy cp /usr/rxtx-2.1-7-bins-r2/RXTXcomm.jar a /usr/java/jre1.6.0_17/lib/ext cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so a /usr/java/jre1.6.0_17/lib/i386 cp /usr/rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so a /usr/java/jre1.6.0_17/lib/i386 After I try to follow the steps in the web Method 2: Adding to your path Copy RXTXcomm.jar and librxtxSerial.so to a location of your choice. Add the jar to your CLASSPATH, specifying the absolute path to the JAR, for example if it is in /home/myuser/javalibs, csh syntax and sh syntax: setenv CLASSPATH ${CLASSPATH}:/home/myuser/javalibs/RXTXcomm.jar export CLASSPATH=$CLASSPATH:/home/myuser/javalibs/RXTXcomm.jar Add the folder containing the native library to the LD_LIBRARY_PATH, for example if it is in /home/myuser/lib setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/myuser/lib/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/lib/ Note, that since the atcual library has a version in its name, you should ensure that a symbolic link is made to the library using an unversioned name, in the same folder. For example: ln -s librxtxSerial-2.1-7.so librxtxSerial.so But I cannot do anything, to establish CLASSPATH and LD_LIBRARY_PATH I have to modify the file /etc/profile and add: CLASSPATH=/usr/java/jre1.6.0_17/lib/ext/RXTXcomm.jar LD_LIBRARY_PATH=/usr/java/jre1.6.0_17/lib/i386 I also installed NetBeans and I can compile the project but when I try under the web and error happen and it doesn?t work, under the Error Console I don't see any message, only it is show in the Status Bar but it disappear very quickly and it is impossible to read. Anyone knows the solution? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivmai at mail.ru Sat Nov 21 12:39:39 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 21 Nov 2009 22:39:39 +0300 Subject: [Rxtx] Non-daemon MonitorThread Message-ID: Hello all! Can anybody explain me why is MonitorThread not daemon? Thanks. From tjarvi at qbang.org Sat Nov 21 13:45:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Nov 2009 13:45:52 -0700 (MST) Subject: [Rxtx] Non-daemon MonitorThread In-Reply-To: References: Message-ID: On Sat, 21 Nov 2009, Ivan Maidanski wrote: > Hello all! > > Can anybody explain me why is MonitorThread not daemon? > It could be - I had to look myself to see it wasn't. The serial connection is fenceposted with an open and a close. The MonitorThread lives within this scope. I assume this has manifested in a behavior oddity like an application not exiting? -- Trent Jarvi tjarvi at qbang.org From ivmai at mail.ru Sat Nov 21 14:03:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:03:21 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: References: Message-ID: Trent Jarvi wrote: > On Sat, 21 Nov 2009, Ivan Maidanski wrote: > > > Hello all! > > > > Can anybody explain me why is MonitorThread not daemon? > > > > It could be - I had to look myself to see it wasn't. The serial > connection is fence-posted with an open and a close. The MonitorThread > lives within this scope. And close() might be called from finalize() which is not guaranteed to be ever called. > > I assume this has manifested in a behavior oddity like an application not > exiting? Yes. PS. Should I prepare a patch for it? (MonitorThread exists in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java) From ivmai at mail.ru Sat Nov 21 14:10:19 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sun, 22 Nov 2009 00:10:19 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggZm9yIFdpbkNFIChyeHR4LWRldmVsXzJfMSk=?= Message-ID: Hello all! The attached patch fixes several compilation errors (and eliminates some warnings) in WinCE gnu_io_RXTXCommDriver.cpp, gnu_io_RXTXPort.cpp, rxtxHelpers.cpp. Tested with arm-mingw32ce-gcc. PS. I've also upgraded WinCE rxtx sources to version RXTX-2.2pre2 but the patch is not ready at this moment. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai1.diff Type: application/octet-stream Size: 6391 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 02:57:01 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 12:57:01 +0300 Subject: [Rxtx] Patch adding monThread setDaemon Message-ID: Hi! This proposed simple patch sets daemon flag for MonitorThread (in I2C.java, LPRPort.java, Raw.java, RS485.java, RXTXPort.java, CNI/RXTXPort.java). The patch should solve the problem when an application is not exiting. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai2.diff Type: application/octet-stream Size: 3238 bytes Desc: not available URL: From ivmai at mail.ru Mon Nov 23 04:51:06 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 14:51:06 +0300 Subject: [Rxtx] =?koi8-r?b?OiBOb24tZGFlbW9uIE1vbml0b3JUaHJlYWQ=?= In-Reply-To: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> References: <6BB36289C14443B59DD7A24FA4BA2CD3@bengal.net> Message-ID: "Mike Kirkland" wrote: > Hi All! > > A patch for this would be great as I have just been looking around for an > explanation as to why my application would not exit and if I forced it with > System.exit(0); I would get - > > Error 0x1 at ../src/termios.c(2503): Incorrect function. I don't think my patch (I've just posted) would solve this issue. AFAIK some drivers may return ERROR_INVALID_FUNCTION (instead of ERROR_INVALID_HANDLE). I think this case should be handled specially in tcdrain() (e.g. just set_errno(EAGAIN) and return -1 before YACK). > ... From ivmai at mail.ru Mon Nov 23 06:40:46 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:40:46 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:42:37 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:42:37 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 Message-ID: Hi! This patch assumes my previous wince patch already applied (http://mailman.qbang.org/pipermail/rxtx/2009-November/5236152.html). I've tested the upgraded wince rxtx on a WinCE 5.0 ARM box. The tested compilers are: - MS VC++ v15.00 for ARM; - CeGCC v0.9.1 arm-mingw32ce-gcc (GCC) 4.4.0. Patch details: No Java files are modified. In brief I did the following: - regenerated gnu_io_RXTXPort.h and gnu_io_RXTXCommDriver.h; - changed version string returned nativeGetVersion(); - moved nativeGetVersion() to RXTXVersion; - added native_psmisc_report_owner() (same as for Win32); - removed unnecessary GetLastError() calls; - added explicit WCHAR-to-jchar casts (and vice versa) where the compiler complains (same for LPWSTR and for "const" qualifier); - adjusted some debugging messages (to also print returned error code); - wrapped remaining printed error messages (and MessageBeep) into IF_DEBUG(); - made printj() defined only if DEBUG; - replaced trailing "\n" with "\r\n" in printj(); - replaced "I" type char with "J" one for "eis" field; - replaced get_java_int_var() with get_java_var_long(); - changed nativeSetSerialPortParams() returned type to jboolean; - added nativeClearCommInput() and readTerminatedArray() stubs (these should be implemented in future); - removed "MonitorThreadCloseLock" field usage in eventLoop(); - commented out unused throw_java_exception(), get_java_boolean_var2() and removed get_java_boolean_var(); - replaced Sleep(0) call with Sleep(1) one in CommEventThread() (to make yielding a bit "more reliable" among threads with different priorities); - replaced named event with an unnamed one in InitialiseEventInfoStruct() (see the note below); - added new JAVAXCOMM_FRONTEND macro for convenience (if defined then PortInUseException and UnsupportedCommOperationException are used "javax.comm" package (old behavior) else from "gnu.io." one (default)); - commented out DllMain() definition (since it does no action, only consumes resources); - updated Readme. Notes for named events: 1. I observe some malfunction of named events on my wince box - sometimes an application blocked WaitCommEvent() is not exiting and, even more, the process is not killable until another process calls CreateEvent for the same named event; 2. Since there's no need to use named events here (if a port is already opened then CreateFile would fail for it), I replaced the named event creation with an unnamed one. Any opinion? From ivmai at mail.ru Mon Nov 23 06:50:51 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Mon, 23 Nov 2009 16:50:51 +0300 Subject: [Rxtx] Patch for upgrading WinCE port to v2.2pre2 (the patch) Message-ID: Sorry for the duplicate post, here is the patch itself attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai3.diff Type: application/octet-stream Size: 28983 bytes Desc: not available URL: From mariusz.dec at gmail.com Mon Nov 23 12:23:54 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Mon, 23 Nov 2009 20:23:54 +0100 Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2@mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end From Steffen.DETTMER at ingenico.com Mon Nov 23 14:26:36 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Nov 2009 22:26:36 +0100 Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From ivmai at mail.ru Tue Nov 24 00:36:34 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 10:36:34 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:26:00 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:26:00 +0300 Subject: [Rxtx] Patch for WinCE readArray Message-ID: Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: From ivmai at mail.ru Tue Nov 24 12:33:41 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:33:41 +0300 Subject: [Rxtx] =?koi8-r?b?UGF0Y2ggYWRkaW5nIG1vblRocmVhZCBzZXREYWVtb24=?= In-Reply-To: References: Message-ID: Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. From ivmai at mail.ru Tue Nov 24 12:38:40 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Tue, 24 Nov 2009 22:38:40 +0300 Subject: [Rxtx] =?koi8-r?b?U2VyaWFsUG9ydCBDbG9zZSgpIHByb2JsZW0gLSBXaW5k?= =?koi8-r?b?b3dzLCBVYnVudHUsTWFjIC0gSGVscCBtZSBwbGVhc2UhISE=?= Message-ID: Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) From tjarvi at qbang.org Tue Nov 24 23:04:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) Subject: [Rxtx] Patch adding monThread setDaemon In-Reply-To: References: Message-ID: On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From nate at n4te.com Thu Nov 26 06:08:27 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 05:08:27 -0800 Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate From ivmai at mail.ru Thu Nov 26 06:24:21 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Thu, 26 Nov 2009 16:24:21 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate From nate at n4te.com Thu Nov 26 14:32:21 2009 From: nate at n4te.com (Nate) Date: Thu, 26 Nov 2009 13:32:21 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827@mail.gmail.com> Message-ID: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Ah, thanks Ivan. What do you think about supporting both 32 bit and 64 bit DLLs, with the correct one chosen at runtime? This way I don't need two separate versions of my app. -Nate 2009/11/26 Ivan Maidanski : > Nate wrote: >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >> I see a user has come up with a workaround for 64 bit OS X. Has anyone >> done this for Windows? Are there plans to support 64 bit Windows? > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > >> >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >> Other open source projects such as LWJGL (http://lwjgl.org/) include >> both 32 and 64 bit native libs and the correct lib is automatically >> used. >> >> -Nate > > From ivmai at mail.ru Thu Nov 26 14:52:53 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Fri, 27 Nov 2009 00:52:53 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan From Kapil_Gupta at hcl.in Thu Nov 26 22:47:13 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 27 Nov 2009 11:17:13 +0530 Subject: [Rxtx] Rxtx Digest, Vol 27, Issue 7 In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960FDD2F38A@NDA-HCLT-EVS05.HCLT. CORP.HCL.IN-F0913EFA-B2A5-28E5-3684-11AABE813CF9> Hi, I am also facing the same issue as Mariusz is facing, I am facing it on Intel Mac 10.5.8. I am using RXTX 2.2 Pre binaries. First time I am able to read the data from my device, but second time port open hangs (RXTXPort.java). I am using TI chip set in my device. I created a C sample to test the driver but that works perfectly to read device any number of times. No hangs !! Note: My sample works fine on Windows XP. Please help. Thanks, Kapil -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of rxtx-request at qbang.org Sent: Thursday, November 26, 2009 6:50 PM To: rxtx at qbang.org Subject: Rxtx Digest, Vol 27, Issue 7 Send Rxtx mailing list submissions to rxtx at qbang.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.qbang.org/mailman/listinfo/rxtx or, via email, send a message with subject or body 'help' to rxtx-request at qbang.org You can reach the person managing the list at rxtx-owner at qbang.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rxtx digest..." Today's Topics: 1. SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! (M.Dec-GMail) 2. Re: Patch adding monThread setDaemon (Steffen DETTMER) 3. Re: Patch adding monThread setDaemon (Ivan Maidanski) 4. Patch for WinCE readArray (Ivan Maidanski) 5. Re: Patch adding monThread setDaemon (Ivan Maidanski) 6. Re: SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! (Ivan Maidanski) 7. Re: Patch adding monThread setDaemon (Trent Jarvi) 8. 64 bit (Nate) 9. Re: 64 bit (Ivan Maidanski) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Nov 2009 20:23:54 +0100 From: "M.Dec-GMail" To: Subject: [Rxtx] SerialPort Close() problem - Windows, Ubuntu, Mac - Help me please!!! Message-ID: <70AFF270F88E4D74BD5D3F803610DAB2 at mdam2> Hi all, I am fighting with serial port close() from several weeks. I have found and applied RXTXHack: http://forums.sun.com/thread.jspa?threadID=5261638 Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with symptoms of the IOLocked =2 as described in hack above. This way helps sometimes on Windows XP (not often), but second close (after subseqent open) in the same application instance drives to deep crash of the rxtxSerial.dll. I have tried similar techniques like in RXTXHack - nothing to be sure that it works. I have tried everything described above witx RXTX 2.1-7 and with RXTX 2.2 pre. Today I have applied fresh patches from Ivan as well, and no step forward (today on XP only). On all machines mentioned above I have tried it with FTDI serial driver for USB-VCP chip FTxxx. Everything works fine except close(). To eliminate this driver I have checked classic UART 16550 port of the machine with XP - the same results. XP, Vista and Ubuntu are on AMD processors, Mac on Intel... And finally question - maybe my open-close technique is wrong? Because an application is big, I have prepared sample based on the file available near RXTX package - TwoWaySerialCommMd.java. The only change is static variable commPort to access it from main() - it looks similar to my application variables configuration as well. What I did more: I have tried to do in/out streams and threads static as well. Before close() I have tried to close streams - nothing. Terminating and joining threads doesn't works - both operations hang up. Order of the closing threads/streams - nothing. I have carefully checked versions of the binaries (dll and jar) because of versions changes and new compilations in mingw. Please help me - what I did wrong in this sample code? And belive me please - it really doesn't work :( - I may show it on skype :) Thank you in advance. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M:6UP;W)T(&=N=2YI;RY#;VUM4&]R=#L-"FEM<&]R="!G;G4N:6\N0V]M;5!O MPT*(" @(" @(" @(" @8V]M;5!O7-T96TN;W5T+G!R:6YT;&XH M(D5R2!T:&ES M(&5X86UP;&4N(BD[#0H@(" @(" @(" @("!]#0H@(" @(" @('T@(" @( T* M(" @('T-"B @(" -"B @(" O*BH@*B\-"B @("!P=6)L:6,@71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5;,3 R-%T[ M#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @("!T&-E<'1I M;VX at 92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPPT*(" @(" @("!/=71P=713=')E86T@;W5T.PT*(" @(" @(" -"B @ M(" @(" @<'5B;&EC(%-E0T*(" @(" @(" @(" @>R @ M(" @(" @(" @(" @(" -"B @(" @(" @(" @(" @("!I;G0 at 8R ](# [#0H@ M(" @(" @(" @(" @(" @=VAI;&4@*" H(&,@/2!3>7-T96TN:6XNPT*(" @(" @(" @ M(" @(" @(&4N<')I;G13=&%C:U1R86-E*"D[#0H@(" @(" @(" @("!](" @ M(" @(" @(" @#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<'5B;&EC M('-T871I8R!V;VED(&UA:6X@*"!3=')I;F=;72!A0T*(" @(" @("![#0H@(" @(" @(" @(" H;F5W(%1W;U=A M>5-E&-E<'1I;VX at 92 I#0H@(" @(" @('L-"B @ M(" @(" @(" @("\O(%1/1$\@075T;RUG96YE7-T96TN97AI="@Q*3L-"B @(" @(" @?0T*(" @(" @("!3>7-T96TN M;W5T+G!R:6YT;&XH(E-U8V-E2!O<&5N960N+BXB*3L-"B @(" @ M(" @=')Y>PT*(" @(" @(" @5&AR96%D+G-L965P*#,P,# I.PT*(" @(" @ M("!]#0H@(" @(" @(&-A=&-H("A%>&-E<'1I;VX at 92D@>PT*(" @(" @(" @ M(" @4WES=&5M+F]U="YP7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!C;&]S M92 at I+BXN(BD[#0H-"B @(" @(" @=')Y#0H@(" @(" @('L-"B @(" @(" @ M(" @("\O(&AE5-E&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @ M92YP7-T M96TN;W5T+G!R:6YT;&XH(E-U8V-E2!C;&]S960B*3L-"B @("!] %#0I]#0H` ` end ------------------------------ Message: 2 Date: Mon, 23 Nov 2009 22:26:36 +0100 From: "Steffen DETTMER" To: "rxtx" Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset="utf-8" > This proposed simple patch sets daemon flag for MonitorThread > [... in 6 files ...] Couldn't the constructor of MonitorThread call setDaemon(true) to avoid code duplication? Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail ------------------------------ Message: 3 Date: Tue, 24 Nov 2009 10:36:34 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r "Steffen DETTMER" wrote: > > This proposed simple patch sets daemon flag for MonitorThread > > [... in 6 files ...] > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > code duplication? > > Steffen 1. I agree it could be (but typically it's done near start() call). 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 4 Date: Tue, 24 Nov 2009 22:26:00 +0300 From: Ivan Maidanski To: rxtx Subject: [Rxtx] Patch for WinCE readArray Message-ID: Content-Type: text/plain; charset="koi8-r" Hi! I've discovered a bug in readArray() of WinCE port - there ReadFile() is called in a loop (until, at least, threshold bytes are read) but the pointer in the buffer is not advanced (not a rare mistake). I also simplified the loop condition. The patch is attached (assumes 2 my previous patches - http://mailman.qbang.org/pipermail/rxtx/2009-November/5247775.html and http://mailman.qbang.org/pipermail/rxtx/2009-November/5247780.html). -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-devel-ivmai4.diff Type: application/octet-stream Size: 2486 bytes Desc: not available URL: ------------------------------ Message: 5 Date: Tue, 24 Nov 2009 22:33:41 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: text/plain; charset=koi8-r Hi! BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? -----Original Message----- > "Steffen DETTMER" wrote: > > > This proposed simple patch sets daemon flag for MonitorThread > > > [... in 6 files ...] > > > > Couldn't the constructor of MonitorThread call setDaemon(true) to avoid > > code duplication? > > > > Steffen > > 1. I agree it could be (but typically it's done near start() call). > 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. > 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. ------------------------------ Message: 6 Date: Tue, 24 Nov 2009 22:38:40 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] SerialPort Close() problem - Windows, Ubuntu,Mac - Help me please!!! Message-ID: Content-Type: text/plain; charset=koi8-r Hi "M.Dec-GMail" wrote: > Hi all, > I am fighting with serial port close() from several weeks. > > I have found and applied RXTXHack: > http://forums.sun.com/thread.jspa?threadID=5261638 > > Everything hangs up during close on my Win XP, Vista, Ubuntu and Mac with > symptoms of the IOLocked =2 as described in hack above. > This way helps sometimes on Windows XP (not often), but second close (after > subsequent open) in the same application instance drives to deep crash of the > rxtxSerial.dll. > I have tried similar techniques like in RXTXHack - nothing to be sure that > it works. > ... Just a question. Have you tried other implementations (eg., original Sun Comm API)? (I just try to understand whether this is a hardware/driver bug or an RXTX one.) ------------------------------ Message: 7 Date: Tue, 24 Nov 2009 23:04:13 -0700 (MST) From: Trent Jarvi To: Ivan Maidanski Cc: rxtx Subject: Re: [Rxtx] Patch adding monThread setDaemon Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 24 Nov 2009, Ivan Maidanski wrote: > Hi! > > BTW. Could somebody explain me why MonitorThread (in RXTXPort) is also started from the constructor (even if an application is not going to monitor the events)? > Hi Ivan, Running without the monitor thread is something I've considered doing. The real advantage would be with USB serial dongles which have a higher overhead associated with checking the serial port status. > -----Original Message----- >> "Steffen DETTMER" wrote: >>>> This proposed simple patch sets daemon flag for MonitorThread >>>> [... in 6 files ...] >>> >>> Couldn't the constructor of MonitorThread call setDaemon(true) to avoid >>> code duplication? >>> >>> Steffen >> >> 1. I agree it could be (but typically it's done near start() call). >> 2. Either solution would result in modifying of all the listed files since MonitorThread class is defined in each of them. >> 3. I think both java and C parts of rxtx need redesigning (at least to remove numerous code duplications) but there's no volunteer for this. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------ Message: 8 Date: Thu, 26 Nov 2009 05:08:27 -0800 From: Nate To: rxtx at qbang.org Subject: [Rxtx] 64 bit Message-ID: <7d6ffee60911260508x4febdd5aje78ac8a0e9ffc827 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. I see a user has come up with a workaround for 64 bit OS X. Has anyone done this for Windows? Are there plans to support 64 bit Windows? Further, I'd like my app to work on both 32 bit and 64 bit Windows. Other open source projects such as LWJGL (http://lwjgl.org/) include both 32 and 64 bit native libs and the correct lib is automatically used. -Nate ------------------------------ Message: 9 Date: Thu, 26 Nov 2009 16:24:21 +0300 From: Ivan Maidanski To: rxtx Subject: Re: [Rxtx] 64 bit Message-ID: Content-Type: text/plain; charset=koi8-r Nate wrote: > I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > I see a user has come up with a workaround for 64 bit OS X. Has anyone > done this for Windows? Are there plans to support 64 bit Windows? rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > Further, I'd like my app to work on both 32 bit and 64 bit Windows. > Other open source projects such as LWJGL (http://lwjgl.org/) include > both 32 and 64 bit native libs and the correct lib is automatically > used. > > -Nate ------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx End of Rxtx Digest, Vol 27, Issue 7 *********************************** DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From m.kirkland at comcast.net Fri Nov 27 01:56:33 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 27 Nov 2009 00:56:33 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Or you could try the following utility which will modify the native library search path at run time based on the os.name and os.arch system properties. http://hamware.info/tools/LibLoader.zip Read the comments in the code and the properties file for details. Mike -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Ivan Maidanski Sent: Thursday, November 26, 2009 1:53 PM To: rxtx Subject: Re: [Rxtx] 64 bit Hi! Nate wrote: > Ah, thanks Ivan. > > What do you think about supporting both 32 bit and 64 bit DLLs, with > the correct one chosen at runtime? This way I don't need two separate > versions of my app. I think it would be good. I think this should be implemented as follows: - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > -Nate > > > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. > >> I see a user has come up with a workaround for 64 bit OS X. Has anyone > >> done this for Windows? Are there plans to support 64 bit Windows? > > > > rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily rebuild it from the sources using e.g. mingw-w64.) > > > >> > >> Further, I'd like my app to work on both 32 bit and 64 bit Windows. > >> Other open source projects such as LWJGL (http://lwjgl.org/) include > >> both 32 and 64 bit native libs and the correct lib is automatically > >> used. Best regards, Ivan _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri Nov 27 08:48:41 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 27 Nov 2009 08:48:41 -0700 (MST) Subject: [Rxtx] 64 bit In-Reply-To: <37C466E167F84974A6CBC83664F0AEC1@bengal.net> References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: I've used the native library search path to solve the problem in the past. The 64/32 bit library is one issue. There is also an issue binaries that can run on multiple archs. http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ This can be complicated by libc sources/versions ... At first glance, it would appear reasonable to modify the library name or path. When I think about it, the better approach is to make sure the libraries load in an intuitive way when installed alone for the novice and leave the multiple arch/os support problem as an exercise for the implementor as they will have an advanced skill set (and hopefully a nice wiki page helping them). On Fri, 27 Nov 2009, Mike Kirkland wrote: > Or you could try the following utility which will modify the native library > search path at run time based on the os.name and os.arch system properties. > > http://hamware.info/tools/LibLoader.zip > > Read the comments in the code and the properties file for details. > > Mike > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Ivan Maidanski > Sent: Thursday, November 26, 2009 1:53 PM > To: rxtx > Subject: Re: [Rxtx] 64 bit > > Hi! > Nate wrote: >> Ah, thanks Ivan. >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String > basename) which if sun.arch.data.model property is defined and equals "64" > then first tries to load basename+"64" library otherwize (if not 64 or > failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with > RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" > for 64-bit targets (optionally, if needed). > >> >> -Nate >> >> >> 2009/11/26 Ivan Maidanski : >>> Nate wrote: >>>> I'd like to use rxtx, but it doesn't have binaries for 64 bit Windows. >>>> I see a user has come up with a workaround for 64 bit OS X. Has anyone >>>> done this for Windows? Are there plans to support 64 bit Windows? >>> >>> rxtx-2.2pre2-bins.zip contains a DLL for Win64. (And you can easily > rebuild it from the sources using e.g. mingw-w64.) >>> >>>> >>>> Further, I'd like my app to work on both 32 bit and 64 bit Windows. >>>> Other open source projects such as LWJGL (http://lwjgl.org/) include >>>> both 32 and 64 bit native libs and the correct lib is automatically >>>> used. > > Best regards, > Ivan > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Fri Nov 27 13:55:55 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Fri, 27 Nov 2009 21:55:55 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved Message-ID: Hi Ivan, Trent, Steffen, Kapil and all :) I have found a method how to close() and reopen RXTX serial port without problems. This is done on the rxtx-2.2pre2 version, but I think that it should work on earlier versions as well. I have tested it on Windows XP, Vista and Linux, Ubuntu distribution. On Windows XP it works on native UART and VCP, on Vista and Ubuntu I haven't native UART, so I have tested it with USB-RS232 VCP from FTDI. There is NO code changes in Java and C, this is only better external service of the processes between Java threads and native interface. I have found it looking in the code and tracing Java in Netbeans 6.7.1. using printouts from C part - #define TRENT_IS_HERE :) Attached file - TwoWaySerialCommMd.java is derived from the original TwoWaySerialComm.java but works a bit better :). Important comments are inside the file. I hope Kapil answers what about Macintosh but it should looks like in Linux. A bit about works of the Ivan and Steffen form last days. I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good idea when RXTXPort is used as a part of the application, but I think that Trent should accept or not this change. In my opinion this change does nothing in this case. If somebody needs serial daemon should do it a level up... Especially to Trent: 1. I have read a lot about synchronisation and in my opinion monThreadMutex in RXTXPort.java should be declared as final, the same with Sync in CommPortIdentifier. 2. Please check this example and, if this is good, add it to official examples of the RXTX. ABOUT EVENTS In my application I have checked events as well, but they works to slow for me - to big delay - I don't know why. Finally, I have decided to generate my own Exception when data from inStream is collected and proper parsed (I need packs of bytes). Exception transfers data to rest of the application. The only disadvantage is ASCII model of the data which may be transferred through Exception, but for me its enough. Therefore I don't know what to do with SerialEvent of the RXTX - I have found questions about the same problem with close() while using Events. Maybe somebody wiil solve this problem using my job. Regards Mariusz Dec begin 666 TwoWaySerialCommMd.java M+R\F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8-"B\O)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F#0HO+R!(;W<@=&\@=7-E(%)8 M5%A397)I86Q0;W)T#0HO+R!">2!-87)I=7-Z($1E8RP at 4&]L86YD#0HO+R!. M;W9E;6)E5-EB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@<')E<&%R:6YG(&EN4W1R96%M(&%N9"!O M=713=')E86T@=&\@9&5A8W1I=F%T92!B969OF5D*'-T;W!296%D M375T97 at I#0H@(" @(" @(" @(" @>W-T;W!296%D(#T@=')U93M]#0H@(" @ M(" @('-Y;F-H"D-"B @(" @(" @(" @ M("![4]W;F5D M*"D@*0T*(" @(" @("![#0H@(" @(" @(" @("!3>7-T96TN;W5T+G!R:6YT M;&XH(D5R2!I;B!U2P@;&EN92 X-# L M(#@V,0T*+R\@5VEN9&]W7-T96TN;W5T+G!R:6YT;&XH(D5R2!T:&ES(&5X86UP;&4N(BD[#0H@(" @(" @(" @ M("!]#0H@(" @(" @('T@(" @( T*(" @('T-"B\O*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H@(" @+RHJ("HO#0H@(" @<'5B;&EC('-T M871I8R!C;&%SB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)@T*+R\@16YA8FQI;F<@=V]R:R!O9B!T:&4@:6Y3 M=')E86T-"@T*(" @(" @(" @(" @('-Y;F-H71E6UT at 8G5F9F5R(#T@;F5W(&)Y=&5; M,3 R-%T[#0H@(" @(" @(" @("!I;G0@;&5N(#T at +3$[#0H@(" @(" @(" @ M("!TB!$96,-"B\O)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F)B8F M)B8F)B8F)B8F)B8F)@T*+R\@0VAE8VMI;F<@:68 at 86)O=70@=&\@8VQO7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@&-E<'1I;VX@ M92 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @92YPF5D*'-T;W!70T*(" @(" @(" @(" @>R @(" @(" @(" @(" @(" -"B @(" @ M(" @(" @(" @("!I;G0 at 8R ](# [#0H@(" @(" @(" @(" @(" @=VAI;&4@ M*" H(&,@/2!3>7-T96TN:6XN7-T M96TN;W5T+G!R:6YT;&XH(E-T;W!P960@=W)I=&EN9RXN+B(I.PT*(" @(" @ M(" @(" @(" @(" @(" @(" @8G)E86L[#0H@(" @(" @(" @(" @(" @(" @ M('T-"B @(" @(" @(" @(" @(" @(" @=&AI&-E<'1I;VX at 92 I#0H@(" @ M(" @(" @("![#0H@(" @(" @(" @(" @(" @92YP" H1$(Y M("T@<&EN(#(@8V]N;F5C=&5D('1O(#,I("!D871A('=I;&P@ T*(" @(" @("!3=')I;F<@<&]R=$YA;64@ M/2 B+V1E=B]T='E54T(P(CL-"@T*+R\@36%C#0HO+U-T3\_/S\_/S\_(CL-"@T*(" @(" @("!TPT*(" @(" @(" @(" @5-E2 at I("T at 4G5N=&EM92YG9712=6YT:6UE*"DN9G)E94UE;6]R>2 at I*2D[ M#0H@(" @(" @(" @4WES=&5M+F]U="YPPT*(" @(" @("!3>7-T96TN;W5T+G!R:6YT;&XH(E1R>6EN9R!O M<&5N*"DN+BXB("L@<&]R=$YA;64I.PT*(" @(" @("!T7-T96TN;W5T+G!R:6YT;&XH(E=A:71I;F7-T96TN;W5T+G!R:6YT;&XH92YT M;U-T0T*(" @(" @("![#0H@(" @(" @(" @(" @&-E<'1I;VX at 92D@>PT*(" @(" @(" @(" @92YP M&ET*# I.PT*(" @('T-"GT-"@`` ` end From nate at n4te.com Fri Nov 27 17:09:50 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:09:50 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> Message-ID: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> 2009/11/26 Ivan Maidanski : > Nate wrote: >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> the correct one chosen at runtime? This way I don't need two separate >> versions of my app. > > I think it would be good. I think this should be implemented as follows: > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). Please see the attached patch for the Java changes. I didn't update the build scripts, I'm fine with just renaming the libs myself for now. After some thought, I decided since the sun.arch.data.model property is unreliable, being Sun JVM specific, so I settled on loading the 32-bit lib by default and trying the 64-bit lib if that fails. The patch also sets "devel" to false in RXTXCommDriver. I strongly believe a third party library should not be hardcoded to dump to System.out, especially when nothing is wrong. If I want to dump the rxtx version to System.out, I can write one line of code to do so (ASCII art is certainly not needed). -Nate -------------- next part -------------- A non-text attachment was scrubbed... Name: nativeLib.patch Type: application/octet-stream Size: 2700 bytes Desc: not available URL: From nate at n4te.com Fri Nov 27 17:12:24 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 16:12:24 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911261332jdf34beuf52b2150385fe81a@mail.gmail.com> <37C466E167F84974A6CBC83664F0AEC1@bengal.net> Message-ID: <7d6ffee60911271612u4f3830aam295c56fe6c93e277@mail.gmail.com> On Fri, Nov 27, 2009 at 7:48 AM, Trent Jarvi wrote: > The 64/32 bit library is one issue. There is also an issue binaries that > can run on multiple archs. > > http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/ > > This can be complicated by libc sources/versions ... > > At first glance, it would appear reasonable to modify the library name or > path. When I think about it, the better approach is to make sure the > libraries load in an intuitive way when installed alone for the novice and > leave the multiple arch/os support problem as an exercise for the > implementor as they will have an advanced skill set (and hopefully a nice > wiki page helping them). Ideally rxtx could be shipped with all the native libs and it would know how to pick the appropriate one. This way it can be kept up to date by the rxtx project rather than each user with this need maintain their own loading code. That said, if no one actually has this need, I don't see a problem with waiting for the first person to implement it, then absorbing it into the rxtx project. IMO, the next best thing is to at least handle the most common case, which is 32/64-bit. -Nate From ivmai at mail.ru Sat Nov 28 00:48:05 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 10:48:05 +0300 Subject: [Rxtx] =?koi8-r?b?NjQgYml0?= In-Reply-To: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: Hi! Nate wrote: > 2009/11/26 Ivan Maidanski : > > Nate wrote: > >> What do you think about supporting both 32 bit and 64 bit DLLs, with > >> the correct one chosen at runtime? This way I don't need two separate > >> versions of my app. > > > > I think it would be good. I think this should be implemented as follows: > > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); > > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); > > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). > > Please see the attached patch for the Java changes. I didn't update > the build scripts, I'm fine with just renaming the libs myself for > now. After some thought, I decided since the sun.arch.data.model > property is unreliable, being Sun JVM specific, so I settled on > loading the 32-bit lib by default and trying the 64-bit lib if that > fails. I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. > > The patch also sets "devel" to false in RXTXCommDriver. I strongly > believe a third party library should not be hardcoded to dump to > System.out, especially when nothing is wrong. If I want to dump the > rxtx version to System.out, I can write one line of code to do so > (ASCII art is certainly not needed). > > -Nate > > ATTACHMENT: application/x-patch (nativeLib.patch) From nate at n4te.com Sat Nov 28 00:55:59 2009 From: nate at n4te.com (Nate) Date: Fri, 27 Nov 2009 23:55:59 -0800 Subject: [Rxtx] 64 bit In-Reply-To: References: <7d6ffee60911271609k28872b03me6fc464e7956a3bf@mail.gmail.com> Message-ID: <7d6ffee60911272355p73e526a0t5c10a7fc4d0f6663@mail.gmail.com> Hi Ivan, 2009/11/27 Ivan Maidanski : > Hi! > Nate wrote: >> 2009/11/26 Ivan Maidanski : >> > Nate wrote: >> >> What do you think about supporting both 32 bit and 64 bit DLLs, with >> >> the correct one chosen at runtime? This way I don't need two separate >> >> versions of my app. >> > >> > I think it would be good. I think this should be implemented as follows: >> > - in RXTXVersion add package-scope static method loadLibrary(String basename) which if sun.arch.data.model property is defined and equals "64" then first tries to load basename+"64" library otherwize (if not 64 or failed) loads basename one (so this would be backward compatible); >> > - replace all System.loadLibrary() calls (in all classes) with RXTXVersion.loadLibrary(); >> > - fix the corresponding building scripts to produce DLLs suffixed with "64" for 64-bit targets (optionally, if needed). >> >> Please see the attached patch for the Java changes. I didn't update >> the build scripts, I'm fine with just renaming the libs myself for >> now. After some thought, I decided since the sun.arch.data.model >> property is unreliable, being Sun JVM specific, so I settled on >> loading the 32-bit lib by default and trying the 64-bit lib if that >> fails. > > I don't think this property is unreliable (if set by a JVM). And, AFAIK, some other JVMs also set it. I meant unreliable in that the property isn't defined by the JVM spec, so may not be available in all JVMs. This means even if it is false, 64-bit must be tried before absolute failure. > The code looks like what I meant except that, I think, it would be better to to try to load basename+64 first if that property is set to 64. Sure. Here is how I would write it, with clarity in mind: static void loadLibrary (String baseName) { if (System.getProperty("sun.arch.data.model", "").equals("64")) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ex64) { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ignored) { throw ex64; } } } else { try { System.loadLibrary(baseName); } catch (UnsatisfiedLinkError ex32) { try { System.loadLibrary(baseName + "64"); } catch (UnsatisfiedLinkError ignored) { throw ex32; } } } } -Nate >> >> The patch also sets "devel" to false in RXTXCommDriver. I strongly >> believe a third party library should not be hardcoded to dump to >> System.out, especially when nothing is wrong. If I want to dump the >> rxtx version to System.out, I can write one line of code to do so >> (ASCII art is certainly not needed). >> >> -Nate >> >> ATTACHMENT: application/x-patch (nativeLib.patch) > > From ivmai at mail.ru Sat Nov 28 07:26:43 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 17:26:43 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: References: Message-ID: "M.Dec-GMail" wrote: > Hi Ivan, Trent, Steffen, Kapil and all :) > ... > A bit about works of the Ivan and Steffen from last days. > > I do not agree that setting RXTXPort as Daemon (patches from Ivan) is good > idea when RXTXPort is used as a part of the application, but I think that > Trent should accept or not this change. > In my opinion this change does nothing in this case. > If somebody needs serial daemon should do it a level up... I never claimed setDaemon patch would solve the port close problem. It solves "not exiting" a badly-written application problem (I mean an app is returning from main() without calling close() for ports). > ... > Regards > Mariusz Dec From mariusz.dec at gmail.com Sat Nov 28 09:29:04 2009 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Sat, 28 Nov 2009 17:29:04 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <536A5B02D18041459E65A4D1182D1374@mdam2> ----- Original Message ----- From: "Ivan Maidanski" To: "rxtx" Sent: Saturday, November 28, 2009 3:26 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > I never claimed setDaemon patch would solve the port close problem. It > solves "not exiting" a badly-written application problem (I mean an app is > returning from main() without calling close() for ports). It was general notice - not about close - but I am sorry - this is my mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. So - your proposal is good, but I have observed that RXTXPort ends work even without close, if application ends with System.exit(0). But in this case - If you will try my example without System.exit(0), program stays in memory and Netbeans says that application runs... This is the case of baddly written application - what in this case? Something is wrong in my techniuqe of subsequent opens? Variables configuration? No finalize of the RXTX port? Maybe this is it. If yes, everything should be changed and my example is workaround only - all threads disconnections should be done during close, inside RXTXPort.java.. Today I have written serial port scanner which is looking for specific external device checking all system serial ports - opening, sending query, closing (this is why I needed working close()). No memory waste, no lost threads in memory, but my application ends with System.exit(0). Workaround works... Regards Mariusz Dec >> ... >> Regards >> Mariusz Dec > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ivmai at mail.ru Sat Nov 28 09:57:33 2009 From: ivmai at mail.ru (Ivan Maidanski) Date: Sat, 28 Nov 2009 19:57:33 +0300 Subject: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?= =?koi8-r?b?biBSWFRYIHNvbHZlZA==?= In-Reply-To: <536A5B02D18041459E65A4D1182D1374@mdam2> References: <536A5B02D18041459E65A4D1182D1374@mdam2> Message-ID: "M.Dec-GMail" wrote: > ----- Original Message ----- > From: "Ivan Maidanski" > Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > > > I never claimed setDaemon patch would solve the port close problem. It > > solves "not exiting" a badly-written application problem (I mean an app is > > returning from main() without calling close() for ports). > > It was general notice - not about close - but I am sorry - this is my > mistake - you are right - Java daemon isn't the same as Linux/unix daemon's. > So - your proposal is good, but I have observed that RXTXPort ends work even > without close, if application ends with System.exit(0). That's how exit works by the definition (contrary to returning from main(String[])). > > But in this case - If you will try my example without System.exit(0), > program stays in memory and Netbeans says that application runs... > This is the case of badly written application - what in this case? No, in my case a "badly-written application" is exiting from an app w/o closing ports - this works with the original Sun Comm API but run into a "not exiting" problem with rxtx (unless System.exit is used, of course). > Something is wrong in my technique of subsequent opens? > Variables configuration? > No finalize of the RXTX port? Maybe this is it. Finalizers are not guaranteed to be ever run. > If yes, everything should be changed and my example is workaround only - all > threads disconnections should be done during close, inside RXTXPort.java.. > > Today I have written serial port scanner which is looking for specific > external device checking all system serial ports - opening, sending query, > closing (this is why I needed working close()). > No memory waste, no lost threads in memory, but my application ends with > System.exit(0). > Workaround works... > > Regards > Mariusz Dec At present, I use System.exit(0) in my app to workaround the absence of setDaemon too. Regards, Ovan From mariusz.dec at gmail.com Sun Nov 29 01:01:28 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 09:01:28 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: Hi all, While googling for something, I have found this site: http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ There is a lot about RXTX, and sample works with Events. It differs from original RXTX samples. The only question is - why original samples doesn't work correct and there is no links to real solutions... RXTX project is great but... Regards Mariusz Dec From tjarvi at qbang.org Sun Nov 29 08:57:08 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 29 Nov 2009 08:57:08 -0700 (MST) Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: On Sun, 29 Nov 2009, M.Dec-Gazeta wrote: > Hi all, > While googling for something, I have found this site: > > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. > > The only question is - why original samples doesn't work correct and there > is no links to real solutions... > RXTX project is great but... > Hi Mariusz, The rxtx project is far from perfect and needs help from users as well as developers. As you identify problems such as the original samples not doing what you need and missing links to the one you wanted, please do take a moment to edit the page another user created in hopes of helping you. Just remember that the wiki pages are almost entirely sponsored by individuals taking time to fix what bothered them. In the early stages, the concern was no examples. A positive tone is always appreciated. Posting to the mail-list is also appreciated and will make it more likely to attract a developer to sponsor a fix with their efforts. -- Trent Jarvi tjarvi at qbang.org From mariusz.dec at gmail.com Sun Nov 29 11:39:59 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Sun, 29 Nov 2009 19:39:59 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: Message-ID: <9732BACF0EFD43F3A6B0396ADF0C7811@mdam2> Hi Jarvi, > ...A positive tone is always appreciated. I am very sorry, that you have received my message as something wrong in my mind about your work in this GREAT project. I am very sorry - belive me please. I hope that my work over this close() problem, ready to use example and published later link, shows my FULL POSITIVE thinking about RXTX. Regards Mariusz Dec > > -- > Trent Jarvi > tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Mon Nov 30 04:06:03 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 30 Nov 2009 12:06:03 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved In-Reply-To: References: Message-ID: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Hi, I could not resist to write about how to use InputStream.read(byte[]) because I think this again is an example showing it wrongly. * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: > http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ > > There is a lot about RXTX, and sample works with Events. > It differs from original RXTX samples. it contains: 259 private byte[] readBuffer = new byte[400]; (I better don't comment on this one here) 272 try { 273 int availableBytes = inStream.available(); 274 if (availableBytes > 0) { 275 // Read the serial port 276 inStream.read(readBuffer, 0, availableBytes); 277 278 // Print it out 279 System.out.println("Recv :" + 280 new String(readBuffer, 0, availableBytes)); 281 } 282 } catch (IOException e) { 283 } I think this is wrong: - exceptions should be ignored never (without even logging) - when code cannot handle an exception, I think it should not catch it (or catch-log-throw) - it assumes 400 bytes are the maximum a serial link can recveive in a read call, but there is no such guarantee by the API - it assumes that read will read availableBytes but there is no such guarantee by API definition - it assumes availableBytes <= readBuffer.length - The STDOUT output depends on timing details (it could happen that in one situation two Recv: lines are printed but in another arbitrary similar situation just one is printed due to different timing details I think InputStream.read(byte[]) is better to be used in a construction like this (assuming it polls based on an event as in the example): // some doReadFunc(): boolean eof = false; int chunkSize = 128; byte[] readData = new byte[0]; while(eof == false && inStream.available()) { byte[] readBuf = new byte[chunkSize]; // available() guaranteed read will not block, but // we may read more than available bytes here (in case more were // received) or less than (if read returns earlier, which is // allowed by spec) - but at least 1. int thisRead = inStream.read(readBuffer, 0, readBuf.length); if (thisRead == -1) { // Please note that we cannot throw here // if (readData.length() > 0), // because caller would not see the contents of readData. // But we could throw in case readData is empty. eof = true; } else { // Now we need a "readData += readBuffer;". // Don't know if this really is so uncomfortable on Java or if I // just don't know how to do it better. This commonly should be // in some appendBuffer helper function (doing realloc + 2copy) byte[]tmpBuf = new byte[readData.length + thisRead]; // assert(readData.length + thisRead == totalRead); System.arraycopy(readData, 0, tmpBuf, 0, readData.length); System.arraycopy(readBuf, 0, tmpBuf, readData.length, thisRead); readData = tmpBuf; } } // readData contains the data that could be read. It could be empty/zero // in case no bytes available(), but it blocks never. It could be that exactly at the time when inStream.available() returned zero a new byte arrives, so typically someone will need to have a message parsing loop around (or integrated) - usually it is easier to try to read what is needed and timeout otherwise (in contrast to read what is avialable and then guess if could be complete by timing). Simple example could be: // has methods "boolean isComplete()" and "int bytesNeeded()". BinaryMessage message; while(!message.isComplete() && !timer.isExpired() ) { // doRead(InputStream, int len) which does NOT BLOCK but return zero // in case there is no data avialable() byte[] readData = doRead(input, message.bytesNeeded()); // we should not poll. With Java InputStream it is hard to handle, // because avialable() has no timeout parameter. We can use small // delays to convert this spinlock to a 20 ms poll which works when // having a few connections only but wastes resources. Better would // be to synchronize with some events such as // SerialPortEvent.DATA_AVAILABLE, but this makes this code depend // on SerialPort (otherwise, it would work on ANY InputStream which // IMHO should be the reason why InputStream exists, but this is // off-topic here) } if (timer.isExpired()) { // handle timeout } // else assert(message.isComplete()); Exceptions could be handled in a way like: String portName = "/dev/ttyS0"; // pseudo code: SerialPort port = SerialPort.open(portName); try { try { thisRead = port.is.read(); if (thisRead == -1) { if (readData.length == 0) { throw new ConnectionClosedByPeerException(); } } } catch {IOException ioex) { CommException ex = new CommIOException(ioex); ex.appendInfo("while reading"); } } catch (CommException ex) { // Instead of the read call above probably we call a method working // on InputStream. This function cannot know the portName, but for // the user this is very important. Because of this we add the // information. We do this on each level/layer: our caller appends // why the port were read (e.g. "while initilizing modem" or // "quering thermometer sensor") and so on. The user then can get a // message like // unexpected DCD drop (carrier lost) while reading /dev/ttyS0 for // Modem communication while sending file UPLOAD.DAT for module // DataReconciliation triggered by Cron Call "Daily Reconciliation" // by application "My Monitor". // much better than "IOException in IO.java:1234"! // They are intended to include ANY information needed to resolve the // issue (without needing complete logs maybe even with // version-dependent stack dumps, which would be horrible). CommException ex = new CommIOException(ioex); ex.appendInfo(" on port " + portName); } Comments, corrections and critics are appreciated! oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From mariusz.dec at gmail.com Mon Nov 30 04:50:40 2009 From: mariusz.dec at gmail.com (M.Dec-Gazeta) Date: Mon, 30 Nov 2009 12:50:40 +0100 Subject: [Rxtx] Disconnecting - close() problem in RXTX solved References: <20091130110602.GG20226@elberon.bln.de.ingenico.com> Message-ID: <17E538BC24EE42EC89F5BB086205F581@mdam2> ----- Original Message ----- From: "Steffen DETTMER" To: "rxtx" Sent: Monday, November 30, 2009 12:06 PM Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved > Hi, > > I could not resist to write about how to use InputStream.read(byte[]) > because I think this again is an example showing it wrongly. > > * M.Dec-Gazeta wrote on Sun, Nov 29, 2009 at 09:01 +0100: >> http://embeddedfreak.wordpress.com/2008/10/08/rxtx-serial-port-helper/ >> >> There is a lot about RXTX, and sample works with Events. >> It differs from original RXTX samples. > I didn't checked this sample befor posting, and I did missusage of the word "works". Sorry, should be "sample prepared for Events". Yesterday afteroon I have checked this technique in XP only, but I have had problems and have switched to other tasks. Steffen, please attach your new complete example to be sure no errors while changing and please let me know in which platform you have tested it. I will check it on my systems. Maybe this is a platform problem? Why I think so: My sample works in Windows and Linux, but in real application I have detected problem with Linux. In old systems we have had hard list of the serial ports, but now user may connect and disconnect USB-Serial dongle while application is running. Effects are clear... We (developers) have to be ready to serve it. And therefore I have an configuration form where user may check device, find it automatically or declare manually COM (dev/tty...) device. Before each auto-looking for my specific device I have (I should) to re-read available ports (I have the button to manually refresh list of the ports as well). In XP and Vista it works very good. No one crash in 5 hours when I was doing that!!! But in Linux (newest Ubuntu) there is a problem. Doing an enumeration of the devices when RXTX driver was previousluy used, places new instance of the RXTXDriver in the memory: CommPortIdentifier.java, line 327. When this action occurs, IOLocked stays 2, previously used device is not visible even if was correctly closed! Application hangs, but I don't know yet where - earlier it was read loop. Now I have to do some other things, later I will go back to problem. Regards Mariusz From oliverhoffmann32 at googlemail.com Mon Nov 30 08:07:31 2009 From: oliverhoffmann32 at googlemail.com (Oliver Hoffmann) Date: Mon, 30 Nov 2009 16:07:31 +0100 Subject: [Rxtx] RXTX for ttyACM0 Message-ID: <200911301607.31300.oliverhoffmann32@googlemail.com> Hi RXTX Crew! I'm currently writing a small application which uses RXTX to communicate with an USB device: ... usb 1-10: new full speed USB device u